Advertisement
Guest User

Q2SOL

a guest
Apr 21st, 2022
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.27 KB | None | 0 0
  1. t = int(input())
  2. for i in range(t):
  3.     x = int(input())
  4.     ans = 0
  5.     ans1 = 0
  6.     for i in range(1, x + 1):
  7.         if (x % i == 0):
  8.             if (i % 2 == 0):
  9.                 ans += i
  10.             else:
  11.                 ans1 += i
  12.     print(abs(ans - ans1))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement