ACM (UVa) : 138


Data type:
Long Integer

Process:
output: 6 8 means
1 + 2 + 3 + 4 + 5 = 7 + 8
Sum1 = summation of numbers 1 … < 6
Sum 2 = summation of numbers 6 < … some X
if (Sum1 is equals to Sum2) then print

output:
6 8
35 49
204 288
…. ….
6930 9800
….. …..
235416 332928
……. …….
7997214 11309768
46611179 65918161

output must be right justified in a field of width 10
printf (“%10ld %10ld\n”, First_number, Second_number);

use precalculation, otherwise u’ll get TLE.
first, calculate 20 values of and then insert in an array
ur submitted code will just print the array.

Advertisements

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