uva12149測資A
Input:
22 100 68 1 97 2 45 0
Output:
3795 338350 107134 1 308945 5 31395