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:
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Find the day of the week after K days from the given day
- How to check whether the day is a weekday or not using Pandas in Python?
- Remove Nth node from end of the Linked List
- Why For loop is not preferred in Neural Network Problems?
- CBSE 12th class Paper Solved - 2015-16 session
- Find the Nth natural number which is not divisible by A
- Find Nth number in a sequence which is not a multiple of a given number
- Find day of the week for a given date
- Zeller's Congruence | Find the Day for a Date
- Buy Maximum Stocks if i stocks can be bought on i-th day
- Tomohiko Sakamoto's Algorithm- Finding the day of the week
- Probability of rain on N+1th day
- Python | Pandas Timestamp.day
- Python | Pandas DatetimeIndex.day
- Python | Pandas Period.day
- Python | Pandas PeriodIndex.day
- Python program to find day of the week for a given date
- Python | Pandas Series.dt.day
- Python program to find the first day of given year
- Find the day number in the current year for the given date
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. 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