Not able to get reason behind WA — Codeforces Round #319 Div2 B

Revision en1, by irajdeep, 2015-09-11 18:36:28

So I made two submissions to this problem this problem.

While this solution gets WA at test case 39, this onegets Accepted. While the only difference between them is in the order of calculating a1 and a2. Can anyone help me with the reason as why does the order make a difference? Thanks

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English irajdeep 2015-09-11 18:41:24 13 Tiny change: 'ssions to this problem [this pro' -> 'ssions to [this pro'
en1 English irajdeep 2015-09-11 18:36:28 520 Initial revision (published)