Created
March 27, 2015 01:16
-
-
Save luccasiau/77bda91e3ab3376c10e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.io.*; | |
public class solucao{ | |
public static void main(String[] args)throws IOException{ | |
BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); | |
BufferedWriter out = new BufferedWriter(new OutputStreamWriter(System.out)); | |
int i,qtd,n,c,x; | |
String[] aux; | |
while(true){ | |
n = Integer.parseInt(in.readLine()); | |
if(n == 0)break; | |
qtd = 0; | |
for(i = 0; i < n; i++){ | |
aux = in.readLine().split(" "); | |
c = Integer.parseInt(aux[0]); | |
x = Integer.parseInt(aux[1]); | |
c = (int) Math.floor(x/2); | |
qtd += c; | |
} | |
qtd /= 2; | |
out.write(qtd+"\n"); | |
} | |
out.flush(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment