title: Following code is giving runtime error in ideone but runs fine in eclipse and bash terminal
body: <p>I am running a code to compute some <code>BigInteger</code> values in a String <code>ArrayList</code>. Computation is done outside the <code>ArrayList</code> and then added back to the list as a string.</p>
  
  <p>The code runs fine through Ubuntu terminal and in Eclipse IDE, but gives a runtime error in <a href="https://www.ideone.com/8ZZvyR" rel="nofollow noreferrer">Ideone</a> and other online IDEs.</p>
  
  <pre><code>public static void main (String[] args) throws IOException
      {
          BufferedReader kb = new BufferedReader(new InputStreamReader(System.in));
          int T = Integer.parseInt(kb.readLine());
          for(int i = 0; i&lt;T; i++){
              int N = Integer.parseInt(kb.readLine());
              ArrayList&lt;String&gt; L = new ArrayList();
              //int[] L = new int[N];
              for(int j = 0; j&lt;N; j++){
                  L.add(Integer.toString(j+1));
              }
              while(L.size()&gt;1){
                  BigInteger x = new BigInteger(L.get(0).substring(0));
                  BigInteger y = new BigInteger(L.get(L.size()-1).substring(0));
                  L.remove(0);
                  L.remove(L.size()-1);
                  BigInteger fin = new BigInteger("0");
                  fin = fin.add(x);
                  fin = fin.add(y);
                  fin = fin.add(x.multiply(y));
                  String finstring = fin.toString();
                  L.add(finstring);
              }
              int r = 0;
              for(int j = 0; j&lt;L.get(0).length(); j++) {
                  r = (r * 10 + (int)L.get(0).charAt(j) - '0') % 100000007; 
              }
              System.out.println(r);
          }
      }
  </code></pre>