All Submissions


Problem Description

Multithreading is a widespread programming and execution model that allows multiple threads to exist within the context of a single process. These threads share the process' resources but are able to execute independently. The threaded programming model provides developers with a useful abstraction of concurrent execution.

If the following function is simultaneously called by t separate threads, calculate how many possible values x can finally take on (once all threads have executed completely).


int x = 0;
void f(int c){
 int i;
 for(i=1; i<=c; ++i) x=x+c;
 for(i=c; i>=1; --i) x=x-c;
}


Input Specifications

Each line of the input contains two numbers, c and t as explained above, separated by a space. 0 < c, t < 220.
Corresponding to each line of the input, print in one line the number of possible final values of x.

Sample Input


1 1
1 2
2 1


Sample Output


1
3
1


Problem Setter: Kaustubh Karkare

Languages: C,C++,Java

Time Limit: 2 Second(s)
Score: 100 Point(s)
Input File Limit: 50000 Bytes

Submit

Login to post clarification.

No Clarifications.

Contest

Mode Judge

Passive

Online

Overall Rankings

RankNameScore
1xyz0
2Ams0
3TIP0
4team420
5xyzz0
6asdasdasd0
7abcd0
8khankhan0
9Gabriel0
10gigel0