Posted: Sun Jul 13, 2003 4:57 pm
Hi (re) 
the easiest way to read the input is to use the fact than
[c]scanf("%d", &n);[/c]
will read an integer, skipping whatever white space of newline present before, so you don't have to care about it.
So :
[c]
int entry[2][MAXN];
int nscenar;
int ndigits;
int i;
/* For each scenario */
for (scanf("%d", &nscenar); nscenar > 0; nscenar--) {
scanf("%d", &ndigits);
/* For each digit */
for (i=0; i<ncase; i++)
scanf("%d %d", &entry[0], &entry[1]);
/* And then, solve
*/
/* ... */
}
[/c]
should do it.
Hope that helps

the easiest way to read the input is to use the fact than
[c]scanf("%d", &n);[/c]
will read an integer, skipping whatever white space of newline present before, so you don't have to care about it.
So :
[c]
int entry[2][MAXN];
int nscenar;
int ndigits;
int i;
/* For each scenario */
for (scanf("%d", &nscenar); nscenar > 0; nscenar--) {
scanf("%d", &ndigits);
/* For each digit */
for (i=0; i<ncase; i++)
scanf("%d %d", &entry[0], &entry[1]);
/* And then, solve

/* ... */
}
[/c]
should do it.
Hope that helps
