Bob runs a tile shop. He sells only square tiles. He charges $a per unit area and $b per unit length of its side. Moreover, he also charges a constant amount of $c for each tile. He asks you to calculate the total amount he gets after selling exactly one tile of side length x in range [l,r]. Bob knows that his earnings is beyond your calculation, so he asks you to calculate amount modulo (109+7).
First line contains number of test cases, T. Each test case contains 5 integers, a, b, c, l, r.
1 <=T<=10^5
1<=a,b,c,l,r<=10^9
Output a single integer denoting answer as per the problem statement.
1
1 1 1 1 10
450
Result | Score | Time | Language | |
ACCEPTED | 200/200 | 100ms | C++ | View 10 mins ago |
COMPILATION ERROR | 100/200 | 200ms | C | View 10 mins ago |
WRONG ANSWER | 40/200 | 150ms | Python | View 10 mins ago |
RUNTIME ERROR | 50/200 | 150ms | Python | View 10 mins ago |
TLE | 100/200 | 150ms | Python | View 20 mins ago |
MLE | 200/200 | 150ms | C++ | View 40 mins ago |
Rank | User | College | Language | Score |
#40 |
![]()
Siddharth Jain
|
JSS Noida | C++ | 2345 |
01 |
![]() Siddharth Jain
|
JSS Noida | C++ | 2345 |
02 |
![]() Siddharth Jain
|
JSS Noida | Python | 2345 |
03 |
![]() Siddharth Jain
|
JSS Noida | Python | 2345 |
04 |
![]() Siddharth Jain
|
PEC, Chandigarh | C | 2345 |
05 |
![]() Siddharth Jain
|
JSS Noida | Python | 2345 |
06 |
![]() Siddharth Jain
|
PEC, Chandigarh | C++ | 2345 |
07 |
![]() Siddharth Jain
|
JSS Noida | Python | 2345 |
08 |
![]() Siddharth Jain
|
JSS Noida | C++ | 2345 |
09 |
![]() Siddharth Jain
|
JSS Noida | C | 2345 |