📌  相关文章
📜  闹钟问题 codeforces polycarp - 任何代码示例

📅  最后修改于: 2022-03-11 15:00:14.007000             🧑  作者: Mango

代码示例1
t = int(input())
for _ in range(t):
    a, b, c, d = map(int, input().split())
    if b >= a:
        print(b)
        continue
    if c <= d:
        print(-1)
        continue
    a -= b
    dif = c - d
    print(b + (a + dif - 1) // dif * c)