# Find Minimum Number Of Coins

Posted: 9 Dec, 2020

Difficulty: Easy

#### Dora, the explorer, visits India and decides to try the famous Indian food. However, the restaurant accepts only Indian currency i.e. [1, 2, 5, 10, 20, 50, 100, 500, 1000] valued coins.

#### So, Dora goes to a bank that has an infinite supply of each of the denominations to make a change for a given ‘Amount’ of money. As a cashier at the bank, your task is to provide Dora the minimum number of coins that add up to the given ‘Amount’.

##### For Example

```
For Amount = 70, the minimum number of coins required is 2 i.e an Rs. 50 coin and a Rs. 20 coin.
```

##### Note

```
It is always possible to find the minimum number of coins for the given amount. So, the answer will always exist.
```

##### Input Format

```
The first line of input contains an integer 'T' representing the number of test cases or queries to be processed. Then the test case follows.
The only line of each test case contains a single integer ‘Amount’ representing the amount Dora wishes to change to Indian currency.
```

##### Output Format

```
For each test case, print the minimum number of coins needed to make the change.
Print the output of each test case in a separate line.
```

##### Note

```
You do not need to print anything, it has already been taken care of. Just implement the given function.
```

##### Constraints

```
1 <= T <= 100
1 <= Amount <= 10^5
Where 'T' is the number of test-cases
Time Limit: 1sec
```

SIMILAR PROBLEMS

Unit Power Subsets

Posted: 11 Feb, 2022

Difficulty: Hard

Magical Digits

Posted: 13 Feb, 2022

Difficulty: Ninja

Magical Digits

Posted: 13 Feb, 2022

Difficulty: Ninja

Ninja And The LCM

Posted: 12 Apr, 2022

Difficulty: Easy

A Number Game

Posted: 23 Apr, 2022

Difficulty: Moderate

Pair Product Div by K

Posted: 15 May, 2022

Difficulty: Moderate

Pair Product Div by K

Posted: 15 May, 2022

Difficulty: Moderate