This question is very very confusing

can you please elaborate this question with the example, what is A and k?
also i understood till n as input and then n numbers as input
that denotes the price of 4 types of items with their rates
but after that what does
100 2
200 4
400 3
800 4
etc etc mean?

ok so here first of all numbers we are given represent q different queriesā€¦ in first query Alex has 100 rs with him and shopkeeper claims k ie 2 products.
in ques it is mentioned that alex want to spend whole amount of moneyā€¦ for this we traverse and check for how many diff products it is possible to spend whole amount and buy and maintain a countā€¦ if this cnt is >= k then ans is Yes else Noā€¦
u can refer my code https://ide.codingblocks.com/s/610689

I hope Iā€™ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.

shouldnā€™t it be cnt==k?
please help out.

it should be cnt >= k

ā€œThe shopkeeper claims that he has atleast ā€˜kā€™ items she can choose from.ā€ because of this at least?

yes @parwalprashansa_dc63e1668bcf7cbc

1 Like

Alrightt. Thank you so much.

1 Like

how do we get idea about that we should use % operator to check the condition