mirror of
https://github.com/tiennm99/codechef.git
synced 2026-06-10 10:10:40 +00:00
22 lines
350 B
C++
22 lines
350 B
C++
#include <iostream>
|
|
|
|
using namespace std;
|
|
|
|
int main()
|
|
{
|
|
int t, n, i, j, sum, a[6] = {1, 2, 5, 10, 50, 100};
|
|
cin >> t;
|
|
for (i = 0; i < t; i++)
|
|
{
|
|
cin >> n;
|
|
sum = 0;
|
|
for (j = 5; j >= 0; j--)
|
|
{
|
|
sum += n/a[j];
|
|
n = n%a[j];
|
|
}
|
|
cout << sum << endl;
|
|
}
|
|
return 0;
|
|
}
|