1
2
3
4
5
6
7
8
|
n=int(input())
for i in range(n):
a , b = map(int, input().split())
if a%b == 0 : ans=0
elif a <b : ans= b-a
else : ans = b - a%b
print(ans)
|
cs |
반응형
'python-algorithm' 카테고리의 다른 글
codeforces 977A - Wrong Subtraction (0) | 2022.04.29 |
---|---|
codeforces 520A - Pangram (0) | 2022.04.29 |
codeforces 339A - Helpful Maths (0) | 2022.04.29 |
Codeforces 734A - Anton and Danik (0) | 2022.04.29 |
codeforces 41A - Translation (0) | 2022.04.28 |
댓글