Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.*;
- public class Practicer {
- public static void main(String[] args) {
- Scanner cin = new Scanner(System.in);
- while(cin.hasNext()){
- int a = cin.nextInt();
- int b = cin.nextInt();
- if( (a%2!=0) && (b%2!=0) )
- {
- System.out.println((b-a)/2);
- }
- else{
- System.out.println((b-a)/2+1);
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement