pages:
  • 1
Bu-Ali Sina U / Moosh Koor! SAYS

in this problem there is no test case number in input ! so how can i find out where is the end of my input ?

RinoOo SAYS

You should write while(cin>> n>>m){} or while(scanf("%i%i", &n, &m) != EOF){} and write rest of your code inside the {}.

Bu-Ali Sina U / Moosh Koor! SAYS

ok got it ... thanks !