CodSULE - May 2019

This is a timed contest for 1 hour. You have just one chance to attempt this test.
  • 00
    Days
  • 12
    Hours
  • 30
    Minutes
  • 05
    Seconds
Problem 2

Birthday Cake Candle

  • Hard

    Dificulty
  • 200

    Max Points
Status: Partially Solved
20/100 Pts
Problem
Submissions

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).

Input Format

First line contains number of test cases, T. Each test case contains 5 integers, a, b, c, l, r.

Constraints

1 <=T<=10^5
1<=a,b,c,l,r<=10^9

Output Format

Output a single integer denoting answer as per the problem statement.

Sample Input

1
1 1 1 1 10

Sample Output

450

{...} Code Editor
Provide Custom Input
Damn! That’s an error!
You were close! Inspect your code again.

Compilation Error

Check the compiler output, fix the error and try again.
Compile Message
Solution.cpp: In function 'int countingValleys(int, std::__cxx11::string)': Solution.cpp:9:1: error: no return statement in function returning non-void [-Werror=return-type]}^cc1plus: some warnings being treated as errors
Input
235
Output
235
View All Questions

Total Questions: 50

Attempted
Unattempted
Marked for Review
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24