/* University of Ulm Programming Contest 1996 Problem B: The Tower of Babylon Implementation: Mark Dettinger Alternative Solution */ #include #define oo 1000000000 #define max(a,b) ((a)>(b)?(a):(b)) int x[1000],y[1000],z[1000],d[1000][1000]; main() { FILE* input = fopen("babylon.in","r"); int a,b,c,i,j,k,n,numblocks,top,bottom,kase=0; while (1) { /* 1. Read input */ fscanf(input,"%d",&numblocks); if (numblocks==0) break; n = 0; for (i=0; i