Posts

Showing posts with the label General

Bella Ciao solution in C language.- Codechef

   Bella Ciao Problem Code: CHFHEIST 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  � d  days the rate is  � + � P + Q  dollars per day, and after  2 � 2 d  days the rate is  � + 2 � P + 2 Q  dollars per day, and so on. Output the amount of money they will be able to print in the given period. Input Format 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 Format Output For each test case, output in a single line the answer to the problem. Constraints 1 ≤ � ≤ 1 0 5 1 ≤ T ≤ 1 0 5 1 ≤ � ≤ � ≤ 1 0...