Given 3 integers K, P and N. Where, K is the number of problems given to the person every day and P is the maximum number of problems he can solve in a day. Find the total number of problems not solved after the N-th day.
Input : K = 2, P = 1, N = 3 Output : 3 On each day 1 problem is left so 3*1 = 3 problems left after Nth day. Input : K = 4, P = 1, N = 10 Output : 30
If P is greater than or equal to K then all problems will be solved on that day or (K-P) problems will be solved on each day so the answer will be 0 if K<=P else the answer will be (K-P)*N.
Below is the implementation of the above approach:
- CBSE 12th class Paper Solved - 2015-16 session
- Some Tricks to solve problems on Impartial games
- Applying Multinomial Naive Bayes to NLP Problems
- Find number of factors of N when location of its two factors whose product is N is given
- Square free semiprimes in a given range using C++ STL
- Count number of pairs in array having sum divisible by K | SET 2
- Fractional Knapsack Queries
- Count number of pairs of lines intersecting at a Point
- Maximum number of region in which N non-parallel lines can divide a plane
- 21 Matchsticks Problem
- Minimum Possible sum of digits in a positive multiple of N
- Find the smallest positive number which can not be represented by given digits
- Find the average of k digits from the beginning and l digits from the end of the given number
- Number of possible permutations when absolute difference between number of elements to the right and left are given
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.
Improved By : vt_m