Created
April 17, 2015 13:50
-
-
Save TPAKC/7e483c0106ad0ba3558f 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.util.*; | |
import java.io.IOException; | |
public class vidrizki { | |
public static void main (String[] args) throws IOException | |
{ | |
Scanner in = new Scanner(System.in); | |
int a = in.nextInt(); | |
HashSet<Long> array = new HashSet<Long>(); | |
for (int i = 0; i <a; i++) { | |
long b = in.nextLong(); | |
long c = in.nextLong(); | |
for (long j = b,p=1; j <=c; j+=p) { | |
if(j%5==0) | |
{ | |
System.out.println(j); | |
array.add(j); | |
p=5; | |
} | |
} | |
} | |
System.out.println(array.size()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment