**Compilation/Execution Result:**

Given a tank with capacity C liters which is completely filled in starting. Everyday tank is filled with l liters of water and in the case of overflow extra water is thrown out. Now on i-th day i liters of water is taken out for drinking. We need to find out the day at which tank will become empty the first time.

**Examples:**

**Input **: Capacity = 5
l = 2
**Output :** 4
At the start of 1st day, water in tank = 5
and at the end of the 1st day = (5 - 1) = 4
At the start of 2nd day, water in tank = 4 + 2 = 6
but tank capacity is 5 so water = 5
and at the end of the 2nd day = (5 - 2) = 3
At the start of 3rd day, water in tank = 3 + 2 = 5
and at the end of the 3rd day = (5 - 3) = 2
At the start of 4th day, water in tank = 2 + 2 = 4
and at the end of the 4th day = (4 - 4) = 0
So final answer will be 4

**Input:**

1

5

2

**Output:**

4

Author: Mohit Gupta 4

Shashank_Pathak | 216 |

dark_knights | 201 |

SANJAY5797 | 196 |

Vasudha Gupta | 168 |

surbhi_7 | 168 |

Shashank_Pathak | 572 |

surbhi_7 | 556 |

dark_knights | 540 |

Infinty | 341 |

Vasudha Gupta | 340 |

akhayrutdinov | 4156 |

sanjay05 | 3607 |

Quandray | 2782 |

Ibrahim Nash | 2475 |

Michael Riegger | 2284 |