Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- n = int(input())
- for nn in range(n):
- sample = input().split()
- sample = [int(s) for s in sample]
- ratio = sample[2] / sample[1]
- total = 1
- stuff = True
- for s in sample:
- if s == 1:
- continue
- else:
- total *= ratio
- if total != s:
- print('no')
- stuff = False
- break
- if stuff:
- print('yes', int(ratio))
Advertisement
Add Comment
Please, Sign In to add comment