Credit Points - STACK ShopClue is an online shopping platform and it is distributing gift vouchers to its esteemed users. The voucher can be redeemed by providing a fixed amount of shopping credit points. Each credit point is sent by a user one by one. Since there is a huge rush of people you are required to manage the users on the basis of first come first serve. To make this process easier, you are allowed to serve K no. of people at one time. You are given an array where you can store the credit points of each user on first come first serve basis. You can serve K people at a given point of time. Finally you need to display the credits details of unserved people. If all users are served at a time, then print "0 users to serve"
Answers
Answered by
0
The input and output format will be according to the number of users and the number of credit points owned by each user.
Explanation:
- If all the mentioned users are served, then you have to print likewise 0 users to serve.
- On the other hand, if the number of users are zero or even less than it we will print an invalid number of users. This will apply if users are greater than zero as well.
- We detonate the number of users to a server by using (K). If this number is less, great or equal to zero we will print an invalid number of users.
- Various Constraints are also applied like 1<=n<=1000; 1<=a[i]<=100; 1<=k<=n;
Similar questions
CBSE BOARD XII,
6 months ago
Computer Science,
6 months ago
Science,
1 year ago
English,
1 year ago
Chemistry,
1 year ago