#P9796. [NERC 2018] Fractions
[NERC 2018] Fractions
Background
Translated from Problem F of NERC 2018.
Problem Description
You are given an integer . You need to construct several proper fractions of the form such that , and each can divide .
Input Format
A positive integer .
Output Format
If it is impossible to construct, output one line NO.
Otherwise, output one valid solution. Output YES, and make . On the second line output an integer , then in the next lines output two integers and .
Note that the range of you output must satisfy .
2
NO
6
YES
2
1 2
1 3
Hint
For all testdata, it is guaranteed that .
For the first sample, there is no solution whose sum equals .
For the second sample, .
Translated by ChatGPT 5