• API
• FAQ
• Tools
• Archive
SHARE
TWEET Untitled a guest Feb 17th, 2019 85 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
1. n = int(input())
2. a = [[10 ** 25]*  2 for i in range(35)]
3. for i in range(n):
4.     x = int(input())
5.     y = x % 35
6.     if a[y] > x:
7.         a[y] = a[y]
8.         a[y] = x
9.     elif a[y] > x:
10.         a[y] = x
11. ans1 = 10**25
12. ans2 = 10**25
13. for i in range(35):
14.     for j in range(35):
15.         if (i * j) % 35 == 0:
16.             if (i == j):
17.                 ans1 = min(ans1, a[i] * a[i])
18.             else:
19.                 ans1 = min(ans1, a[i] * a[j])
20.         else:
21.             if (i == j):
22.                 ans2 = min(ans2, a[i] * a[i])
23.             else:
24.                 ans2 = min(ans2, a[i] * a[j])
25. print(ans1, ans2)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy.
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!

Top