#P1763E. Node Pairs
Node Pairs
Description
Let's call an ordered pair of nodes in a directed graph unidirectional if , there exists a path from to , and there are no paths from to .
A directed graph is called -reachable if it contains exactly ordered pairs of nodes such that and and are reachable from each other. Find the minimum number of nodes required to create a -reachable directed graph.
Also, among all such -reachable directed graphs with the minimum number of nodes, let denote a graph which maximizes the number of unidirectional pairs of nodes. Find this number.
The first and only line contains a single integer () — the number of ordered pairs of nodes.
Print a single line containing two integers — the minimum number of nodes required to create a -reachable directed graph, and the maximum number of unidirectional pairs of nodes among all such -reachable directed graphs with the minimum number of nodes.
Input
The first and only line contains a single integer () — the number of ordered pairs of nodes.
Output
Print a single line containing two integers — the minimum number of nodes required to create a -reachable directed graph, and the maximum number of unidirectional pairs of nodes among all such -reachable directed graphs with the minimum number of nodes.
Note
In the first test case, the minimum number of nodes required to create a -reachable directed graph is . Among all -reachable directed graphs with nodes, the following graph is one of the graphs with the maximum number of unidirectional pairs of nodes, which is .