#include using namespace std; const int N=1e4+9,mod=1e9+9; int dp[N]; int main(){ #ifdef memset0 freopen("1.in","r",stdin); #endif ios::sync_with_stdio(0),cin.tie(0); int n=1e4; dp[0]=1; for(int x:{1,5,10,50,100,500}){ for(int i=0;i+x<=n;i++){ (dp[i+x]+=dp[i])%=mod; } } int T; cin>>T; while(T--){ cin>>n; cout<