Skip to content

Instantly share code, notes, and snippets.

@rogerioagjr
Last active August 29, 2015 14:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rogerioagjr/ad17523abca122e6716c to your computer and use it in GitHub Desktop.
Save rogerioagjr/ad17523abca122e6716c to your computer and use it in GitHub Desktop.
import java.io.*;
public class solucao{
public static void main(String[] args)throws IOException{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
int n,k;
String[] aux;
n = Integer.parseInt(in.readLine());
k = 0;
while(n-- > 0){
aux = in.readLine().split(" ");
if(Integer.parseInt(aux[0]) > Integer.parseInt(aux[1]))
k += Integer.parseInt(aux[1]);
}
System.out.println(k);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment