Given two integers $X$ and $Y$.
Find the largest integer $Z$ such that $Z \times X \le Y$,
and an integer $W$ between $0$ and $X-1$,
such that the remainder when $W$ is divided by $X$ equals to the remainder when $Y$ is divided by $X$.
Hint (or simplification)
1. find largest $Z$, such that $Z \times X \le Y$
2. find a $W$ ($0 \le W \le X-1$), such that remainder of $W \div X =$ remainder of $Y \div X$
Input Specification
The first line consists of two integers $X$ and $Y$.
Output Specification
Output two integers $Z$ and $W$.
Constraints
For all cases,
$1 \le X \le 10^{18}$
$-10^{18} \le Y \le 10^{18}$
Subtask 1: $Y > 0$ (50 pts)
Subtask 2: No additional constraints (50 pts)
Sample Test Cases
| Input | Output | |
|---|---|---|
| 5 17 | 3 2 |
Scoring: Per Subtask
Authored by s23f32
Appeared in 2026 Mini Comp 1 [WY Interschool Pre-CCC]