void TestDistcalcPerf :: tests (void) { // run all tests testn(10e3); testn(100e3); testn(500e3); //testn(1e6); // temporarily disabled //testn(5e6); }
int main(void){ for(int i = 1234; i < 100000; ++i){ usable[i] = test(i); if(usable[i]) ulist[uls++] = i; } for(scanf("%d", &n); n; ){ int f = 0, mask, x; for(int i = 0; i < uls; ++i){ mask = 0; if(ulist[i] % n) continue; x = ulist[i] / n; if(usable[x]){ testn(ulist[i], mask); testn(x, mask); if(mask == -1) continue; f++; printf("%05d / %05d = %d\n", ulist[i], x, n); } } if(!f) printf("There are no solutions for %d.\n", n); if(scanf("%d", &n) && n) putc(10, stdout); } return 0; }