Orange Boy Can You Solve It Out? Ep. 32

思考题 in one sentence

Yet Another Easy Problem

Find any positive integer pair a,b so that (a+b)+(a+b)\mod k=n where k,n are given or -1 -1 if not found.

Examples

Input
K=100 N=268
Output
200 34
Explain
200+34+(200+34)mod 100=234+34=268
Input
K=100 N=101
Output
-1 -1

Constriants

Subtask 1(10%):N,K=100
Subtask 2(10%):N,K<=1000
Subtask 3(10%):N,K<=1e5
Subtask 4(30%):log_{10}K is an integer.
Subtask 5(20%):K is a prime
Subtask 6(20%):1<=N,K<=1e9

版权声明:
作者:XGN
链接:https://blog.hellholestudios.top/archives/333
来源:Hell Hole Studios Blog
文章版权归作者所有,未经允许请勿转载。

THE END
分享
二维码
< <上一篇
下一篇>>