Help me in solving INDIVISIBLE problem

My issue

under the given constraints, I wrote up a code, and its valid and gives a logically correct answer but it doesn’t submit. why ? clarify me pls ASAP.

My code

import java.util.*;
import java.lang.*;
import java.io.*;

class Codechef
{
	public static void main (String[] args) throws java.lang.Exception
	{
		// your code goes here
		Scanner sc = new Scanner(System.in);
		int t = sc.nextInt();
		while(t-->0){
		    int a = sc.nextInt();
		    int b = sc.nextInt();
		    int c = sc.nextInt();
		    for(int i =2;i<=10;i++){
		        if(a%i!=0&&b%i!=0&&c%i!=0){
		            System.out.println(i);
		            break;
		        }
		    }
		}

	}
}

Problem Link: Indivisible Practice Coding Problem - CodeChef

for(int i=2;i<=100;i++)
you gave i<=10

1 Like

aah yeah yeah i got it now thanks.