giulio98/xlcost-single-prompt huggingface dataset:
# motzkin number | return the nth motzkin number . ; base case ; finding i - th motzkin number . ; 
def motzkin(n):
    dp = [None] * (n + 1)
    dp[0] = dp[1] = 1
    i = 2
    while i <= n:
        dp[i] = ((2 * i + 1) * dp[i - 1] + (3 * i - 3) * dp[i - 2]) / (i + 2)
        i = i + 1
    return dp[n]


n = 8
print(motzkin(n))

# Expected output:
323.0
# nicomachusãƒæ ’ ã † â €™ ãƒâ € ã ¢ â ‚¬ â „¢¢ ãƒæ ’ ã † â €™¢ ãƒæ ’¢ ãƒ ¢ ã ¢ â ‚¬ å ¡¬ ãƒâ €¦¡¬ ãƒæ ’ ã † â €™¢ ãƒæ ’¢ ãƒ ¢ ã ¢ â ‚¬ å ¡¬ ãƒâ €¦¾¢ s theorem ( sum of k | return the sum of kth group of positive odd integer . ; 
def kthgroupsum(k):
    return k * k * k


k = 3
print(kthgroupsum(k))

# Expected output:
27
# find x , y , z that satisfy 2 / n = 1 / x + 1 / y + 1 / z | function to find x y and z that satisfy given equation . ; 
def printXYZ(n):
    if n == 1:
        print(-1)
    else:
        print("x is ", n)
        print("y is ", n + 1)
        print("z is ", n * (n + 1))


n = 7
printXYZ(n)

# Expected output:
x is  7
y is  8
z is  56
# find n | function to print nth term of series 1 3 6 10 ... . ; 
def term(n):
    return n * (n + 1) / 2


n = 4
print(term(n))

# Expected output:
10.0
# find harmonic mean using arithmetic mean and geometric mean | python 3 implementation of compution of arithmetic mean , geometric mean and harmonic mean ; function to calculate arithmetic mean , geometric mean and harmonic mean ; 

import math


def compute(a, b):
    AM = (a + b) / 2
    GM = math .sqrt(a * b)
    HM = (GM * GM) / AM
    return HM


a = 5
b = 15
HM = compute(a, b)
print("Harmonic Mean between ", a, " and ", b, " is ", HM)

# Expected output:
Harmonic Mean between  5  and  15  is  7.500000000000002
# find n | returns n - th element of the series ; 
def series(n):
    print((8 * n ** 2) + 1)


series(5)

# Expected output:
201
# check if a number is divisible by all prime divisors of another number | python program to find if all prime factors of y divide x . ; returns true if all prime factors of y divide x . ; 
def gcd(a, b):
    if (b == 0):
        return a
    else:
        return gcd(b, a % b)


def isDivisible(x, y):
    if (y == 1):
        return 1
    z = gcd(x, y)
    if (z == 1):
        return false
    return isDivisible(x, y / z)


x = 18
y = 12
if (isDivisible(x, y)):
    print("Yes")
else:
    print("No")

# Expected output:
Yes
# program to find sum of a series a ^ 1 / 1 ! + a ^ 2 / 2 ! + a ^ 3 / 3 ! + a ^ 4 / 4 ! + ã ¢ â ‚¬¦ ã ¢ â ‚¬¦ . + a ^ n / n ! | python program to print the sum of series . function to calculate sum of given series . ; multiply ( a / i ) to previous term ; store result in res ; 

from __future__ import division


def sumOfSeries(a, num):
    res = 0
    prev = 1
    for i in range(1, n + 1):
        prev *= (a / i)
        res = res + prev
    return res


n = 5
a = 2
print(round(sumOfSeries(a, n), 4))

# Expected output:
6.2667
# program for celsius to fahrenheit conversion | python code to convert celsius scale to fahrenheit scale ; used the formula ; 
def Cel_To_Fah(n):
    return (n * 1.8) + 32


n = 20
print(int(Cel_To_Fah(n)))

# Expected output:
68
# series with largest gcd and sum equals to n | python3 code to find the series with largest gcd and sum equals to n ; stores the maximum gcd that can be possible of sequence . ; if maximum gcd comes out to be zero then not possible ; the smallest gcd possible is 1 ; traverse the array to find out the max gcd possible ; checks if the number is divisible or not ; x = x + 1 ; checks if x is smaller then the max gcd possible and x is greater then the resultant gcd till now , then r = x ; checks if n / x is smaller than the max gcd possible and n / x is greater then the resultant gcd till now , then r = x ; x = x + 1 ; traverses and prints d , 2d , 3d , ... , ( k - 1 ) d , ; main 
def print_sequence(n, k):
    b = int(n / (k * (k + 1) / 2))
    if b == 0:
        print("-1")
    else:
        r = 1
        x = 1
        while x ** 2 <= n:
            if n % x != 0:
                continue
            elif x <= b and x > r:
                r = x
            elif n / x <= b and n / x > r:
                r = n / x
            x = x + 1
        i = 1
        while i < k:
            print(r * i, end=" ")
            i = i + 1
        last_term = n - (r * (k * (k - 1) / 2))
        print(last_term)


print_sequence(24, 4)
print_sequence(24, 5)
print_sequence(6, 4)

# Expected output:
2 4 6 12.0
1 2 3 4 14.0
-1
# number of compositions of a natural number | python code to find the total number of compositions of a natural number ; function to return the total number of composition of n ; 
def countCompositions(n):
    return (2 ** (n - 1))


print(countCompositions(4))

