A
A simple question.
We can use a for loop to enumerate the number of basketballs we choose to buy, and then calculate the number of soccer balls we b
展开全文
利用最大公倍数和最小公因数来减小枚举空间
from math import gcd
n,a,b = map(int,input().split())
c = gcd(a,b)
d = a*b//c
l = set()
for i in range(b//c):
for j in range(
展开全文