INDIVISIBLE Codechef solutions Today | Codechef Starters 72 ✅ (100/100) FULL | AC Code ✅| Indivisible

 

Problem

Alice thinks Bob has very weak math skills.
Alice gave Bob three numbers A, B, and C and challenged him to find any positive integer K strictly less than 100 such that none of the three numbers are divisible by K.

Help Bob find one such integer K.

Under the given constraints, a valid K will always exist.

Input Format

  • The first line of input will contain a single integer T, denoting the number of test cases.
  • The first and only line of each test case contains three space-separated integers A, B, and C.

Output Format

For each test case, output on a new line any positive integer K less than 100 that does not divide any of A, B, or C.

Constraints

  • 1 \leq T \leq 1000
  • 2 \leq A , B , C \leq 100

Sample 1:

Input
Output
3
2 3 4
5 7 10
3 6 9
5
4
10

Explanation:

Test case 1: None of 2, 3, or 4 are divisible by 5.

Test case 2: None of 5, 7, or 10 are divisible by 4.

Test case 3: None of 3, 6, or 9 are divisible by 10.

Next Post Previous Post
No Comment
Add Comment
comment url