ACM (UVa) : 10013


array elements number should be 1000010 for safety …
first take all the inputs and then start to process
its a simple big integer problem
No need to take the inputs as string, use default integer data type
do not print an extra newline at the end of output

Critical input:
4

5
0 9
0 9
0 9
0 9
1 9

5
9 9
9 9
9 9
9 9
9 9

5
0 0
0 0
0 0
0 0
0 0

10
9 6
2 4
8 6
2 3
1 9
7 5
6 8
3 8
9 6
4 9

Critical output:
100000

199998

00000

15746135263

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s