# Expected output:
8
# program to count digits in an integer ( 4 different methods ) | recursive python program to count number of digits in a number ; 
def countDigit(n):
    if n / 10 == 0:
        return 1
    return 1 + countDigit(n // 10)


n = 345289467
print("Number of digits : % d" % (countDigit(n)))

# Expected output:
Number of digits :  10
# tribonacci numbers | a dp based python 3 program to print first n tribonacci numbers . ; 
def printTrib(n):
    dp = [0] * n
    dp[0] = dp[1] = 0
    dp[2] = 1
    for i in range(3, n):
        dp[i] = dp[i - 1] + dp[i - 2] + dp[i - 3]
    for i in range(0, n):
        print(dp[i], " ", end="")


n = 10
printTrib(n)

# Expected output:
0  0  1  1  2  4  7  13  24  44
# tribonacci numbers | program to print first n tribonacci numbers matrix multiplication function for 3 * 3 matrix ; recursive function to raise the matrix t to the power n ; base condition . ; recursively call to square the matrix ; calculating square of the matrix t ; if n is odd multiply it one time with m ; base condition ; t [ 0 ] [ 0 ] contains the tribonacci number so return it ; 
def multiply(T, M):
    a = (T[0][0] * M[0][0] + T[0][1] * M[1][0] + T[0][2] * M[2][0])
    b = (T[0][0] * M[0][1] + T[0][1] * M[1][1] + T[0][2] * M[2][1])
    c = (T[0][0] * M[0][2] + T[0][1] * M[1][2] + T[0][2] * M[2][2])
    d = (T[1][0] * M[0][0] + T[1][1] * M[1][0] + T[1][2] * M[2][0])
    e = (T[1][0] * M[0][1] + T[1][1] * M[1][1] + T[1][2] * M[2][1])
    f = (T[1][0] * M[0][2] + T[1][1] * M[1][2] + T[1][2] * M[2][2])
    g = (T[2][0] * M[0][0] + T[2][1] * M[1][0] + T[2][2] * M[2][0])
    h = (T[2][0] * M[0][1] + T[2][1] * M[1][1] + T[2][2] * M[2][1])
    i = (T[2][0] * M[0][2] + T[2][1] * M[1][2] + T[2][2] * M[2][2])
    T[0][0] = a
    T[0][1] = b
    T[0][2] = c
    T[1][0] = d
    T[1][1] = e
    T[1][2] = f
    T[2][0] = g
    T[2][1] = h
    T[2][2] = i


def power(T, n):
    if (n == 0 or n == 1):
        return
    M = [[1, 1, 1], [1, 0, 0], [0, 1, 0]]
    power(T, n // 2)
    multiply(T, T)
    if (n % 2):
        multiply(T, M)


def tribonacci(n):
    T = [[1, 1, 1], [1, 0, 0], [0, 1, 0]]
    if (n == 0 or n == 1):
        return 0
    else:
        power(T, n - 2)
    return T[0][0]


if __name__ == "__main__":
    n = 10
    for i in range(n):
        print(tribonacci(i), end=" ")
    print()

# Expected output:
0 0 1 1 2 4 7 13 24 44
# geometric mean ( two methods ) | program to calculate the geometric mean of the given array elements . ; function to calculate geometric mean and return float value . ; declare sum variable and initialize it to 1. ; compute the sum of all the elements in the array . ; compute geometric mean through formula antilog ( ( ( log ( 1 ) + log ( 2 ) + . . ... + log ( n ) ) / n ) and return the value to main function . ; 

import math


def geometricMean(arr, n):
    sum = 0
    for i in range(n):
        sum = sum + math .log(arr[i])
    sum = sum / n
    return math .exp(sum)


arr = [1, 2, 3, 4, 5, 6, 7, 8]
n = len(arr)
print(geometricMean(arr, n))

# Expected output:
3.764350599503129
# smallest number k such that the product of digits of k is equal to n | python3 implementation to find smallest number k such that the product of digits of k is equal to n ; function to find smallest number k such that the product of digits of k is equal to n ; if ' n ' is a single digit number , then it is the required number ; stack the store the digits ; repeatedly divide ' n ' by the numbers from 9 to 2 until all the numbers are used or ' n ' > 1 ; save the digit ' i ' that divides ' n ' onto the stack ; if true , then no number ' k ' can be formed ; pop digits from the stack ' digits ' and add them to 'k ; required smallest number ; 

import math as mt


def smallestNumber(n):
    if (n >= 0 and n <= 9):
        return n
    digits = list()
    for i in range(9, 1, -1):

        while (n % i == 0):
            digits.append(i)
            n = n // i
    if (n != 1):
        return -1
    k = 0
    while (len(digits) != 0):

        k = k * 10 + digits[-1]
        digits.pop()
    return k


n = 100
print(smallestNumber(n))

# Expected output:
455
# check if a number is magic ( recursive sum of digits is 1 ) | python3 program to check if a number is magic number . ; note that the loop continues if n is 0 and sum is non - zero . it stops when n becomes 0 and sum becomes single digit . ; return true if sum becomes 1. ; 
def isMagic(n):
    sum = 0
    while (n > 0 or sum > 9):
        if (n == 0):
            n = sum
            sum = 0
        sum = sum + n % 10
        n = int(n / 10)
    return True if (sum == 1)else False


n = 1234
if (isMagic(n)):
    print("Magic Number")
else:
    print("Not a magic Number")

# Expected output:
Magic Number
# rearrangement of a number which is also divisible by it | perform hashing for given n ; perform hashing ; check whether any arrangement exists ; create a hash for given number n the hash is of size 10 and stores count of each digit in n . ; check for all possible multipliers ; check hash table for both . ; 
def storeDigitCounts(n, Hash):
    while n > 0:
        Hash[n % 10] += 1
        n //= 10


def rearrange(n):
    hash_n = [0] * 10
    storeDigitCounts(n, hash_n)
    for mult in range(2, 10):
        curr = n * mult
        hash_curr = [0] * 10
        storeDigitCounts(curr, hash_curr)
        if hash_n == hash_curr:
            return curr
    return -1


if __name__ == "__main__":
    n = 10035
    print(rearrange(n))

# Expected output:
30105
# sylvester 's sequence | python code for sylvester sequence ; to store the product . ; to store the current number . ; loop till n . ; 
def printSequence(n):
    a = 1
    ans = 2
    N = 1000000007
    i = 1
    while i <= n:
        print(ans,)
        ans = ((a % N) * (ans % N)) % N
        a = ans
        ans = (ans + 1) % N
        i = i + 1


n = 6
printSequence(n)

# Expected output:
2
3
7
43
1807
3263443
# program to find sum of first n natural numbers | returns sum of first n natural numbers ; 
def findSum(n):
    sum = 0
    x = 1
    while x <= n:
        sum = sum + x
        x = x + 1
    return sum


n = 5
print(findSum(n))

# Expected output:
15
# hailstone numbers | function to print hailstone numbers and to calculate the number of steps required ; n is initially 1. ; n is reduced to 1. ; if n is even . ; n is odd . ; 
def HailstoneNumbers(N, c):
    print(N, end=" ")
    if (N == 1 and c == 0):
        return c
    elif (N == 1 and c != 0):
        c = c + 1
    elif (N % 2 == 0):
        c = c + 1
        c = HailstoneNumbers(int(N / 2), c)
    elif (N % 2 != 0):
        c = c + 1
        c = HailstoneNumbers(3 * N + 1, c)
    return c


N = 7
x = HailstoneNumbers(N, 0)
print("NumberofSteps:", x)

# Expected output:
7 22 11 34 17 52 26 13 40 20 10 5 16 8 4 2 1 NumberofSteps: 17
# count number of digits after decimal on dividing a number | python3 program to count digits after dot when a number is divided by another . ; ans = 0 initialize result ; calculating remainder ; if this remainder appeared before then the numbers are irrational and would not converge to a solution the digits after decimal will be infinite ; 
def count(x, y):
    ans = 0
    m = dict()
    while x % y != 0:
        x %= y
        ans += 1
        if x in m:
            return -1
        m[x] = 1
        x *= 10
    return ans


if __name__ == "__main__":
    res = count(1, 2)
    print("INF")if res == -1 else print(res)
    res = count(5, 3)
    print("INF")if res == -1 else print(res)
    res = count(3, 5)
    print("INF")if res == -1 else print(res)

# Expected output:
1
INF
1
# find smallest number n such that n xor n + 1 equals to given k . | function to return the required n ; if k is of form 2 ^ i - 1 ; 
def xorCalc(k):
    if (k == 1):
        return 2
    if (((k + 1) & k) == 0):
        return k / 2
    return 1


k = 31
print(int(xorCalc(k)))

# Expected output:
15
# find n | python3 program to find n - th number containing only 4 and 7. ; if n is odd , append 4 and move to parent ; if n is even , append7 and move to parent ; reverse res and return . ; 
def reverse(s):
    if len(s) == 0:
        return s
    else:
        return reverse(s[1:]) + s[0]


def findNthNo(n):
    res = ""
    while (n >= 1):
        if (n & 1):
            res = res + "4"
            n = (int)((n - 1) / 2)
        else:
            res = res + "7"
            n = (int)((n - 2) / 2)
    return reverse(res)


n = 13
print(findNthNo(n))

# Expected output:
774
# total number of divisors for a given number | program for finding no . of divisors ; sieve method for prime calculation ; traversing through all prime numbers ; calculate number of divisor with formula total div = ( p1 + 1 ) * ( p2 + 1 ) * ... . . * ( pn + 1 ) where n = ( a1 ^ p1 ) * ( a2 ^ p2 ) . ... * ( an ^ pn ) ai being prime divisor for n and pi are their respective power in factorization ; 
def divCount(n):
    hh = [1] * (n + 1)
    p = 2
    while ((p * p) < n):
        if (hh[p] == 1):
            for i in range((p * 2), n, p):
                hh[i] = 0
        p += 1
    total = 1
    for p in range(2, n + 1):
        if (hh[p] == 1):
            count = 0
            if (n % p == 0):
                while (n % p == 0):
                    n = int(n / p)
                    count += 1
                total *= (count + 1)
    return total


n = 24
print(divCount(n))

# Expected output:
8
# maximum number of unique prime factors | return smallest number having maximum prime factors . ; sieve of eratosthenes method to count number of unique prime factors . ; return maximum element in arr [ ] ; 
def maxPrimefactorNum(N):
    arr = [0] * (N + 1)
    i = 2
    while (i * i <= N):
        if (arr[i] > 0):
            for j in range(2 * i, N + 1, i):
                arr[j] += 1
        i += 1
        arr[i] = 1
    return max(arr)


N = 40
print(maxPrimefactorNum(N))

# Expected output:
3
# difference between two given times | remove ' : ' and convert it into an integer ; main function which finds difference ; change string ( eg . 2 : 21 -- > 221 , 00 : 23 -- > 23 ) ; difference between hours ; difference between minutes ; convert answer again in string with ' : ' ; 
def removeColon(s):
    if (len(s) == 4):
        s = s[:1] + s[2:]
    if (len(s) == 5):
        s = s[:2] + s[3:]
    return int(s)


def diff(s1, s2):
    time1 = removeColon(s1)
    time2 = removeColon(s2)
    hourDiff = time2 // 100 - time1 // 100 - 1
    minDiff = time2 % 100 + (60 - time1 % 100)
    if (minDiff >= 60):
        hourDiff += 1
        minDiff = minDiff - 60
    res = str(hourDiff) + ':' + str(minDiff)
    return res


s1 = "14:00"
s2 = "16:45"
print(diff(s1, s2))

# Expected output:
2:45
# sum of array elements that is first continuously increasing then decreasing | efficient python method to find sum of the elements of array that is halfway increasing and then halfway decreassing ; 
def arraySum(arr, n):
    x = (n + 1) / 2
    return (arr[0] - 1) * n + x * x


arr = [10, 11, 12, 13, 12, 11, 10]
n = len(arr)
print(arraySum(arr, n))

# Expected output:
79.0
# number of digits in the product of two numbers | python 3 implementation to count number of digits in the product of two numbers ; function to count number of digits in the product of two numbers ; if either of the number is 0 , then product will be 0 ; required count of digits ; 

import math


def countDigits(a, b):
    if (a == 0 or b == 0):
        return 1
    return math .floor(math .log10(abs(a)) + math .log10(abs(b))) + 1


a = 33
b = -24
print(countDigits(a, b))

# Expected output:
3
# distributing m items in a circle of size n starting from k | n == > size of circle m == > number of items k == > initial position ; n - k + 1 is number of positions before we reach beginning of circle if m is less than this value , then we can simply return ( m - 1 ) th position ; let us compute remaining items before we reach beginning . ; we compute m % n to skip all complete rounds . if we reach end , we return n else we return m % n ; 
def lastPosition(n, m, k):
    if (m <= n - k + 1):
        return m + k - 1
    m = m - (n - k + 1)
    if (m % n == 0):
        return n
    else:
        return m % n


n = 5
m = 8
k = 2
print(lastPosition(n, m, k))

# Expected output:
4
# an interesting solution to get all prime numbers smaller than n | python3 program to prints prime numbers smaller than n ; compute factorials and apply wilson 's  theorem. ; 
def primesInRange(n):
    fact = 1
    for k in range(2, n):
        fact = fact * (k - 1)
        if ((fact + 1) % k == 0):
            print(k)


n = 15
primesInRange(n)

# Expected output:
2
3
5
7
11
13
# a product array puzzle | set 2 ( o ( 1 ) space ) | python program for product array puzzle with o ( n ) time and o ( 1 ) space . ; epsilon value to maintain precision ; to hold sum of all values ; output product for each index antilog to find original product value ; 

import math
EPS = 1e-9


def productPuzzle(a, n):
    sum = 0
    for i in range(n):
        sum += math .log10(a[i])
    for i in range(n):
        print(int((EPS + pow(10.00, sum - math .log10(a[i])))),)
    return


a = [10, 3, 5, 6, 2]
n = len(a)
print("The product array is: ")
productPuzzle(a, n)

# Expected output:
The product array is: 
180
600
360
300
900
# change all even bits in a number to 0 | returns modified number with all even bits 0. ; to store sum of bits at even positions . ; to store bits to shift ; one by one put all even bits to end ; if current last bit is set , add it to ans ; next shift position ; 
def changeEvenBits(n):
    to_subtract = 0
    m = 0
    x = n
    while (x):
        if (x & 1):
            to_subtract += (1 << m)
        m += 2
        x >>= 2
    return n - to_subtract


n = 30
print(changeEvenBits(n))

# Expected output:
10
# find the number closest to n and divisible by m | function to find the number closest to n and divisible by m ; find the quotient ; 1 st possible closest number ; 2 nd possible closest number ; if true , then n1 is the required closest number ; else n2 is the required closest number ; 
def closestNumber(n, m):
    q = int(n / m)
    n1 = m * q
    if ((n * m) > 0):
        n2 = (m * (q + 1))
    else:
        n2 = (m * (q - 1))
    if (abs(n - n1) < abs(n - n2)):
        return n1
    return n2


n = 13
m = 4
print(closestNumber(n, m))
n = -15
m = 6
print(closestNumber(n, m))
n = 0
m = 8
print(closestNumber(n, m))
n = 18
m = -7
print(closestNumber(n, m))

# Expected output:
12
-18
0
21
# check if a 

import math


def checkPronic(x):
    i = 0
    while (i <= (int)(math .sqrt(x))):
        if (x == i * (i + 1)):
            return True
        i = i + 1
    return False


i = 0
while (i <= 200):
    if checkPronic(i):
        print(i,)
    i = i + 1

# Expected output:
0
2
6
12
20
30
42
56
72
90
110
132
156
182
# find minimum sum of factors of number | to find minimum sum of product of number ; find factors of number and add to the sum ; return sum of numbers having minimum product ; 
def findMinSum(num):
    sum = 0
    i = 2
    while (i * i <= num):
        while (num % i == 0):
            sum += i
            num /= i
        i += 1
    sum += num
    return sum


num = 12
print(findMinSum(num))

# Expected output:
7.0
# minimum number with digits as 4 and 7 only and given sum | prints minimum number with given digit sum and only allowed digits as 4 and 7. ; cases where all remaining digits are 4 or 7 ( remaining sum of digits should be multiple of 4 or 7 ) ; if both 4 s and 7 s are there in digit sum , we subtract a 4. ; 
def findMin(s):
    a, b = 0, 0
    while (s > 0):
        if (s % 7 == 0):
            b += 1
            s -= 7
        elif (s % 4 == 0):
            a += 1
            s -= 4
        else:
            a += 1
            s -= 4
    string = ""
    if (s < 0):
        string = "-1"
        return string
    string += "4" * a
    string += "7" * b
    return string


print(findMin(15))

# Expected output:
447
# add minimum number to an array so that the sum becomes even | function to find out minimum number ; count odd number of terms in array ; 
def minNum(arr, n):
    odd = 0
    for i in range(n):
        if (arr[i] % 2):
            odd += 1
    if (odd % 2):
        return 1
    return 2


arr = [1, 2, 3, 4, 5, 6, 7, 8, 9]
n = len(arr)
print(minNum(arr, n))

# Expected output:
1
# find maximum number that can be formed using digits of a given number | function to print maximum number ; hashed array to store count of digits ; converting given number to string ; updating the count array ; result stores final number ; traversing the count array to calculate the maximum number ; return the result ; 
def printMaximum(inum):
    count = [0 for x in range(10)]
    string = str(num)
    for i in range(len(string)):
        count[int(string[i])] = count[int(string[i])] + 1
    result = 0
    multiplier = 1
    for i in range(10):
        while count[i] > 0:
            result = result + (i * multiplier)
            count[i] = count[i] - 1
            multiplier = multiplier * 10
    return result


num = 38293367
print(printMaximum(num))

# Expected output:
98763332
# binomial random variables | function to calculate ncr i . e . , number of ways to choose r out of n objects ; since ncr is same as nc ( n - r ) to decrease number of iterations ; function to calculate binomial r . v . probability ; 
def nCr(n, r):
    if (r > n / 2):
        r = n - r
    answer = 1
    for i in range(1, r + 1):
        answer *= (n - r + i)
        answer /= i
    return answer


def binomialProbability(n, k, p):
    return (nCr(n, k) * pow(p, k) * pow(1 - p, n - k))


n = 10
k = 5
p = 1.0 / 3
probability = binomialProbability(n, k, p)
print("Probability of", k, "heads when a coin is tossed", end=" ")
print(n, "times where probability of each head is", round(p, 6))
print("is = ", round(probability, 6))

# Expected output:
Probability of 5 heads when a coin is tossed 10 times where probability of each head is 0.333333
is =  0.136565
# Find pair with maximum GCD in an array | function to find GCD of pair with max GCD in the array ; Calculating MAX in array ; Maintaining count array ; Variable to store the multiples of a number ; Iterating from MAX to 1 GCD is always between MAX and 1 The first GCD found will be the highest as we are decrementing the potential GCD ; Iterating from current potential GCD till it is less than MAX ; A multiple found ; Incrementing potential GCD by itself To check i , 2 i , 3 i ... . ; 2 multiples found , max GCD found ; Array in which pair with max GCD is to be found ; Size of array
def findMaxGCD(arr, n):
    high = 0
    for i in range(0, n):
        high = max(high, arr[i])
    count = [0] * (high + 1)
    for i in range(0, n):
        count[arr[i]] += 1
    counter = 0
    for i in range(high, 0, -1):
        j = i
        while (j <= high):
            if (count[j] > 0):
                counter += count[j]
            j += i
            if (counter == 2):
                return i
        counter = 0


arr = [1, 2, 4, 8, 8, 12]
n = len(arr)
print(findMaxGCD(arr, n))

# Expected output:
8