Vivek and factor problem

why my code is failing?

@Affan-Mokarram-202031887744398
u are getting NoSuchElementException .it means u are asking for input more times than u are giving. u ask for x then u check if its !=0 and then take another input x and find ans for x.this is wrong.
also your code is wrong like for case 102 u will get 102 not 101