#P9407. [POI 2020/2021 R3] 素数和 / Suma liczb pierwszych
[POI 2020/2021 R3] 素数和 / Suma liczb pierwszych
Background
Translated from XXVIII Olimpiada Informatyczna - Stage III Suma liczb pierwszych.
d2t3。
Problem Description
You are given a number . Find such that the sum of all prime numbers in the interval equals .
If there are multiple solutions, any one is acceptable. If there is no solution, output NIE.
Input Format
One line containing one positive integer .
Output Format
If there is a solution, output one line with two positive integers , your answer.
If there is no solution, output NIE.
15
3 7
9992
4993 4999
100000000
NIE
1000000007
1000000007 1000000007
99999999996
295693 1693067
Hint
For all testdata, .
Constraints
| Subtask ID | Additional Constraints | Score |
|---|---|---|
| 1 | 15 | |
| 2 | 20 | |
| 3 | 40 | |
| 4 | 25 |
Translated by ChatGPT 5