Advertisement
Guest User

Q2SOL

a guest
Apr 21st, 2022
24
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data Copied
Advertisement