#include #include FILE* fp; int numCaso; int amp[1000]; int n,m,c; int on[1000]; int max,act,x,d; int le() { numCaso++; max=0; act=0; fscanf(fp,"%d %d %d", &n, &m, &c); if ((n==0)&&(m==0)&&(c==0)) return 0; printf("Sequence %d\n",numCaso); for(x=0;xmax) max=act; } else { on[d]=0; act=act-amp[d]; } } if (max>c) {printf("Fuse was blown.\n\n");return 1;} printf("Fuse was not blown.\nMaximal power consumption was %d amperes.\n\n",max); return 1; } int main() { numCaso=0; fp = fopen("fuses.in", "r"); while (le()); fclose(fp); return 0; }