Skip to main content
Tuesday (24.11.2026) at 20:00: ALGOR Contest: Round #4 (Special Challenge) starts!

~/algor $ cat problems/algor-bot-va-xabarlar

ALGOR Bot and messages

Medium 1000 ms 256 MB 40%
Share

A Telegram bot has to send a text of $N$ characters. One message holds at most $K$ characters, so the bot splits the text into consecutive messages: each message has exactly $K$ characters, and only the last one has the remaining characters (from $1$ to $K$). For example, with $N = 10$, $K = 3$, $4$ messages are sent and the last has $1$ character; with $N = 15$, $K = 5$, $3$ messages are sent and the last has $5$ characters. Find how many messages the bot sends in total and how many characters the last message has.

Splitting the messages into parts and the size of the last part

Input

One line with two positive integers: $N$ and $K$.

Output

One line with two integers: the number of messages $p$ and the number of characters in the last message $r$.

Note

$1 \le N \le 10^{18}$
$1 \le K \le 10^{9}$

Examples

Input #1
10 3
Output #1
4 1
Input #2
15 5
Output #2
3 5

Sign in to submit a solution

Signing up is free and takes a minute.