Start 2021-04-11 11:00:00

21春编程B2班第二次测试(机试)

End 2021-07-03 00:00:00
Contest is over.
Now 2026-01-16 21:53:43

E. 求能被整除的最小整数

Description

输入3个整数m,n,a;其中m <= n。求m到n中(包括m,n)能被a整除的最小整数,若m到n中没有能被a整除的数则输出-1。

Input

m n a (1≤m,n≤10^9且m≤n,1≤a≤100)

Output

m到n中(包括m,n)能被a整除的最小整数,若m到n中没有能被a整除的数则输出-1。

Examples

Input

7 10 2

Output

8

Submit

Login

Signup
Time Limit 1 second
Memory Limit 128 MB
Submit