importjava.io.BufferedReader; importjava.io.InputStreamReader; importjava.io.FileReader; importjava.io.PrintWriter; importjava.io.OutputStreamWriter; importjava.io.StreamTokenizer; importjava.io.IOException; classMain{ publicstaticfinalbooleanDEBUG=false; publicStreamTokenizertokenizer; publicPrintWritercout; publicvoidinit() throwsIOException { BufferedReadercin; if (DEBUG) { cin=newBufferedReader(newFileReader("d:\\OJ\\uva_in.txt")); } else { cin=newBufferedReader(newInputStreamReader(System.in)); } tokenizer=newStreamTokenizer(cin); cout=newPrintWriter(newOutputStreamWriter(System.out)); } publicintnext() throwsIOException { tokenizer.nextToken(); if (tokenizer.ttype==StreamTokenizer.TT_NUMBER) { return (int)tokenizer.nval; } return-1; } privateintsum(intx) { returnx* (x+1) /2-1; } publicvoidsolve(intcas, intn) { int[] num=newint[110]; for (inti=2; i<=n; i++) { if (sum(i+1) >n) { inttmp=sum(i); intaverage= (n-tmp) / (i-1); intremainder= (n-tmp) % (i-1); for (intj=2; j<=i-remainder; j++) num[j] =j+average; for (intj=i-remainder+1; j<=i; j++) num[j] =j+average+1; for (intj=2; j<=i; j++) { if (j!=2) cout.print(" "); cout.print(num[j]); } cout.println(); if (cas!=0) cout.println(); cout.flush(); return; } } } publicstaticvoidmain(String[] args) throwsIOException { Mainsolver=newMain(); solver.init(); intt=solver.next(); while (t-->0) { intn=solver.next(); solver.solve(t, n); } } }