-->
当前位置:首页 > 题库

PROGRAMMING:Chinese remainder theorem

Luz5年前 (2021-05-10)题库464
For a batch of items, if a is packed in a box, R1 items will be left; if B is packed in a box, R2 items will be left. Find the minimum number of items in this batch. If there is no integer solution, output "no answer.".
###Input format:
There are four integers in a row, a R1, B R2, and 0 < A, R1, B, R2 < 200000000.
###Output format:
An integer, corresponding to the minimum number of items, or output "no answer.".
###Input example:
Here is a set of inputs. For example:
```in
3 1 4 1
```
```in
300 15 408 12
```
```in
10001 5 600031 7
```
###Output example:
The corresponding output is given here. For example:
```out
one
```
```out
no answer.
```
```out
three billion one hundred and three million nine hundred and sixty thousand three hundred and seventy
```






answer:If there is no answer, please comment