In the Square Kingdom, $$$n$$$ residents numbered from $$$1$$$ to $$$n$$$ live alone on top of a tall stone pillar. The height of the pillar for the $$$i$$$-th resident is $$$\left(i + \frac{b}{a}\right)^2$$$ units above the ground.
Since everyone lives so high up, the only way to visit a neighbor is by using a ladder. The kingdom builds one ladder for every pair of residents. The length of each ladder is exactly the absolute difference in height between the two pillars it connects.
With $$$\frac{n(n-1)}{2}$$$ ladders in total, it becomes hard to manage them all. You are asked for the length of the $$$k$$$-th ladder in ascending order of length. This information will help the kingdom plan repairs, deliveries, and community events.
The only line contains four integers $$$n$$$ ($$$2 \le n \le 10^{12}$$$), $$$k$$$ ($$$1 \le k \le \min\left\{\frac{n(n-1)}{2}, 10^{12}\right\}$$$), $$$a$$$ ($$$1 \le a \le 10^6$$$), and $$$b$$$ ($$$0 \le b \le 10^{12}$$$).
Output a line containing two integers $$$p$$$ and $$$q$$$, denoting that the length of the $$$k$$$-th ladder in ascending order of length can be represented as $$$\frac{p}{q}$$$ with two integers $$$p$$$ and $$$q$$$ ($$$p \ge 0$$$, $$$q \ge 1$$$, $$$\gcd(p, q) = 1$$$), where $$$\gcd(p, q)$$$ is the greatest common divisor of $$$p$$$ and $$$q$$$.
3 1 3 1
11 3
3 2 3 1
17 3
3 3 3 1
28 3
1414215 1000000000000 1000000 1000000000000
4823373069559 1
| Название |
|---|


