← All problemsSign in

Fountains

There is a garden of length 105 having range x=1 to x=105. There are n number of fountains. Fountain i has range x = l[i] to x = r[i] and drops 1 gallon of water per unit. Bob turns on fountains, trying every subset of Power set(See example for more clarity). Find the total gallons of water mod 109 + 7 given by fountains. Input - The first line of the input contains a single integer n denoting

HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17

CodeSearch Tutor

Hints, not spoilers — it won’t hand over the full solution unless you insist.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start