Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

please someone help with this problem

Правка en1, от kaffan_69, 2020-07-26 15:39:53

Dedicate Length Nikhil wants to bring sofa(s) to his room. But he wants to dedicate the entire length of the room to the sofa(s) (yes I know he is a bit weird). Now Nikhil's room length is W meters, and when he went to the shop he found out sofas of two types, one of length N and other of length M. Now, let Nikhil know how many sofas of the first and second type he should buy to reduce wastage of space. First minimize the space wastage then, if similar result arises always prefer the sofa with a larger length. In case N==M give preference to second sofa.

Input format The first line contains an integer T, denoting the number of test cases. Each test case contains three integers W,N and M.

Output format For every testcase print two integers a and b, number of sofa of type 1 and 2 respectively.

Constraints: 1<=T<=10 1<=N,M,W<=10000

Example Input 1 24 3 5

Output 3 3

Explanation Nikhil will buy 3 sofas of size 3 and 3 sofa's of size 5.

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский kaffan_69 2020-07-26 15:39:53 1023 Initial revision (published)