题解 | 小红的正整数构造
小红的正整数构造
https://www.nowcoder.com/practice/7aa37cbc28034fe5af562ec7e44d1e76
l,r,x=map(int,input().split())
cha=x-(l%x)
if l+cha>r:
print(-1)
else:
print(l+cha)
不需要枚举
小红的正整数构造
https://www.nowcoder.com/practice/7aa37cbc28034fe5af562ec7e44d1e76
l,r,x=map(int,input().split())
cha=x-(l%x)
if l+cha>r:
print(-1)
else:
print(l+cha)
不需要枚举
相关推荐