T-Prime code Number theory

My code is giving wrong answer for 2 test-cases.
Please review it once and help me get it correct.
ide : https://ide.codingblocks.com/s/193013

hey @aman_ishan you arent dealing with long variables correctly

  1. when taking in input of array elements use nextLong not nextInt
  2. when adding elements into chk dont do i*i instead assign i to long temp and add temp * temp
    Here is your code after rectifications:
    https://ide.codingblocks.com/s/193051

Thank you so much sir.