Max-Min

1

1 votes
Very-Easy
Problem

Recently the new currency is issued by the government of India . So in this new currency only the currency notes of Rs 2000 , 500 , 100 and 50 are valid.
Aniket who has been collecting the money for the batch hoodie visits the bank for converting his total collection of Rs X in the new currency notes. So while standing in the long queue he start thinking of how many maximum and minimum new currency notes he can get from the bank after the exchange .
He asks for your help . Help him by telling the maximum and minimum number of currency notes he will get from the bank.

Input:
First line of input contains T - Total no. of test cases
Each test case has a number X the total collection aniket is having.

Output:
For each testcase, print two space separated integers the maximum and minimum number of notes of new currency Aniket will get.

Constraints
1<=T<=10
0<=X<=105

Time Limit: 5
Memory Limit: 256
Source Limit:
Explanation

In the first case,
for maximum notes of 100 Rs we can get two 50 Rs notes and for minimum we can simply get one 100 Rs note.

Editor Image

?