// // S i r o t a n w a t c h e s o v e r y o u . // // ...Jggg+J+JJJg@NQmgJa....., // ....gH@@@@HHB""""7"YYYYHMMMMMMM@@@@@@@Hma,. // ...JH@@MMHY"! ? __""YH@@@@N&... // ..JH@@HY"~ _TW@@@Mme. // .Jg@@#"= _TTM@@N.. // .Jg@@MY! ?T@@@h,. // .-@@@B! (TM@@@L // .(H@MY ?W@@@+ // .W@@@ .T@@@[ // .d@@M! .T@@N, // .d@M@' -W@@o. // (@@M\ ?M@N, // -d@M% .., .., j@@b // d@@M= TM9 ?MD W@@[ // .H@M: .W@H, // H@Ht ,@@# // (@@M~ .@@h. // .@@M% ..gmHHJ. .JdHga. .H@@e // j@@#_ .@@@@@@@b J@@@@@@@h. .H@@\ // d@@@ .4@@@@@@MF (@@@@@@@@ H@@b // d@@[ ?"BMY"= .d@@@@H, ?TWHHY"! d@@e // J@@b .JJJ-.., ,@@@@@@M% ......... -@@@M. // ?@@M\ ?YHHM@@@@b .. .W@@HP X@@HMWY"= d@@@# // ,@@@L. ?H@Ng&+gd@@#H@@NHaJ+gH@[ J@@@] // X@@@[ ...... ?"YYYYY"" ?"YHHHB"^ ..... (@@@# // WH@N+. .W@@@@MHB= .TWH@M@Hmc .H@@M~ // .H@@@@N, _!~ .d@@@N, // .J@@#T@@@N, .d@@@@@@@b. // (@@@@! .T@@@n, .(H@@@H>.W@@@x // (@@@F 4@@@@MaJ. .d@@@@Y77 4@@@r //.H@@P ?TM@@@@N... .-JH@HMY= d@@N, //(@@@F ?"WM@@@MQa-,. .(J(JN@@M#" Z@@@L // d@@H, (M@@@@@@@Ng&maJ.... .. ...J.J+W@@@@@@HY! .dH@b // ?M@@@N&. ..(JW@@@MM"?7""TYHMH@@HH@@@@@HHHgkHagHa(mggdmmagH@H@@Q@@HMMMHY"7!TMM@@@HaJ,. ..H@@@M^ // ?"W@@@@MN@@@@@H@@MMY" _???!"= ?WMMBYYTMH=7""Y@""?"~^ _"YM@@@@@@@@MH@@@@@#"^ // ?77WMMMYB""! _7"WWMMMY"7= // need #include #include // data structure #include #include #include #include #include #include #include #include #include //#include #include #include #include #include // etc #include #include #include #include #include #include #include #include //std::ifstream ifs("b.in"); //auto& scan_in = ifs; auto& scan_in = std::cin; // input #define INIT std::ios::sync_with_stdio(false);std::cin.tie(0); #define VAR(type, ...)type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__); template void MACRO_VAR_Scan(T& t) { scan_in >> t; } templatevoid MACRO_VAR_Scan(First& first, Rest& ...rest) { scan_in >> first; MACRO_VAR_Scan(rest...); } #define VEC_ROW(type, n, ...)std::vector __VA_ARGS__;MACRO_VEC_ROW_Init(n, __VA_ARGS__); for(int w_=0; w_ void MACRO_VEC_ROW_Init(int n, T& t) { t.resize(n); } templatevoid MACRO_VEC_ROW_Init(int n, First& first, Rest& ...rest) { first.resize(n); MACRO_VEC_ROW_Init(n, rest...); } template void MACRO_VEC_ROW_Scan(int p, T& t) { scan_in >> t[p]; } templatevoid MACRO_VEC_ROW_Scan(int p, First& first, Rest& ...rest) { scan_in >> first[p]; MACRO_VEC_ROW_Scan(p, rest...); } #define VEC(type, c, n) std::vector c(n);for(auto& i:c)scan_in>>i; #define MAT(type, c, m, n) std::vector> c(m, std::vector(n));for(auto& R:c)for(auto& w:R)scan_in>>w; // output templatevoid MACRO_OUT(const T t) { std::cout << t; } templatevoid MACRO_OUT(const First first, const Rest...rest) { std::cout << first << " "; MACRO_OUT(rest...); } #define OUT(...) MACRO_OUT(__VA_ARGS__); #define FOUT(n, dist) std::cout<=(a);--w) #define RREP(w, n) RFOR(w, 0, n) template bool IN(S a, T x, U b) { return a <= x && x < b; } template inline T CHMAX(T& a, const T b) { return a = (a < b) ? b : a; } template inline T CHMIN(T& a, const T b) { return a = (a > b) ? b : a; } // test template using V = std::vector; template using VV = V>; template std::ostream& operator<<(std::ostream& os, const std::pair& p) { os << "(" << p.first << ", " << p.second << ")"; return os; } template std::ostream& operator<<(std::ostream& os, const std::vector& v) { os << "{"; for (size_t i = 0; i < v.size(); ++i) os << v[i] << ((i + 1 < v.size()) ? ", " : ""); os << "}"; return os; } template std::ostream & operator<<(std::ostream & os, const std::set & v) { os << "{"; for (auto it = v.cbegin();;) { os << *it; ++it; if (it == v.cend()) { os << "}"; break; } else { os << ", "; } } return os; } template std::ostream& operator<<(std::ostream & os, const std::map & m) { os << "{"; for (auto it = m.cbegin(); it != m.cend();) { os << it->first << ":" << it->second; ++it; os << (it == m.cend() ? "" : ", "); } os << "}"; return os; } template std::ostream& operator<<(std::ostream & os, std::queue q) { os << "<"; while (!q.empty()) { os << q.front(); q.pop(); os << (q.empty() ? "<" : ", "); } return os; } template std::ostream& operator<<(std::ostream & os, std::stack q) { os << ">"; while (!q.empty()) { os << q.top(); q.pop(); os << (q.empty() ? "]" : ", "); } return os; } namespace std { template class numeric_limits> { public: static constexpr pair max() noexcept { return { numeric_limits::max(), numeric_limits::max() }; } static constexpr pair lowest() noexcept { return { numeric_limits::lowest(), numeric_limits::lowest() }; } }; } // type/const using i64 = std::int_fast64_t; using u64 = std::uint_fast64_t; using ll = long long; using ull = unsigned long long; using ld = long double; using PAIR = std::pair; using PAIRLL = std::pair; constexpr int INFINT = (1 << 30) - 1; // 1.07x10^ 9 constexpr int INFINT_LIM = (1LL << 31) - 1; // 2.15x10^ 9 constexpr ll INFLL = 1LL << 60; // 1.15x10^18 constexpr ll INFLL_LIM = (1LL << 62) - 1 + (1LL << 62); // 9.22x10^18 constexpr double EPS = 1e-6; constexpr i64 MOD = 1000000009; constexpr double PI = 3.141592653589793238462643383279; template void FILL(T(&a)[N], const T & val) { for (auto& x : a) x = val; } template void FILL(ARY(&a)[N][M], const T & val) { for (auto& b : a) FILL(b, val); } template void FILL(std::vector & a, const T & val) { for (auto& x : a) x = val; } template void FILL(std::vector> & a, const T & val) { for (auto& b : a) FILL(b, val); } // ------------>8--------- inline i64 C(i64 n) { ll ans = 591666672; n %= MOD; for (int i = 0; i < 5; ++i) (ans *= n - i) %= MOD; return ans; } int P[] = { 1, 2, 4, 6, 9, 12, 16, 20, 25, 30, 37, 44, 53, 62, 73, 84, 97, 110, 125, 140, 159, 178, 201, 224, 251, 278, 309, 340, 375, 410, 451, 492, 539, 586, 639, 692, 751, 810, 875, 940, 1014, 1088, 1171, 1254, 1346, 1438, 1539, 1640, 1750, 1860, 1982, 2104, 2238, 2372, 2518, 2664, 2822, 2980, 3150, 3320, 3506, 3692, 3894, 4096, 4314, 4532, 4766, 5000, 5250, 5500, 5770, 6040, 6330, 6620, 6930, 7240, 7570, 7900, 8250, 8600, 8975, 9350, 9750, 10150, 10575, 11000, 11450, 11900, 12375, 12850, 13355, 13860, 14395, 14930, 15495, 16060, 16655, 17250, 17875, 18500, 19156, 19812, 20499, 21186, 21904, 22622, 23371, 24120, 24900, 25680, 26492, 27304, 28148, 28992, 29868, 30744, 31652, 32560, 33500, 34440, 35409, 36378, 37376, 38374, 39401, 40428, 41484, 42540, 43625, 44710, 45821, 46932, 48069, 49206, 50369, 51532, 52721, 53910, 55125, 56340, 57574, 58808, 60061, 61314, 62586, 63858, 65149, 66440, 67750, 69060, 70382, 71704, 73038, 74372, 75718, 77064, 78422, 79780, 81150, 82520, 83891, 85262, 86634, 88006, 89379, 90752, 92126, 93500, 94875, 96250, 97615, 98980, 100335, 101690, 103035, 104380, 105715, 107050, 108375, 109700, 111000, 112300, 113575, 114850, 116100, 117350, 118575, 119800, 121000, 122200, 123360, 124520, 125640, 126760, 127840, 128920, 129960, 131000, 132000, 133000, 133951, 134902, 135804, 136706, 137559, 138412, 139216, 140020, 140775, 141530, 142227, 142924, 143563, 144202, 144783, 145364, 145887, 146410, 146875, 147340, 147744, 148148, 148491, 148834, 149116, 149398, 149619, 149840, 150000, 150160, 150256, 150352, 150384, 150416, 150384, 150352, 150256, 150160, 150000, 149840, 149619, 149398, 149116, 148834, 148491, 148148, 147744, 147340, 146875, 146410, 145887, 145364, 144783, 144202, 143563, 142924, 142227, 141530, 140775, 140020, 139216, 138412, 137559, 136706, 135804, 134902, 133951, 133000, 132000, 131000, 129960, 128920, 127840, 126760, 125640, 124520, 123360, 122200, 121000, 119800, 118575, 117350, 116100, 114850, 113575, 112300, 111000, 109700, 108375, 107050, 105715, 104380, 103035, 101690, 100335, 98980, 97615, 96250, 94875, 93500, 92126, 90752, 89379, 88006, 86634, 85262, 83891, 82520, 81150, 79780, 78422, 77064, 75718, 74372, 73038, 71704, 70382, 69060, 67750, 66440, 65149, 63858, 62586, 61314, 60061, 58808, 57574, 56340, 55125, 53910, 52721, 51532, 50369, 49206, 48069, 46932, 45821, 44710, 43625, 42540, 41484, 40428, 39401, 38374, 37376, 36378, 35409, 34440, 33500, 32560, 31652, 30744, 29868, 28992, 28148, 27304, 26492, 25680, 24900, 24120, 23371, 22622, 21904, 21186, 20499, 19812, 19156, 18500, 17875, 17250, 16655, 16060, 15495, 14930, 14395, 13860, 13355, 12850, 12375, 11900, 11450, 11000, 10575, 10150, 9750, 9350, 8975, 8600, 8250, 7900, 7570, 7240, 6930, 6620, 6330, 6040, 5770, 5500, 5250, 5000, 4766, 4532, 4314, 4096, 3894, 3692, 3506, 3320, 3150, 2980, 2822, 2664, 2518, 2372, 2238, 2104, 1982, 1860, 1750, 1640, 1539, 1438, 1346, 1254, 1171, 1088, 1014, 940, 875, 810, 751, 692, 639, 586, 539, 492, 451, 410, 375, 340, 309, 278, 251, 224, 201, 178, 159, 140, 125, 110, 97, 84, 73, 62, 53, 44, 37, 30, 25, 20, 16, 12, 9, 6, 4, 2, 1 }; signed main() { INIT; VAR(int, T); REP(_, T) { VAR(i64, m); m /= 5; i64 ans = 0; i64 lim = std::max((i64)0, m - 466) / 100; for (i64 k = m / 100; k >= lim; --k) (ans += P[m - k * 100] * C(k + 5)) %= MOD; OUT(ans)BR; } return 0; }