-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAppy2.py
More file actions
30 lines (30 loc) · 765 Bytes
/
Appy2.py
File metadata and controls
30 lines (30 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
# APPY2
def main():
t = int(input())
for i in range(t):
n,a,b,k = map(int,input().split())
n = n
res = 0
if a==1:
res = n//a
res = res - (n//(a*b))
elif b ==1:
res = n//b
res = res - (n//(a*b))
elif a == b:
pass
elif a!= b:
if a%b == 0 or b%a == 0:
if a%b == 0:
res = n//b - n//a
if b%a == 0:
res = n//a - n//b
else:
x = (n//a) + (n//b)
y = (n//(a*b))*2
res = x-y
if res >= k:
print("Win",res)
else:
print("Lose",res)
main()