This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
const int VMAX = 38;
bool check_mask(uint64_t mask) {
for(int i = 1; i <= VMAX; ++i) {
if(mask & (1ll << (i - 1))) continue;
for(int j = 2 * i; j <= VMAX; j += i) {
if(mask & (1ll << (j - 1))) {
for(int k = j + i; k <= VMAX; k += i) {
if(mask & (1ll << (k - 1))) {
if(__gcd(j, k) == i)
return 0;
}
}
}
}
}
return 1;
}
void solve() {
const int SZPREF = 24;
const int SZPREC = VMAX - SZPREF;
int k;
cin >> k;
vector<int> Prec =
{988585, 684169, 929658, 640704, 690327, 481280, 641984, 446016, 635938, 434304, 608768, 414592, 436096, 301568, 413184, 284928, 987393, 684160, 928640, 640704, 690240, 481280, 641984, 446016, 635136, 434304, 608000, 414592, 436096, 301568, 413184, 284928, 526486, 304774, 513980, 298240, 349240, 206208, 340480, 201600, 319384, 186368, 319384, 186368, 205440, 122880, 205440, 122880, 525824, 304768, 513408, 298240, 349184, 206208, 340480, 201600, 318976, 186368, 318976, 186368, 205440, 122880, 205440, 122880, 987393, 684160, 928640, 640704, 690240, 481280, 641984, 446016, 635136, 434304, 608000, 414592, 436096, 301568, 413184, 284928, 987392, 684160, 928640, 640704, 690240, 481280, 641984, 446016, 635136, 434304, 608000, 414592, 436096, 301568, 413184, 284928, 525824, 304768, 513408, 298240, 349184, 206208, 340480, 201600, 318976, 186368, 318976, 186368, 205440, 122880, 205440, 122880, 525824, 304768, 513408, 298240, 349184, 206208, 340480, 201600, 318976, 186368, 318976, 186368, 205440, 122880, 205440, 122880, 787022, 544256, 751152, 517888, 546944, 381312, 516224, 358784, 529048, 360064, 507520, 344576, 362240, 249600, 344064, 236544, 786176, 544256, 750336, 517888, 546944, 381312, 516224, 358784, 528384, 360064, 506880, 344576, 362240, 249600, 344064, 236544, 418256, 242688, 418256, 242688, 278656, 164864, 278656, 164864, 262480, 153600, 262480, 153600, 168960, 101376, 168960, 101376, 417792, 242688, 417792, 242688, 278656, 164864, 278656, 164864, 262144, 153600, 262144, 153600, 168960, 101376, 168960, 101376, 786176, 544256, 750336, 517888, 546944, 381312, 516224, 358784, 528384, 360064, 506880, 344576, 362240, 249600, 344064, 236544, 786176, 544256, 750336, 517888, 546944, 381312, 516224, 358784, 528384, 360064, 506880, 344576, 362240, 249600, 344064, 236544, 417792, 242688, 417792, 242688, 278656, 164864, 278656, 164864, 262144, 153600, 262144, 153600, 168960, 101376, 168960, 101376, 417792, 242688, 417792, 242688, 278656, 164864, 278656, 164864, 262144, 153600, 262144, 153600, 168960, 101376, 168960, 101376, 623115, 435552, 574944, 400544, 495204, 346480, 451600, 314928, 389120, 270016, 367488, 254400, 309504, 215040, 289152, 200448, 623008, 435552, 574944, 400544, 495120, 346480, 451600, 314928, 389120, 270016, 367488, 254400, 309504, 215040, 289152, 200448, 335400, 197824, 324576, 192192, 264120, 155808, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 335328, 197824, 324576, 192192, 264064, 155808, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 623008, 435552, 574944, 400544, 495120, 346480, 451600, 314928, 389120, 270016, 367488, 254400, 309504, 215040, 289152, 200448, 623008, 435552, 574944, 400544, 495120, 346480, 451600, 314928, 389120, 270016, 367488, 254400, 309504, 215040, 289152, 200448, 335328, 197824, 324576, 192192, 264064, 155808, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 335328, 197824, 324576, 192192, 264064, 155808, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 491328, 343232, 462144, 321984, 387168, 270624, 359520, 250656, 322816, 223488, 305664, 211200, 255744, 177408, 239616, 165888, 491328, 343232, 462144, 321984, 387168, 270624, 359520, 250656, 322816, 223488, 305664, 211200, 255744, 177408, 239616, 165888, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 491328, 343232, 462144, 321984, 387168, 270624, 359520, 250656, 322816, 223488, 305664, 211200, 255744, 177408, 239616, 165888, 491328, 343232, 462144, 321984, 387168, 270624, 359520, 250656, 322816, 223488, 305664, 211200, 255744, 177408, 239616, 165888, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 929658, 640704, 928120, 639488, 641984, 446016, 640704, 444992, 608768, 414592, 608768, 414592, 413184, 284928, 413184, 284928, 928640, 640704, 927104, 639488, 641984, 446016, 640704, 444992, 608000, 414592, 608000, 414592, 413184, 284928, 413184, 284928, 513980, 298240, 513980, 298240, 340480, 201600, 340480, 201600, 319384, 186368, 319384, 186368, 205440, 122880, 205440, 122880, 513408, 298240, 513408, 298240, 340480, 201600, 340480, 201600, 318976, 186368, 318976, 186368, 205440, 122880, 205440, 122880, 928640, 640704, 927104, 639488, 641984, 446016, 640704, 444992, 608000, 414592, 608000, 414592, 413184, 284928, 413184, 284928, 928640, 640704, 927104, 639488, 641984, 446016, 640704, 444992, 608000, 414592, 608000, 414592, 413184, 284928, 413184, 284928, 513408, 298240, 513408, 298240, 340480, 201600, 340480, 201600, 318976, 186368, 318976, 186368, 205440, 122880, 205440, 122880, 513408, 298240, 513408, 298240, 340480, 201600, 340480, 201600, 318976, 186368, 318976, 186368, 205440, 122880, 205440, 122880, 751152, 517888, 751152, 517888, 516224, 358784, 516224, 358784, 507520, 344576, 507520, 344576, 344064, 236544, 344064, 236544, 750336, 517888, 750336, 517888, 516224, 358784, 516224, 358784, 506880, 344576, 506880, 344576, 344064, 236544, 344064, 236544, 418256, 242688, 418256, 242688, 278656, 164864, 278656, 164864, 262480, 153600, 262480, 153600, 168960, 101376, 168960, 101376, 417792, 242688, 417792, 242688, 278656, 164864, 278656, 164864, 262144, 153600, 262144, 153600, 168960, 101376, 168960, 101376, 750336, 517888, 750336, 517888, 516224, 358784, 516224, 358784, 506880, 344576, 506880, 344576, 344064, 236544, 344064, 236544, 750336, 517888, 750336, 517888, 516224, 358784, 516224, 358784, 506880, 344576, 506880, 344576, 344064, 236544, 344064, 236544, 417792, 242688, 417792, 242688, 278656, 164864, 278656, 164864, 262144, 153600, 262144, 153600, 168960, 101376, 168960, 101376, 417792, 242688, 417792, 242688, 278656, 164864, 278656, 164864, 262144, 153600, 262144, 153600, 168960, 101376, 168960, 101376, 574944, 400544, 573792, 399648, 451600, 314928, 450576, 314160, 367488, 254400, 367488, 254400, 289152, 200448, 289152, 200448, 574944, 400544, 573792, 399648, 451600, 314928, 450576, 314160, 367488, 254400, 367488, 254400, 289152, 200448, 289152, 200448, 324576, 192192, 324576, 192192, 255360, 151200, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 324576, 192192, 324576, 192192, 255360, 151200, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 574944, 400544, 573792, 399648, 451600, 314928, 450576, 314160, 367488, 254400, 367488, 254400, 289152, 200448, 289152, 200448, 574944, 400544, 573792, 399648, 451600, 314928, 450576, 314160, 367488, 254400, 367488, 254400, 289152, 200448, 289152, 200448, 324576, 192192, 324576, 192192, 255360, 151200, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 324576, 192192, 324576, 192192, 255360, 151200, 255360, 151200, 196416, 117504, 196416, 117504, 154080, 92160, 154080, 92160, 462144, 321984, 462144, 321984, 359520, 250656, 359520, 250656, 305664, 211200, 305664, 211200, 239616, 165888, 239616, 165888, 462144, 321984, 462144, 321984, 359520, 250656, 359520, 250656, 305664, 211200, 305664, 211200, 239616, 165888, 239616, 165888, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 462144, 321984, 462144, 321984, 359520, 250656, 359520, 250656, 305664, 211200, 305664, 211200, 239616, 165888, 239616, 165888, 462144, 321984, 462144, 321984, 359520, 250656, 359520, 250656, 305664, 211200, 305664, 211200, 239616, 165888, 239616, 165888, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 263424, 155904, 263424, 155904, 208992, 123648, 208992, 123648, 161280, 96768, 161280, 96768, 126720, 76032, 126720, 76032, 495373, 417608, 461312, 392800, 346720, 295488, 319616, 275328, 276868, 240000, 264320, 230400, 197760, 172928, 187008, 164608, 495360, 417600, 461312, 392800, 346720, 295488, 319616, 275328, 276864, 240000, 264320, 230400, 197760, 172928, 187008, 164608, 219654, 219654, 214528, 214528, 147456, 147456, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 219648, 219648, 214528, 214528, 147456, 147456, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 495360, 417600, 461312, 392800, 346720, 295488, 319616, 275328, 276864, 240000, 264320, 230400, 197760, 172928, 187008, 164608, 495360, 417600, 461312, 392800, 346720, 295488, 319616, 275328, 276864, 240000, 264320, 230400, 197760, 172928, 187008, 164608, 219648, 219648, 214528, 214528, 147456, 147456, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 219648, 219648, 214528, 214528, 147456, 147456, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 393600, 332544, 372864, 317184, 274688, 234240, 257152, 221184, 229504, 200192, 219648, 192512, 163584, 143872, 155136, 137216, 393600, 332544, 372864, 317184, 274688, 234240, 257152, 221184, 229504, 200192, 219648, 192512, 163584, 143872, 155136, 137216, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 393600, 332544, 372864, 317184, 274688, 234240, 257152, 221184, 229504, 200192, 219648, 192512, 163584, 143872, 155136, 137216, 393600, 332544, 372864, 317184, 274688, 234240, 257152, 221184, 229504, 200192, 219648, 192512, 163584, 143872, 155136, 137216, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 312928, 267872, 286400, 248032, 248592, 213184, 224976, 195264, 179104, 157184, 168864, 149184, 143360, 125952, 133632, 118272, 312928, 267872, 286400, 248032, 248592, 213184, 224976, 195264, 179104, 157184, 168864, 149184, 143360, 125952, 133632, 118272, 141504, 141504, 137280, 137280, 111456, 111456, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 141504, 141504, 137280, 137280, 111456, 111456, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 312928, 267872, 286400, 248032, 248592, 213184, 224976, 195264, 179104, 157184, 168864, 149184, 143360, 125952, 133632, 118272, 312928, 267872, 286400, 248032, 248592, 213184, 224976, 195264, 179104, 157184, 168864, 149184, 143360, 125952, 133632, 118272, 141504, 141504, 137280, 137280, 111456, 111456, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 141504, 141504, 137280, 137280, 111456, 111456, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 246464, 211584, 230208, 199296, 194016, 167040, 179040, 155520, 148224, 130816, 140160, 124416, 118272, 104448, 110592, 98304, 246464, 211584, 230208, 199296, 194016, 167040, 179040, 155520, 148224, 130816, 140160, 124416, 118272, 104448, 110592, 98304, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 246464, 211584, 230208, 199296, 194016, 167040, 179040, 155520, 148224, 130816, 140160, 124416, 118272, 104448, 110592, 98304, 246464, 211584, 230208, 199296, 194016, 167040, 179040, 155520, 148224, 130816, 140160, 124416, 118272, 104448, 110592, 98304, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 461312, 392800, 460352, 392192, 319616, 275328, 318784, 274816, 264320, 230400, 264320, 230400, 187008, 164608, 187008, 164608, 461312, 392800, 460352, 392192, 319616, 275328, 318784, 274816, 264320, 230400, 264320, 230400, 187008, 164608, 187008, 164608, 214528, 214528, 214528, 214528, 144000, 144000, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 214528, 214528, 214528, 214528, 144000, 144000, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 461312, 392800, 460352, 392192, 319616, 275328, 318784, 274816, 264320, 230400, 264320, 230400, 187008, 164608, 187008, 164608, 461312, 392800, 460352, 392192, 319616, 275328, 318784, 274816, 264320, 230400, 264320, 230400, 187008, 164608, 187008, 164608, 214528, 214528, 214528, 214528, 144000, 144000, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 214528, 214528, 214528, 214528, 144000, 144000, 144000, 144000, 119296, 119296, 119296, 119296, 81920, 81920, 81920, 81920, 372864, 317184, 372864, 317184, 257152, 221184, 257152, 221184, 219648, 192512, 219648, 192512, 155136, 137216, 155136, 137216, 372864, 317184, 372864, 317184, 257152, 221184, 257152, 221184, 219648, 192512, 219648, 192512, 155136, 137216, 155136, 137216, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 372864, 317184, 372864, 317184, 257152, 221184, 257152, 221184, 219648, 192512, 219648, 192512, 155136, 137216, 155136, 137216, 372864, 317184, 372864, 317184, 257152, 221184, 257152, 221184, 219648, 192512, 219648, 192512, 155136, 137216, 155136, 137216, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 174592, 174592, 174592, 174592, 117760, 117760, 117760, 117760, 98304, 98304, 98304, 98304, 67584, 67584, 67584, 67584, 286400, 248032, 285696, 247584, 224976, 195264, 224400, 194880, 168864, 149184, 168864, 149184, 133632, 118272, 133632, 118272, 286400, 248032, 285696, 247584, 224976, 195264, 224400, 194880, 168864, 149184, 168864, 149184, 133632, 118272, 133632, 118272, 137280, 137280, 137280, 137280, 108000, 108000, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 137280, 137280, 137280, 137280, 108000, 108000, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 286400, 248032, 285696, 247584, 224976, 195264, 224400, 194880, 168864, 149184, 168864, 149184, 133632, 118272, 133632, 118272, 286400, 248032, 285696, 247584, 224976, 195264, 224400, 194880, 168864, 149184, 168864, 149184, 133632, 118272, 133632, 118272, 137280, 137280, 137280, 137280, 108000, 108000, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 137280, 137280, 137280, 137280, 108000, 108000, 108000, 108000, 78336, 78336, 78336, 78336, 61440, 61440, 61440, 61440, 230208, 199296, 230208, 199296, 179040, 155520, 179040, 155520, 140160, 124416, 140160, 124416, 110592, 98304, 110592, 98304, 230208, 199296, 230208, 199296, 179040, 155520, 179040, 155520, 140160, 124416, 140160, 124416, 110592, 98304, 110592, 98304, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 230208, 199296, 230208, 199296, 179040, 155520, 179040, 155520, 140160, 124416, 140160, 124416, 110592, 98304, 110592, 98304, 230208, 199296, 230208, 199296, 179040, 155520, 179040, 155520, 140160, 124416, 140160, 124416, 110592, 98304, 110592, 98304, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 111360, 111360, 111360, 111360, 88320, 88320, 88320, 88320, 64512, 64512, 64512, 64512, 50688, 50688, 50688, 50688, 634258, 436160, 598816, 409984, 281578, 195264, 265280, 183360, 480806, 326784, 462160, 313344, 209504, 144160, 201088, 138112, 633472, 436160, 598144, 409984, 281536, 195264, 265280, 183360, 480192, 326784, 461568, 313344, 209504, 144160, 201088, 138112, 281966, 163200, 275000, 159744, 120472, 71424, 117376, 69888, 203016, 118272, 203016, 118272, 84480, 50688, 84480, 50688, 281600, 163200, 274688, 159744, 120448, 71424, 117376, 69888, 202752, 118272, 202752, 118272, 84480, 50688, 84480, 50688, 633472, 436160, 598144, 409984, 281536, 195264, 265280, 183360, 480192, 326784, 461568, 313344, 209504, 144160, 201088, 138112, 633472, 436160, 598144, 409984, 281536, 195264, 265280, 183360, 480192, 326784, 461568, 313344, 209504, 144160, 201088, 138112, 281600, 163200, 274688, 159744, 120448, 71424, 117376, 69888, 202752, 118272, 202752, 118272, 84480, 50688, 84480, 50688, 281600, 163200, 274688, 159744, 120448, 71424, 117376, 69888, 202752, 118272, 202752, 118272, 84480, 50688, 84480, 50688, 504116, 343424, 482592, 327936, 224384, 154496, 214400, 147328, 443060, 301056, 426016, 288768, 193856, 133312, 186112, 127744, 503552, 343424, 482048, 327936, 224384, 154496, 214400, 147328, 442496, 301056, 425472, 288768, 193856, 133312, 186112, 127744, 210160, 122880, 210160, 122880, 89600, 53760, 89600, 53760, 184560, 107520, 184560, 107520, 76800, 46080, 76800, 46080, 209920, 122880, 209920, 122880, 89600, 53760, 89600, 53760, 184320, 107520, 184320, 107520, 76800, 46080, 76800, 46080, 503552, 343424, 482048, 327936, 224384, 154496, 214400, 147328, 442496, 301056, 425472, 288768, 193856, 133312, 186112, 127744, 503552, 343424, 482048, 327936, 224384, 154496, 214400, 147328, 442496, 301056, 425472, 288768, 193856, 133312, 186112, 127744, 209920, 122880, 209920, 122880, 89600, 53760, 89600, 53760, 184320, 107520, 184320, 107520, 76800, 46080, 76800, 46080, 209920, 122880, 209920, 122880, 89600, 53760, 89600, 53760, 184320, 107520, 184320, 107520, 76800, 46080, 76800, 46080, 400304, 279136, 370272, 257376, 200152, 139568, 185136, 128688, 291840, 202368, 277056, 191808, 145920, 101184, 138528, 95904, 400224, 279136, 370272, 257376, 200112, 139568, 185136, 128688, 291840, 202368, 277056, 191808, 145920, 101184, 138528, 95904, 182256, 107904, 176064, 104832, 91128, 53952, 88032, 52416, 126720, 76032, 126720, 76032, 63360, 38016, 63360, 38016, 182208, 107904, 176064, 104832, 91104, 53952, 88032, 52416, 126720, 76032, 126720, 76032, 63360, 38016, 63360, 38016, 400224, 279136, 370272, 257376, 200112, 139568, 185136, 128688, 291840, 202368, 277056, 191808, 145920, 101184, 138528, 95904, 400224, 279136, 370272, 257376, 200112, 139568, 185136, 128688, 291840, 202368, 277056, 191808, 145920, 101184, 138528, 95904, 182208, 107904, 176064, 104832, 91104, 53952, 88032, 52416, 126720, 76032, 126720, 76032, 63360, 38016, 63360, 38016, 182208, 107904, 176064, 104832, 91104, 53952, 88032, 52416, 126720, 76032, 126720, 76032, 63360, 38016, 63360, 38016, 314944, 218432, 297024, 205632, 157472, 109216, 148512, 102816, 268032, 185856, 254592, 176256, 134016, 92928, 127296, 88128, 314944, 218432, 297024, 205632, 157472, 109216, 148512, 102816, 268032, 185856, 254592, 176256, 134016, 92928, 127296, 88128, 134400, 80640, 134400, 80640, 67200, 40320, 67200, 40320, 115200, 69120, 115200, 69120, 57600, 34560, 57600, 34560, 134400, 80640, 134400, 80640, 67200, 40320, 67200, 40320, 115200, 69120, 115200, 69120, 57600, 34560, 57600, 34560, 314944, 218432, 297024, 205632, 157472, 109216, 148512, 102816, 268032, 185856, 254592, 176256, 134016, 92928, 127296, 88128, 314944, 218432, 297024, 205632, 157472, 109216, 148512, 102816, 268032, 185856, 254592, 176256, 134016, 92928, 127296, 88128, 134400, 80640, 134400, 80640, 67200, 40320, 67200, 40320, 115200, 69120, 115200, 69120, 57600, 34560, 57600, 34560, 134400, 80640, 134400, 80640, 67200, 40320, 67200, 40320, 115200, 69120, 115200, 69120, 57600, 34560, 57600, 34560, 598816, 409984, 598816, 409984, 265280, 183360, 265280, 183360, 462160, 313344, 462160, 313344, 201088, 138112, 201088, 138112, 598144, 409984, 598144, 409984, 265280, 183360, 265280, 183360, 461568, 313344, 461568, 313344, 201088, 138112, 201088, 138112, 275000, 159744, 275000, 159744, 117376, 69888, 117376, 69888, 203016, 118272, 203016, 118272, 84480, 50688, 84480, 50688, 274688, 159744, 274688, 159744, 117376, 69888, 117376, 69888, 202752, 118272, 202752, 118272, 84480, 50688, 84480, 50688, 598144, 409984, 598144, 409984, 265280, 183360, 265280, 183360, 461568, 313344, 461568, 313344, 201088, 138112, 201088, 138112, 598144, 409984, 598144, 409984, 265280, 183360, 265280, 183360, 461568, 313344, 461568, 313344, 201088, 138112, 201088, 138112, 274688, 159744, 274688, 159744, 117376, 69888, 117376, 69888, 202752, 118272, 202752, 118272, 84480, 50688, 84480, 50688, 274688, 159744, 274688, 159744, 117376, 69888, 117376, 69888, 202752, 118272, 202752, 118272, 84480, 50688, 84480, 50688, 482592, 327936, 482592, 327936, 214400, 147328, 214400, 147328, 426016, 288768, 426016, 288768, 186112, 127744, 186112, 127744, 482048, 327936, 482048, 327936, 214400, 147328, 214400, 147328, 425472, 288768, 425472, 288768, 186112, 127744, 186112, 127744, 210160, 122880, 210160, 122880, 89600, 53760, 89600, 53760, 184560, 107520, 184560, 107520, 76800, 46080, 76800, 46080, 209920, 122880, 209920, 122880, 89600, 53760, 89600, 53760, 184320, 107520, 184320, 107520, 76800, 46080, 76800, 46080, 482048, 327936, 482048, 327936, 214400, 147328, 214400, 147328, 425472, 288768, 425472, 288768, 186112, 127744, 186112, 127744, 482048, 327936, 482048, 327936, 214400, 147328, 214400, 147328, 425472, 288768, 425472, 288768, 186112, 127744, 186112, 127744, 209920, 122880, 209920, 122880, 89600, 53760, 89600, 53760, 184320, 107520, 184320, 107520, 76800, 46080, 76800, 46080, 209920, 122880, 209920, 122880, 89600, 53760, 89600, 53760, 184320, 107520, 184320, 107520, 76800, 46080, 76800, 46080, 370272, 257376, 370272, 257376, 185136, 128688, 185136, 128688, 277056, 191808, 277056, 191808, 138528, 95904, 138528, 95904, 370272, 257376, 370272, 257376, 185136, 128688, 185136, 128688, 277056, 191808, 277056, 191808, 138528, 95904, 138528, 95904, 176064, 104832, 176064, 104832, 88032, 52416, 88032, 52416, 126720, 76032, 126720, 76032, 63360, 38016, 63360, 38016, 176064, 104832, 176064, 104832, 88032, 52416, 88032, 52416, 126720, 76032, 126720, 76032, 63360, 38016, 63360, 38016, 370272, 257376, 370272, 257376, 185136, 128688, 185136, 128688, 277056, 191808, 277056, 191808, 138528, 95904, 138528, 95904, 370272, 257376, 370272, 257376, 185136, 128688, 185136, 128688, 277056, 191808, 277056, 191808, 138528, 95904, 138528, 95904, 176064, 104832, 176064, 104832, 88032, 52416, 88032, 52416, 126720, 76032, 126720, 76032, 63360, 38016, 63360, 38016, 176064, 104832, 176064, 104832, 88032, 52416, 88032, 52416, 126720, 76032, 126720, 76032, 63360, 38016, 63360, 38016, 297024, 205632, 297024, 205632, 148512, 102816, 148512, 102816, 254592, 176256, 254592, 176256, 127296, 88128, 127296, 88128, 297024, 205632, 297024, 205632, 148512, 102816, 148512, 102816, 254592, 176256, 254592, 176256, 127296, 88128, 127296, 88128, 134400, 80640, 134400, 80640, 67200, 40320, 67200, 40320, 115200, 69120, 115200, 69120, 57600, 34560, 57600, 34560, 134400, 80640, 134400, 80640, 67200, 40320, 67200, 40320, 115200, 69120, 115200, 69120, 57600, 34560, 57600, 34560, 297024, 205632, 297024, 205632, 148512, 102816, 148512, 102816, 254592, 176256, 254592, 176256, 127296, 88128, 127296, 88128, 297024, 205632, 297024, 205632, 148512, 102816, 148512, 102816, 254592, 176256, 254592, 176256, 127296, 88128, 127296, 88128, 134400, 80640, 134400, 80640, 67200, 40320, 67200, 40320, 115200, 69120, 115200, 69120, 57600, 34560, 57600, 34560, 134400, 80640, 134400, 80640, 67200, 40320, 67200, 40320, 115200, 69120, 115200, 69120, 57600, 34560, 57600, 34560, 315968, 269184, 295232, 254208, 140576, 121216, 131392, 114432, 207776, 181184, 199296, 174592, 94272, 82944, 90368, 79872, 315968, 269184, 295232, 254208, 140576, 121216, 131392, 114432, 207776, 181184, 199296, 174592, 94272, 82944, 90368, 79872, 117504, 117504, 114816, 114816, 51072, 51072, 49920, 49920, 76032, 76032, 76032, 76032, 33792, 33792, 33792, 33792, 117504, 117504, 114816, 114816, 51072, 51072, 49920, 49920, 76032, 76032, 76032, 76032, 33792, 33792, 33792, 33792, 315968, 269184, 295232, 254208, 140576, 121216, 131392, 114432, 207776, 181184, 199296, 174592, 94272, 82944, 90368, 79872, 315968, 269184, 295232, 254208, 140576, 121216, 131392, 114432, 207776, 181184, 199296, 174592, 94272, 82944, 90368, 79872, 117504, 117504, 114816, 114816, 51072, 51072, 49920, 49920, 76032, 76032, 76032, 76032, 33792, 33792, 33792, 33792, 117504, 117504, 114816, 114816, 51072, 51072, 49920, 49920, 76032, 76032, 76032, 76032, 33792, 33792, 33792, 33792, 248448, 215808, 236160, 206336, 111168, 97536, 105600, 93184, 191296, 166784, 183552, 160768, 87040, 76544, 83456, 73728, 248448, 215808, 236160, 206336, 111168, 97536, 105600, 93184, 191296, 166784, 183552, 160768, 87040, 76544, 83456, 73728, 88320, 88320, 88320, 88320, 38400, 38400, 38400, 38400, 69120, 69120, 69120, 69120, 30720, 30720, 30720, 30720, 88320, 88320, 88320, 88320, 38400, 38400, 38400, 38400, 69120, 69120, 69120, 69120, 30720, 30720, 30720, 30720, 248448, 215808, 236160, 206336, 111168, 97536, 105600, 93184, 191296, 166784, 183552, 160768, 87040, 76544, 83456, 73728, 248448, 215808, 236160, 206336, 111168, 97536, 105600, 93184, 191296, 166784, 183552, 160768, 87040, 76544, 83456, 73728, 88320, 88320, 88320, 88320, 38400, 38400, 38400, 38400, 69120, 69120, 69120, 69120, 30720, 30720, 30720, 30720, 88320, 88320, 88320, 88320, 38400, 38400, 38400, 38400, 69120, 69120, 69120, 69120, 30720, 30720, 30720, 30720, 200160, 173568, 183840, 161280, 100080, 86784, 91920, 80640, 134912, 119296, 127872, 113664, 67456, 59648, 63936, 56832, 200160, 173568, 183840, 161280, 100080, 86784, 91920, 80640, 134912, 119296, 127872, 113664, 67456, 59648, 63936, 56832, 77184, 77184, 74880, 74880, 38592, 38592, 37440, 37440, 50688, 50688, 50688, 50688, 25344, 25344, 25344, 25344, 77184, 77184, 74880, 74880, 38592, 38592, 37440, 37440, 50688, 50688, 50688, 50688, 25344, 25344, 25344, 25344, 200160, 173568, 183840, 161280, 100080, 86784, 91920, 80640, 134912, 119296, 127872, 113664, 67456, 59648, 63936, 56832, 200160, 173568, 183840, 161280, 100080, 86784, 91920, 80640, 134912, 119296, 127872, 113664, 67456, 59648, 63936, 56832, 77184, 77184, 74880, 74880, 38592, 38592, 37440, 37440, 50688, 50688, 50688, 50688, 25344, 25344, 25344, 25344, 77184, 77184, 74880, 74880, 38592, 38592, 37440, 37440, 50688, 50688, 50688, 50688, 25344, 25344, 25344, 25344, 156480, 138240, 146880, 130560, 78240, 69120, 73440, 65280, 123904, 109568, 117504, 104448, 61952, 54784, 58752, 52224, 156480, 138240, 146880, 130560, 78240, 69120, 73440, 65280, 123904, 109568, 117504, 104448, 61952, 54784, 58752, 52224, 57600, 57600, 57600, 57600, 28800, 28800, 28800, 28800, 46080, 46080, 46080, 46080, 23040, 23040, 23040, 23040, 57600, 57600, 57600, 57600, 28800, 28800, 28800, 28800, 46080, 46080, 46080, 46080, 23040, 23040, 23040, 23040, 156480, 138240, 146880, 130560, 78240, 69120, 73440, 65280, 123904, 109568, 117504, 104448, 61952, 54784, 58752, 52224, 156480, 138240, 146880, 130560, 78240, 69120, 73440, 65280, 123904, 109568, 117504, 104448, 61952, 54784, 58752, 52224, 57600, 57600, 57600, 57600, 28800, 28800, 28800, 28800, 46080, 46080, 46080, 46080, 23040, 23040, 23040, 23040, 57600, 57600, 57600, 57600, 28800, 28800, 28800, 28800, 46080, 46080, 46080, 46080, 23040, 23040, 23040, 23040, 295232, 254208, 295232, 254208, 131392, 114432, 131392, 114432, 199296, 174592, 199296, 174592, 90368, 79872, 90368, 79872, 295232, 254208, 295232, 254208, 131392, 114432, 131392, 114432, 199296, 174592, 199296, 174592, 90368, 79872, 90368, 79872, 114816, 114816, 114816, 114816, 49920, 49920, 49920, 49920, 76032, 76032, 76032, 76032, 33792, 33792, 33792, 33792, 114816, 114816, 114816, 114816, 49920, 49920, 49920, 49920, 76032, 76032, 76032, 76032, 33792, 33792, 33792, 33792, 295232, 254208, 295232, 254208, 131392, 114432, 131392, 114432, 199296, 174592, 199296, 174592, 90368, 79872, 90368, 79872, 295232, 254208, 295232, 254208, 131392, 114432, 131392, 114432, 199296, 174592, 199296, 174592, 90368, 79872, 90368, 79872, 114816, 114816, 114816, 114816, 49920, 49920, 49920, 49920, 76032, 76032, 76032, 76032, 33792, 33792, 33792, 33792, 114816, 114816, 114816, 114816, 49920, 49920, 49920, 49920, 76032, 76032, 76032, 76032, 33792, 33792, 33792, 33792, 236160, 206336, 236160, 206336, 105600, 93184, 105600, 93184, 183552, 160768, 183552, 160768, 83456, 73728, 83456, 73728, 236160, 206336, 236160, 206336, 105600, 93184, 105600, 93184, 183552, 160768, 183552, 160768, 83456, 73728, 83456, 73728, 88320, 88320, 88320, 88320, 38400, 38400, 38400, 38400, 69120, 69120, 69120, 69120, 30720, 30720, 30720, 30720, 88320, 88320, 88320, 88320, 38400, 38400, 38400, 38400, 69120, 69120, 69120, 69120, 30720, 30720, 30720, 30720, 236160, 206336, 236160, 206336, 105600, 93184, 105600, 93184, 183552, 160768, 183552, 160768, 83456, 73728, 83456, 73728, 236160, 206336, 236160, 206336, 105600, 93184, 105600, 93184, 183552, 160768, 183552, 160768, 83456, 73728, 83456, 73728, 88320, 88320, 88320, 88320, 38400, 38400, 38400, 38400, 69120, 69120, 69120, 69120, 30720, 30720, 30720, 30720, 88320, 88320, 88320, 88320, 38400, 38400, 38400, 38400, 69120, 69120, 69120, 69120, 30720, 30720, 30720, 30720, 183840, 161280, 183840, 161280, 91920, 80640, 91920, 80640, 127872, 113664, 127872, 113664, 63936, 56832, 63936, 56832, 183840, 161280, 183840, 161280, 91920, 80640, 91920, 80640, 127872, 113664, 127872, 113664, 63936, 56832, 63936, 56832, 74880, 74880, 74880, 74880, 37440, 37440, 37440, 37440, 50688, 50688, 50688, 50688, 25344, 25344, 25344, 25344, 74880, 74880, 74880, 74880, 37440, 37440, 37440, 37440, 50688, 50688, 50688, 50688, 25344, 25344, 25344, 25344, 183840, 161280, 183840, 161280, 91920, 80640, 91920, 80640, 127872, 113664, 127872, 113664, 63936, 56832, 63936, 56832, 183840, 161280, 183840, 161280, 91920, 80640, 91920, 80640, 127872, 113664, 127872, 113664, 63936, 56832, 63936, 56832, 74880, 74880, 74880, 74880, 37440, 37440, 37440, 37440, 50688, 50688, 50688, 50688, 25344, 25344, 25344, 25344, 74880, 74880, 74880, 74880, 37440, 37440, 37440, 37440, 50688, 50688, 50688, 50688, 25344, 25344, 25344, 25344, 146880, 130560, 146880, 130560, 73440, 65280, 73440, 65280, 117504, 104448, 117504, 104448, 58752, 52224, 58752, 52224, 146880, 130560, 146880, 130560, 73440, 65280, 73440, 65280, 117504, 104448, 117504, 104448, 58752, 52224, 58752, 52224, 57600, 57600, 57600, 57600, 28800, 28800, 28800, 28800, 46080, 46080, 46080, 46080, 23040, 23040, 23040, 23040, 57600, 57600, 57600, 57600, 28800, 28800, 28800, 28800, 46080, 46080, 46080, 46080, 23040, 23040, 23040, 23040, 146880, 130560, 146880, 130560, 73440, 65280, 73440, 65280, 117504, 104448, 117504, 104448, 58752, 52224, 58752, 52224, 146880, 130560, 146880, 130560, 73440, 65280, 73440, 65280, 117504, 104448, 117504, 104448, 58752, 52224, 58752, 52224, 57600, 57600, 57600, 57600, 28800, 28800, 28800, 28800, 46080, 46080, 46080, 46080, 23040, 23040, 23040, 23040, 57600, 57600, 57600, 57600, 28800, 28800, 28800, 28800, 46080, 46080, 46080, 46080, 23040, 23040, 23040, 23040, };
uint64_t base = 0;
for(int i = 0; i < (int)Prec.size(); ++i) {
if(k >= Prec[i]) {
k -= Prec[i];
} else {
base = (uint64_t(i) << 24);
break;
}
}
for(int i = 0; i < (1 << 24); ++i) {
uint64_t mask = base | uint64_t(i);
if(check_mask(mask)) {
if(k) {
--k;
} else {
cout << __builtin_popcountl(mask) << " ";
for(int j = 0; j < VMAX; ++j) {
if(mask & (1ll << j)) cout << j + 1 << " ";
}
cout << "\n";
return;
}
}
}
}
int main() {
int te;
cin >> te;
while(te--) solve();
return 0;
}
Compilation message (stderr)
Main.cpp: In function 'void solve()':
Main.cpp:25:15: warning: unused variable 'SZPREC' [-Wunused-variable]
25 | const int SZPREC = VMAX - SZPREF;
| ^~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |