C. Koxia and Number Theory Codeforces Good Bye 2022: 2023 is NEAR Problem Solution                         

This post is all about the solution of the C. Koxia and Number Theory Codeforces Good Bye 2022: 2023 is NEAR Problem Statement.

C. Koxia and Number Theory Codeforces Good Bye 2022: 2023 is NEAR Problem Solution

Codeforces



AI based Love Calculator



Problem Statement :

Joi's array a contains n positive integers. Koxia wants you to figure out whether there is a positive number x>0 for which gcd(ai+x,aj+x)=1 for all 1ijn.

The largest common divisor (GCD) of integers y and z is denoted by gcd(y,z).


Format of Input :

Evey test is made up of several test cases. The first line contains a single integer t (1t100), which represents the number of tests. The following is a description of the test cases.
The first line of each test case contains the integer n (2n100) — the array size.
Evey test case's second line contains n integers a1,a2,...,an (1ai1018).
The sum of n over all test cases is assured not to exceed 1000.

Format of the Output :

For every test case, output "YES" (without quotation marks) if a positive integer x exists such that gcd(ai+x,aj+x)=1 for all 1ijn, and "NO" (without quotation marks) otherwise.

In any case, you can output the answer (upper or lower). Positive responses will be recognised by the strings "yEs", "yes", "Yes", and "YES".

Also Check this out:-

A. Koxia and Whiteboards Codeforces Good Bye 2022: 2023 is NEAR Problem Solution, Click Here
B. Koxia and Permutation Codeforces Good Bye 2022: 2023 is NEAR Problem Solution, Click Here
C. Koxia and Number Theory Codeforces Good Bye 2022: 2023 is NEAR Problem Solution, Click Here
D. Koxia and Game Codeforces Good Bye 2022: 2023 is NEAR Problem Solution, Click Here 
E. Koxia and Tree Codeforces Good Bye 2022: 2023 is NEAR Problem Solution, Click Here
Solution of the Problem: Click Here