Counting Spaghetti SOLUTION Codechef
During a boring night at the restaurant, Chef decided to play with spaghetti. He has R−L+1 spaghetti: exactly one spaghetti with each length between L and R inclusive.
Chef decided to take some of his spaghetti and stick them together to form one very long spaghetti. The length of this spaghetti is the sum of the lengths of the spaghetti he took. In particular, he may take all spaghetti and he may take only one spaghetti as well. How many different spaghetti can he make?
Two spaghetti are considered different if their lengths are different.
The first line of the input contains a single integer T denoting the number of test cases. The description of T test cases follows.
The first and only line of each test case contains two space-separated integers L and R.
For each test case, print a single line containing one integer ― the number of different spaghetti Chef can make.
Subtask #1 (25 points): L=1
Subtask #2 (55 points): L,R≤104
Subtask #3 (20 points): original constraints
SOLUTION AFTER CONTEST
ESET FREE LINCENSE KEYS UPDATED 2020 : https://www.cybergeeksquad.co/2020/11/eset-free-lincense-keys-updated-2020.html
Chegg FREE Premium Accounts:
Udemy Leak Courses:
November Challenge 2020 SOLUTION CodeChef
- Selecting Edges SOLUTION SELEDGE
- Panic! at the Disco SOLUTION PANIC
- Restore Sequence SOLUTION RESTORE
October Lunchtime 2020 CodeChef SOLUTIONS