Created
February 23, 2015 21:07
-
-
Save cshjin/ea5127ae023b47c2181e to your computer and use it in GitHub Desktop.
Code Jam Practice - Round 1A 2008
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
N = int(raw_input()) | |
with open('outfile.txt', 'w') as outfile: | |
for test in range(N): | |
size = int(raw_input()) | |
v1 = sorted(map(int, raw_input().split(" ")), reverse=True) | |
v2 = sorted(map(int, raw_input().split(" "))) | |
pro = 0 | |
for i in range(size): | |
pro += v1[i] * v2[i] | |
outfile.write("Case #{}: ".format(test + 1) + str(pro) + "\n") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment