Ayush7614 / Daily-Coding-DS-ALGO-Practice

A open source project🚀 for bringing all interview💥💥 and competative📘 programming💥💥 question under one repo📐📐
https://daily-ds-algo.github.io/DS-Algo-Website/
MIT License
318 stars 476 forks source link

Bella ciao ( June Challenge 2021 Division 3) codechef #276

Closed arpitgoyal27 closed 3 years ago

arpitgoyal27 commented 3 years ago

Chef is planning a heist in the reserve bank of Chefland. They are planning to hijack the bank for D days and print the money. The initial rate of printing the currency is P dollars per day and they increase the production by Q dollars after every interval of d days. For example, after dd days the rate is P+Qdollars per day, and after 2d days the rate is P+2Q dollars per day, and so on. Output the amount of money they will be able to print in the given period.

Input: -The first line contains an integer T, the number of test cases. Then the test cases follow. -Each test case contains a single line of input, four integers D,d,P,Q

Output: -For each test case, output in a single line the answer to the problem.

I will use c++.

problem link- https://www.codechef.com/JUNE21C/problems/CHFHEIST

akshatnema commented 3 years ago

@arpitgoyal27 please don't submit the solutions to those questions which are part of ongoing contests. CodeChef considers it illegal and against its Code of Conduct. If you want to submit it, do it after the contest ends.

arpitgoyal27 commented 3 years ago

Ok sure