Correct code is giving exception in hacker block ide in local ide its working fine

import java.util.*;
public class Main {
    public static void main(String args[]) {
      
      
      Scanner sc = new Scanner(System.in);
      
      int input = sc.nextInt();
      
      for(int i = 0 ; i < input ; i++){
        int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
        for(int j = a ; j <= b ; j++){
          for(int k = j; k > 0 ; k = (k >> 1)){
            ans = ans + (k & 1);
          }
        }
        System.out.print(ans+" ");
      }
    }
}

Above code is working fine in local ide but the same when I am trying to execute in coding block ide it is failing with exception.

Exception in thread "main" java.util.InputMismatchException at java.util.Scanner.throwFor(Scanner.java:864) at java.util.Scanner.next(Scanner.java:1485) at java.util.Scanner.nextInt(Scanner.java:2117) at java.util.Scanner.nextInt(Scanner.java:2076) at Main.main(Main.java:11)

Please suggest me on the same .

Your code works on the IDE: https://ide.codingblocks.com/#/s/12112
Make sure you are providing correct input.