P8012 [COCI 2013/2014 #4] NASLJEDSTVO
Description
There is a pile of coins. Someone splits this pile into $N$ parts as evenly as possible and takes one part away, leaving $O$ coins.
By “splitting into $N$ parts as evenly as possible”, we mean dividing the coins into $N$ piles, where each pile contains an integer number of coins, and the difference in the number of coins between any two piles is at most $1$.
We assume that the part taken by this person is one of the smaller parts.
Please find the minimum and the maximum possible number of coins in the original pile.
Input Format
The first line contains a positive integer $N$, meaning the pile is split into $N$ equal parts.
The second line contains a positive integer $O$, meaning that after taking $1$ part out of the $N$ parts, there are $O$ coins left.
Output Format
Output one line with two positive integers, representing the minimum and the maximum possible number of coins in the original pile.
Explanation/Hint
**Sample Explanation #1**
The original pile could have had $9$ coins. The person could have split it into $4+5$ and taken $4$.
The original pile could have had $10$ coins. The person could have split it into $5+5$ and taken $5$.
**Constraints**
For $100\%$ of the testdata, $2\le N\le 15$, $N\le O\le 100$.
**Source**
The score of this problem follows the original COCI problem setting, with a full score of $50$.
Translated from [COCI2013-2014 CONTEST #4](https://hsin.hr/coci/archive/2013_2014/contest4_tasks.pdf) _**T1 NASLJEDSTVO**_。
Translated by ChatGPT 5