- Get link
- X
- Other Apps
There are two sisters Alice and Betty. You have
- Alice will get
a (a>0 ) candies; - Betty will get
b (b>0 ) candies; - each sister will get some integer number of candies;
- Alice will get a greater amount of candies than Betty (i.e.
a>b ); - all the candies will be given to one of two sisters (i.e.
a+b=n ).
Your task is to calculate the number of ways to distribute exactly
Formally, find the number of ways to represent
You have to answer
The first line of the input contains one integer
The only line of a test case contains one integer
For each test case, print the answer — the number of ways to distribute exactly
6 7 1 2 3 2000000000 763243547
3 0 0 1 999999999 381621773
For the test case of the example, the
a=6 ,b=1 ;a=5 ,b=2 ;a=4 ,b=3 .
- Get link
- X
- Other Apps
Comments
Post a Comment