#include <bits/stdc++.h>
#define ll long long
using namespace std;
ll n;
int main()
{
cin>>n;
while(n--)
{
ll t,d=0;
cin>>t;
if(t>=100) d+=t/100,t%=100;
if(t>=20) d+=t/20,t%=20;
if(t>=10) d+=t/10,t%=10;
if(t>=5) d+=t/5,t%=5;
if(t>=1) d+=t;
cout<<d<<"\n";
}
}
I2luY2x1ZGUgPGJpdHMvc3RkYysrLmg+CiNkZWZpbmUgbGwgbG9uZyBsb25nCnVzaW5nIG5hbWVzcGFjZSBzdGQ7CmxsIG47CmludCBtYWluKCkKewogIGNpbj4+bjsKICB3aGlsZShuLS0pCiAgewogICAgbGwgdCxkPTA7CiAgICBjaW4+PnQ7CiAgICBpZih0Pj0xMDApIGQrPXQvMTAwLHQlPTEwMDsKICAgIGlmKHQ+PTIwKSBkKz10LzIwLHQlPTIwOwogICAgaWYodD49MTApIGQrPXQvMTAsdCU9MTA7CiAgICBpZih0Pj01KSBkKz10LzUsdCU9NTsKICAgIGlmKHQ+PTEpIGQrPXQ7CiAgICBjb3V0PDxkPDwiXG4iOwogIH0KfQ==