#P8948. [YsOI2022] NOIp 和省选
[YsOI2022] NOIp 和省选
Background
To check his teaching skills, Ysuperman decided to give two placement tests to kindergarten kids.
Problem Description
One test has four problems, with a total score of ; the other test has six problems, with a total score of . For each person, the score in each test is a non-negative integer between and the full score (it can be or the full score).
There are students taking these two tests. For student , the score of the first test is , and the score of the second test is . Ysuperman computes the standard score using the following rules:
- Compute the highest scores of the two tests, , with and .
- Let , where is rounded to the nearest integer.
After computing every student's standard score, Ysuperman carelessly lost all the original scores. Can you help find any possible set of original scores?
In other words, given and the standard scores , you need to find a valid set of and satisfying the requirements above.
In particular, there is a very strong kid, Qiu, who got the highest score in both tests, so it is guaranteed that . Also, the other kids are at a similar level, so it is guaranteed that .
Input Format
The first line contains a positive integer .
The next lines each contain a positive integer on line .
Output Format
Output lines. On line , output two non-negative integers . From the statement, you must ensure , , and , .
4
2000
1319
1476
996
233 525
147 361
200 324
0 523
4
2000
1704
1658
1542
400 454
352 374
352 353
320 337
Hint
In Sample 1, the constructed are valid for the following reasons:
The highest scores of the two tests are and , respectively.
.
$1000\times (147\div 233 + 361\div 525) \approx 1318.520\approx 1319$.
$1000\times (200\div 233 + 324\div 525)\approx 1475.512\approx 1476$.
$1000\times (0\div 233 + 523\div 525)\approx 996.190\approx 996$.
For the first of the testdata, it is guaranteed that .
For another of the testdata, it is guaranteed that is a multiple of .
For another of the testdata, it is guaranteed that is a multiple of .
For another of the testdata, it is guaranteed that is a multiple of .
For of the testdata, , , and .
Translated by ChatGPT 5