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

PROGRAMMING:Fractions

Luz5年前 (2021-05-10)题库557
You are given a positive integer n.
Here's a positive integer n
Find a sequence of fractions ai/bi,i=1...k(where ai and bi are positive integers)
Find a fractional series AI / Bi, I = 1... K (AI, Bi is a positive integer)
for some k such that:
K meets the following requirements:
![ 321.png](~/02670444-8411-41f1-87be-cd8522198fba.png)
###Input format:
The input consists of a single integer n (2 ≤ n ≤ 10^9)
The input has an integer to form n (2 < = n < = 10 ^ 9)
###Output format:
In the first line print "YES" if there exists such a sequence of fractions or "NO" otherwise.
If there is such a score sequence, please print "yes" in one line, otherwise print "no";
If there exists such a sequence, next lines should contain a description of the sequence in the following format.
If such a sequence exists, print a description of it on the next line
The second line should contain integer k (1 ≤ k ≤ 100000)k(1≤k≤100000) — the number of elements in the sequence. It
Contains the number of elements in an integer k sequence, if such a description exists
is guaranteed that if such a sequence exists, then there exists a sequence of length at most 100000.
Its maximum length is 100000
Next kk lines should contain fractions of the sequence with two integers ai and bi on each line.
Next line print AI Bi
###Input example:
Here is a set of inputs. For example:
```in
six
```
###Output example:
The corresponding output is given here. For example:
```out
YES
two
1 2
1 3
```







answer:If there is no answer, please comment