#P3152. 正整数序列
正整数序列
Description
kkk made a sequence consisting entirely of positive integers. Don’t think it’s anything magical — it’s just , and is given. kkk’s classmate lzn thinks is a nice number (it looks very round), so when kkk wasn’t around, he cleverly changed the whole sequence into (well, he was just getting ready to do so).
But kkk suddenly came back! lzn’s plan failed. Unwilling to give up, he told kkk: each time, I can select some numbers from this sequence and subtract the same positive integer from all of them. After a finite number of such operations, the entire sequence can become .
kkk didn’t believe it, so lzn calculated the minimum number of such operations needed to make the entire sequence become .
Input Format
A positive integer .
Output Format
Output the minimum number of operations. If there is no solution, output -1.
2
2
Hint
Constraints
For all testdata, .
Translated by ChatGPT 5
京公网安备 11011102002149号