当前位置:网站首页>tianqf's problem-solving ideas
tianqf's problem-solving ideas
2022-08-09 07:05:00 【tqfChina】
def gcd(a, b):
if b == 0:
return a
else:
gcd(b, a%b)
def main():
pass
a = input('a:')
b = input('b:')
c = input('c:')
d = input('d:')
if a >= b:
return -1
if c >= d:
return -1
ac = a/gcd(a, c)*c
bd = gcd(b,d)
i = 0
while true:
i += ac
if i <= bd:
if bd%i==0 and i>max(a,c) and i < min(b,d):
print(i)
return 0
else:
return -1
main()
边栏推荐
猜你喜欢
随机推荐
Forest Program dfs+tanjar仙人掌
Integer 线程安全的
jvm线程状态
composer 内存不足够
2022年7月小结
【nuxt】服务器部署步骤
MVN 中配置flyway mysq
SAP ALV 数据导出被截断的bug
eyb:Redis学习(2)
postgresql Window Functions
The water problem of leetcode
2019南昌网络赛 C题,Hello 2019
P7 Alibaba Interview Questions 2020.07 Sliding Window Algorithm (Alibaba Cloud Interview)
Invoker 2019CCPC Qinhuangdao Station I Question Simple DP
The maximum validity period of an SSL certificate is 13 months. Is it necessary to apply for multiple years at a time?
Rsync常见错误
用tensorflow.keras模块化搭建神经网络模型
imageio读取.exr报错 ValueError: Could not find a backend to open `xxx.exr‘ with iomode `r`
当酷雷曼VR直播遇上视频号,会摩擦出怎样的火花?
The JVM thread state