'''
Author     : knight_byte
File       : EXTRA.py
Created on : 2021-04-19 15:10:03
'''

import math


# ----Check PRIME NO. ------
def prime(n):
    if n <= 1:
        return False
    max_div = math.floor(math.sqrt(n))
    for i in range(2, 1 + max_div):
        if n % i == 0:
            return False
    return True


# ------ Find GCD --------
def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


# ------find LCM-------
def lcm(a, b):
    return (a / gcd(a, b)) * b


# ---- check PERFECT SQUARE -------
def psq(a):
    if a >= 0:
        sq = int(math.sqrt(a))
        return sq*sq == a
    else:
        return False

81d472844721978bc49875e0a80b30b5fe334011
<mask token>


def lcm(a, b):
    return a / gcd(a, b) * b


def psq(a):
    if a >= 0:
        sq = int(math.sqrt(a))
        return sq * sq == a
    else:
        return False

<mask token>


def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


def lcm(a, b):
    return a / gcd(a, b) * b


def psq(a):
    if a >= 0:
        sq = int(math.sqrt(a))
        return sq * sq == a
    else:
        return False

<mask token>


def prime(n):
    if n <= 1:
        return False
    max_div = math.floor(math.sqrt(n))
    for i in range(2, 1 + max_div):
        if n % i == 0:
            return False
    return True


def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


def lcm(a, b):
    return a / gcd(a, b) * b


def psq(a):
    if a >= 0:
        sq = int(math.sqrt(a))
        return sq * sq == a
    else:
        return False

<mask token>
import math


def prime(n):
    if n <= 1:
        return False
    max_div = math.floor(math.sqrt(n))
    for i in range(2, 1 + max_div):
        if n % i == 0:
            return False
    return True


def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


def lcm(a, b):
    return a / gcd(a, b) * b


def psq(a):
    if a >= 0:
        sq = int(math.sqrt(a))
        return sq * sq == a
    else:
        return False

'''
Author     : knight_byte
File       : EXTRA.py
Created on : 2021-04-19 15:10:03
'''

import math


# ----Check PRIME NO. ------
def prime(n):
    if n <= 1:
        return False
    max_div = math.floor(math.sqrt(n))
    for i in range(2, 1 + max_div):
        if n % i == 0:
            return False
    return True


# ------ Find GCD --------
def gcd(a, b):
    if a == 0:
        return b
    return gcd(b % a, a)


# ------find LCM-------
def lcm(a, b):
    return (a / gcd(a, b)) * b


# ---- check PERFECT SQUARE -------
def psq(a):
    if a >= 0:
        sq = int(math.sqrt(a))
        return sq*sq == a
    else:
        return False
