def circle_area(r):
    circle_area = r * r * 3.14
    return circle_area

Return the area of a circle.


def square_area(n):
    square_area = n * n
    return square_area

assert square_area(0)==0 and square_area(21138)==446815044

Return the area of a square.


def square_perimeter(n):
    sqaure_perimeter = n * 4
    return square_perimeter

assert square_perimeter(0)==0 and square_perimeter(-12684)==-50736

Returns the perimeter of a square.


def rectangle_perimeter(r, n):
    rectangle_perimeter = (2)(r + n)
    return rectangle_perimeter

Return the perimeter of a rectangle with the given coordinates.


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def sort(a):
    i = 0
    j = i + 1
    while i < len(a):
        find_position_of_smallest(a, i)
        swap(a, i, j)
        j = j + 1
        i = i + 1

assert sort([0])==None and sort([0])==None and sort([])==None and sort([])==None and sort([' '])==None and sort([' '])==None and sort([70, 339305549])==None and sort([70, 339305549])==None

Sort a list by repeatedly moving the minimimum of the remaining sublist to the front.


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def sort(a):
    i = 0
    j = i + 1
    while i < len(a):
        find_position_of_smallest(a, i)
        swap(a, i, j)
    i = i + 1
    j = i


Return the area of a circle.


Return the area of a square.


def circle_circumference(r):
    circle_circumference = 2 * 3.14 * r
    return circle_circumference

assert circle_circumference(0)==0.0 and circle_circumference(25619)==160887.32

Return the circumference of a circle.


def square_perimeter(n):
    sqaure_perimeter = (4)(n)
    return square_perimeter

Returns the perimeter of a square.


def square_perimeter(n):
    square_perimeter = n * 4
    return square_perimeter

Returns the perimeter of a square.


Return the circumference of a circle.


def rectangle_perimeter(r, n):
    rectancle_perimeter = (2)(r + n)
    return rectangle_perimeter


def swap(a, i, j):
    temp = a[i]
    a[i] = a[j]
    a[j] = temp

def find_position_of_smallest(a, i):
    p = i
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
    return p

def sort(a):
    while i < len(a):
        find_position_of_smallest(a, i).swap(a)
    swap(a, i, j).sort(a)


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def sort(a):
    i = 0
    j = i + 1
    while i < len(a):
        find_position_of_smallest(a, i)
        swap(a, i, j)
    j = j + 1
    i = i + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def sort(a):
    i = 0
    j = i + 1
    while i < len(a):
        find_position_of_smallest(a, i)
        swap(a, i, j)
    i = i + 1
    j = j + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    tmp = i
    while i < len(a):
        if a[i] < a[tmp]:
            tmp = i
        i = i + 1
    return tmp

def sort(a):
    j = 0
    while j < len(a):
        p = find_position_of_smallest(a, j)
        swap(a, j, p)
        j = j + 1


def sort(a):
    while i < len(a):
        find_position_of_smallest.sort(a)
        swap.sort(a)
    i = i + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def sort(a):
    i = 0
    j = i + 1
    while j < len(a):
        find_position_of_smallest(a, i)
        swap(a, i, j)
    i = i + 1
    j = j + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    i = i + 1
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
    return p

def sort(a):
    i = 0
    while i < len(a):
        p = find_position_of_smallest(a, i)
        swap(a, i, p)
        i = i + 1


def sort(a):
    i = 0
    while i < len(a):
        find_position_of_smallest.sort(a)
        swap.sort(a)
    i = i + 1


def swap(a, i, j):
    temp = a[i]
    a[i] = a[j]
    a[j] = temp

def find_position_of_smallest(a, i):
    p = i
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
    return p

def sort(a):
    while i < len(a):
        if find_position_of_smallest(a, i).swap(a):
            swap(a, i, j).sort(a)
    i = i + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def sort(a):
    i = 0
    while i < len(a):
        p = find_position_of_smallest(a, i)
        swap(a, i, j)
    i = i + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def sort(a):
    i = 0
    while i < len(a):
        p = find_position_of_smallest(a, i)
        swap(a, i, p)
    i = i + 1


def circle_area(r):
    circle_area = r * r * 3.14
    return circle_area

Return the area of a circle.


def square_perimeter(n):
    square_perimeter = 4 * n
    return square_perimeter

Returns the perimeter of a square.


def circle_circumference(r):
    circle_circumference = 2 * 3.14 * r
    return circle_circumference

Return the circumference of a circle.


Return the area of a circle.


def square_area(n):
    square_area = n * n
    return square_area

Return the area of a square.


Returns the perimeter of a square.


def rectangle_perimeter(r, n):
    rectangle_perimeter = 2 * (r + n)
    return rectangle_perimeter


Return the area of a square.


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def sort(a):
    i = 0
    while i < len(a):
        p = find_position_of_smallest(a, i)
        swap(a, p, i)
    i = i + 1


Return the circumference of a circle.


def rectangle_perimeter(r, n):
    rectancle_perimeter = 2 * (r + n)
    return rectangle_perimeter


def square_perimeter(n):
    square_perimeter = n * 4
    return square_perimeter

Returns the perimeter of a square.


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def sort(a):
    i = 0
    while i < len(a):
        p = find_position_of_smallest(a, i)
        swap(a, p, i)
        i = i + 1


def square_perimeter(n):
    result = n + n + n + n
    return result

Returns the perimeter of a square.


def circle_area(n):
    result = 3.14 * (n * n)
    return result

Return the area of a circle.


def square_area(n):
    result = n * n
    return result

Return the area of a square.


def rectangle_perimeter(n, m):
    result = n + n + m + m
    return result


def circle_circumference(n):
    result = 2 * 3.14 * n
    return result

Return the circumference of a circle.


def sort(a):
    b = a
    b = 0
    j = 1
    while j < len(a):
        if a[j] < a[b]:
            p = j
        j = j + 1
    return b


def sort(a):
    b = 0
    j = 1
    while j < len(a):
        if a[j] < a[b]:
            p = j
        j = j + 1
    return b


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
    return p

def sort(a):
    j = 0
    while j < len(a):
        p = find_position_of_smallest(a, i)
        swap(a, i, j)
    j = j + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
    return p

def sort(a):
    j = 0
    while j < len(a):
        p = find_position_of_smallest(a, j)
        swap(a, j, p)
    j = j + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
    return p

def sort(a):
    j = 0
    while j < len(a):
        p = find_position_of_smallest(a, j)
        swap(a, j, p)
        j = j + 1


def swap(a, i, j):
    temp = a[i]
    a[i] = a[j]
    a[j] = temp

def find_position_of_smallest(a, i):
    p = i
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
    return p

def sort(a):
    j = 0
    while i < len(a):
        find_position_of_smallest(a, i)
        swap(a, i, j)
    j = j + 1


def swap(a, i, j):
    temp = a[i]
    a[i] = a[j]
    a[j] = temp

def find_position_of_smallest(a, i):
    p = i
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
    return p

def sort(a):
    j = 0
    while j < len(a):
        find_position_of_smallest(a, i)
        swap(a, i, j)
    j = j + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
    return p

def sort(a):
    l = 0
    while l < len(a):
        p = find_position_of_smallest(a, l)
        swap(a, l, p)
    i = i + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
    return p

def sort(a):
    l = 0
    while l < len(a):
        p = find_position_of_smallest(a, l)
        swap(a, l, p)
        l = l + 1


def swap(a, i, j):
    temp = a[i]
    a[i] = a[j]
    a[j] = temp

def find_position_of_smallest(a, i):
    p = i
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
    return p

def sort(a):
    l = 0
    while l < len(a):
        p = find_position_of_smallest(a, l)
        swap(a, p, l)
    l = l + 1


def swap(a, i, j):
    temp = a[i]
    a[i] = a[j]
    a[j] = temp

def find_position_of_smallest(a, i):
    p = i
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
    return p

def sort(a):
    l = 0
    while l < len(a):
        p = find_position_of_smallest(a, l)
        swap(a, p, l)
        l = l + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
    return p

def sort(a):
    i = 0
    while i < len(a):
        p = find_position_of_smallest(a, i)
        swap(a, i, p)
        i = i + 1


def perimeter(n):
    per = n * 4
    return per

def rectangle_perimeter(n, m):
    rec = n * 2 + m * 2
    return rec


def circle_area(n):
    circ = 3.14 * (n * n)
    return circ

Return the area of a circle.


Return the area of a circle.


def circle_circumference(n):
    circle = 2 * 3.14 * n
    return circle

Return the circumference of a circle.


Return the circumference of a circle.


def square_area(n):
    sq = n * n
    return sq

Return the area of a square.


Return the area of a square.


def perimeter(n):
    per = n + n + n + n
    return per

def rectangle_perimeter(n, m):
    rec = n + m + n + m
    return rec


def perimeter(n):
    result1 = n + n + n + n
    return result1

def rectangle_perimeter(n, m):
    result4 = n + m + n + m
    return result4


def circle_circumference(n):
    result3 = 2 * 3.14 * n
    return result3

Return the circumference of a circle.


def circle_area(n):
    result2 = 3.14 * (n * n)
    return result2

Return the area of a circle.


def square_perimeter(n):
    result1 = n + n + n + n
    return result1

Returns the perimeter of a square.


def square_area(n):
    result = n * n
    return sq

Return the area of a square.


def rectangle_perimeter(n, m):
    result4 = n + m + n + m
    return result4


Returns the perimeter of a square.


def square_area(n):
    result = n * n
    return result

Return the area of a square.


def sort(a):
    i = 0
    while i < len(a):
        i = i + 1


def sort(a):
    i = 0
    while i < len(a):
        if a[i] < a[n]:
            n = i
        i = i + 1
        tmp = a[i]
        a[i] = a[n]
        a[n] = tmp
        i = i + 1


def sort(a):
    i = 0
    n = 0
    while i < len(a):
        if a[i] < a[n]:
            n = i
        i = i + 1
        tmp = a[i]
        a[i] = a[n]
        a[n] = tmp
        i = i + 1


def sort(a):
    i = 0
    n = 0
    while i < len(a):
        if a[i] < a[n]:
            n = i
        i = i + 1
        tmp = a[i]
        a[i] = a[n]
        a[n] = tmp


def sort(a):
    i = 0
    p = 0
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def sort(a):
    i = 0
    p = 0
    while i < len(a):
        if a[i] > a[p]:
            p = i
        i = i + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def sort(a):
    i = 0
    p = 0
    while i > len(a):
        if a[i] > a[p]:
            p = i
        i = i + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def sort(a):
    i = 0
    p = 0
    while i > len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def sort(a):
    i = 1
    p = 0
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def sort(a):
    i = 0
    p = 1
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def sort(a):
    n = i
    i = i + 1
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def sort(a):
    n = i
    i = i + 1
    while i < len(a):
        if a[i] < a[n]:
            n = i
        i = i + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def sort(a):
    n = i
    i = i + 1
    while i < len(a):
        if a[i] < a[n]:
            n = i
        i = i + 1
        tmp = a[n]
        a[n] = a[i]
        a[i] = tmp
        i = i + 1


def sort(a):
    i = i + 1
    n = i
    while i < len(a):
        if a[i] < a[n]:
            n = i
        i = i + 1
        tmp = a[n]
        a[n] = a[i]
        a[i] = tmp
        i = i + 1


def sort(a):
    i = 0
    while i < len(a):
        if a[i] < a[n]:
            n = i
        i = i + 1
        tmp = a[n]
        a[n] = a[i]
        a[i] = tmp
        i = i + 1


def sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def square_area(n):
    sq = n * n
    return sq

Return the area of a square.


Return the area of a square.


def square_perimeter(n):
    sp = n + n + n + n

Returns the perimeter of a square.


def rectangle_perimeter(n):
    rp = n + n + m + m


Return the area of a circle.


def circle_circumference(n):
    cc = 2 * 3.14 * n

Return the circumference of a circle.


def square_perimeter(n):
    sp = n + n + n + n
    return sp

Returns the perimeter of a square.


def circle_area(n):
    ca = 3.14 * n
    return ca

Return the area of a circle.


def circle_circumference(n):
    cc = 2 * 3.14 * n
    return cc

Return the circumference of a circle.


def rectangle_perimeter(n):
    rp = n + n + m + m
    return rp


Returns the perimeter of a square.


Return the circumference of a circle.


def circle_area(n):
    ca = 3.14 * n * n
    return ca

Return the area of a circle.


def rectangle_perimeter(n, m):
    rp = n + n + m + m
    return rp


def swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp

def sort(a):
    i = 0
    while i < len(a):
        swap(a, i, find_position_of_smallest + i)
        i = i + 1


def swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp

def find_position_of_smallest(a, i):
    p = i
    while i < len(a):
        if a[i] < a[p]:
            p = i
        i = i + 1
    return p

def sort(a):
    i = 0
    while i < len(a):
        p = find_position_of_smallest(a, i)
        swap(a, i, p)
        i = i + 1


def rectangle_perimeter(e, f):
    rp = 2 * (e + f)
    return rp


def circle_circumference(d):
    cc = 2 * 3.14 * d
    return cc

Return the circumference of a circle.


def square_area(a):
    sa = a * a
    return sa

Return the area of a square.


Return the area of a square.


def square_perimeter(b):
    sp = b + b + b + b
    return sp

Returns the perimeter of a square.


def circle_area(c):
    ca = 3.14 * c ** 2
    return ca

Return the area of a circle.


Return the area of a circle.


def reverse(a):
    b = []
    i = 0
    while i < len(a):
        b.append(a[len(a) - i - 1])
        i = i + 1
    return b

Iteratively reverse a list of elements.


Iteratively reverse a list of elements.


def reverse(a, i):
    i = 0
    lines = sys.stdin.readlines()
    while i < len(a):
        print(lines[i] - 1 - i)
    i = i + 1
    return a

Iteratively reverse a list of elements.


def reverse(n):
    reverse = a[len(a) - i - 1]
    return reverse

Iteratively reverse a list of elements.


def reverse(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[i] = tmp

Iteratively reverse a list of elements.


def reverse(a):
    a = a[::-1]
    return a

Iteratively reverse a list of elements.


def reverse(a):
    a = a[::a - 1]
    return a

Iteratively reverse a list of elements.


def reverse(a):
    a[::a - 1]
    return a

Iteratively reverse a list of elements.


def reverse(i, j, k):
    a = a[::-1]
    print(a)

Iteratively reverse a list of elements.


def reverse(a):
    a = a[::-1]
    print(a)

Iteratively reverse a list of elements.


def reverse(string):
    results = string[::-1]
    return string[::-1]

Iteratively reverse a list of elements.


def reverse(a):
    i = 0
    a = a[a:-i - 1]
    i = i + 1
    return a

Iteratively reverse a list of elements.


def reverse(a):
    while i < len(a):
        return len(a) - 1

Iteratively reverse a list of elements.


def reverse(a):
    i = 0
    j = len(a)
    while i < len(a):
        tmp = a[i]
        a[i] = a[j - i]
        a[j - i] = tmp
    print(a)

Iteratively reverse a list of elements.


def reverse(a):
    i = 0
    while i < len(a):
        tmp = a[i]
        a[i] = a[len(a) - i - 1]
        a[len(a) - i - 1] = a[i]
    return a

Iteratively reverse a list of elements.


def reverse(a_string):
    new_string = ''
    index = len(a_string)
    while index:
        index -= 1
        new_string += a_string[index]
    return new_string

Iteratively reverse a list of elements.


def reverse(a):
    i = 0
    while i < len(a):
        tmp = a[i]
        a[i] = a[len(a) - i]
        a[len(a) - i] = a[i]
    return a

Iteratively reverse a list of elements.


def reverse(a):
    i = 0
    j = len(a)
    while i < len(a):
        tmp = a[i]
        a[i] = a[j - i]
        a[j - i] = tmp
        i = i + 1
    print(a)

Iteratively reverse a list of elements.


def reverse(test):
    n = len(test)
    x = ''
    for i in range(n - 1, -1, -1):
        x += test[i]
    return x

Iteratively reverse a list of elements.


Iteratively reverse a list of elements.


def reverse(a):
    i = 0
    while i < len(a):
        tmp = a[i]
        a[i] = a[len(a) - i]
        a[len(a) - i] = tmp
        i = i + 1
    print(a)

Iteratively reverse a list of elements.


def reverse(a):
    a = []
    i = 0
    while i < len(a):
        tmp = a[i]
        a[i] = a[len(a) - i - 1]
        a[len(a) - i - 1] = a[i]
    return a

Iteratively reverse a list of elements.


def reverse(a):
    a = []
    i = 0
    rev = a[len(a) - i - 1]
    return rev

Iteratively reverse a list of elements.


def reverse(a):
    rev = a[len(a) - i - 1]
    return rev

Iteratively reverse a list of elements.


def reverse(a):
    i = 0
    rev = a[len(a) - i - 1]
    return rev

Iteratively reverse a list of elements.


def reverse(a):
    a = a[::-1]
    return a

Iteratively reverse a list of elements.


def reverse(a):
    print(reverse(a[i]))

Iteratively reverse a list of elements.


def reverse(a):
    i = 0
    while i < len(a):
        tmp = a[i]
        a[i] = a[len(a) - i - 1]
        a[len(a) - i - 1] = tmp
        i = i + 1
    print(a)

Iteratively reverse a list of elements.


def reverse(a):
    i = 0
    while i < len(a):
        tmp = a[i]
        a[i] = a[len(a) - i - 1]
        a[len(a) - i - 1] = tmp
        i = i + 1
    print(a.rstrip())

Iteratively reverse a list of elements.


def reverse(a):
    i = 0
    while i < len(a):
        tmp = a[i]
        a[i] = a[len(a) - i - 1]
        a[len(a) - i - 1] = tmp
        i = i + 1
    print(a.rstrip())
    print(tmp)
    print(a[i])

Iteratively reverse a list of elements.


def reverse(a):
    i = 0
    while i < len(a):
        tmp = a[i]
        a[i] = a[len(a) - i - 1]
        a[len(a) - i - 1] = tmp
        i = i + 1
    return a

Iteratively reverse a list of elements.


def reverse(a):
    i = 0
    while i < len(a) / 2:
        tmp = a[i]
        a[i] = a[len(a) - i - 1]
        a[len(a) - i - 1] = tmp
        i = i + 1
    return a

Iteratively reverse a list of elements.


def reverse(a, i, j):
    a = []
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp
    return a

Iteratively reverse a list of elements.


def reverse(a, i, j):
    a = []
    i = 0
    j = 0
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp
    return a

Iteratively reverse a list of elements.


def reverse(n):
    i = 0
    while i < len(a):
        print(n[len(n) - (i + 1)])
        i = i + 1

Iteratively reverse a list of elements.


def reverse(n):
    i = 0
    while i < len(n):
        print(n[len(n) - (i + 1)])
        i = i + 1

Iteratively reverse a list of elements.


def reverse(n):
    a = []
    i = 0
    while i < len(n):
        a.append(n)
        i = i + 1
    print(a)

Iteratively reverse a list of elements.


def reverse(n):
    i = 0
    while i < len(n):
        print(n)
        i = i + 1
    print(a)

Iteratively reverse a list of elements.


def reverse(n):
    a = []
    i = 0
    while i < len(n):
        print(n)
        i = i + 1
    print(a)

Iteratively reverse a list of elements.


def reverse(n):
    a = []
    i = 0
    j = len(n) - 1
    while i < len(n) / 2:
        tmp = a[i]
        a[i] = a[j]
        a[j] = tmp
        i = i + 1
    print(a)

Iteratively reverse a list of elements.


def reverse(a):
    b = a[::-1]
    return b

Iteratively reverse a list of elements.


Iteratively reverse a list of elements.


def reverse(n):
    i = 0
    while i < len(n) / 2:
        print(n[len(n) - i - 1])
    i = i + 1

Iteratively reverse a list of elements.


def reverse(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp
    return a

Iteratively reverse a list of elements.


def reverse(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp
    return a.rstrip()

Iteratively reverse a list of elements.


def reverse(a, i, j):
    a = []
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp
    return a

Iteratively reverse a list of elements.


def reverse(a):
    temp = []
    i = 0
    while i != len(a):
        temp.append(len(a) - 1)
        i = i + 1
    a = temp
    return a

Iteratively reverse a list of elements.


def reverse(a):
    temp = []
    i = 0
    while i != len(a):
        temp.append(len(a) - i)
        i = i + 1
    a = temp
    return a

Iteratively reverse a list of elements.


def reverse(a):
    temp = []
    i = 0
    while i != len(a):
        temp.append(a[len(a) - i])
        i = i + 1
    a = temp
    return a

Iteratively reverse a list of elements.


def reverse(a):
    temp = []
    i = 0
    while i != len(a):
        temp.append(a[len(a) - i - 1])
        i = i + 1
    a = temp
    return a

Iteratively reverse a list of elements.


assert double(0)==0 and double(-7601)==-15202

Double a number or a string.


Double a number or a string.


Return the area of a circle with the given coordinates.


def circumference(r):
    return 2 * 3.141 * r

assert circumference(0)==0.0 and circumference(-23091)==-145057.662

Return the circumference of a circle.


def circumference(r):
    return 2 * pi * r

Return the circumference of a circle.


Return the circumference of a circle.


Sort a list by repeatedly move minimimum of remaining sublist to front.


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def reverse(a):
    i = 0
    while i < len(a) / 2:
        swap(a, i, len(a) - 1 - i)
        i += 1

Reverse a list of elements by swapping its elements.


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def reverse(a):
    i = 0
    while i < len(a) / 2:
        swap(a, i, len(a) - 1 - i)
        i = i + 1


def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1
    return a


def circumference(r):
    return r * pi * 2

Return the circumference of a circle.


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = a[i]

def reverse(a):
    i = 0
    while i < len(a) / 2:
        swap(a, i, len(a) - 1 - i)
        i = i + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def position_of_smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if j < p:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = position_of_smallest(a, i)
        swap(a, i, p)
        i = i + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def position_of_smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = position_of_smallest(a, i)
        swap(a, i, p)
        i = i + 1


def intersection(a, b):
    seen = {}
    append = {}
    c = []
    i = 0
    while i < len(a):
        seen[a[i]] = True
        i = i + 1
    i = 0
    while i < len(b):
        if b[i] in seen and b[i] not in append:
            c.append(b[i])
            append[b[i]] = True
        i = i + 1
    return c

Return the intersection between two lists.


def union(a, b):
    a = a + b
    seen = {}
    c = []
    i = 0
    while i < len(a):
        if a[i] not in seen:
            seen[a[i]] = True
        i = i + 1
    for number in seen:
        c.append(number)
    return c

Merge two lists into a single one.


Merge two lists into a single one.


Double a number or a string.


def reverse(a):
    i = 0
    while i < len(a) / 2:
        a[i] = a[-i - 1]
        i += 1


def reverse(a):
    i = 0
    while i < len(a) / 2:
        a[i] = a[len(a) - i - 1]
        i += 1


def reverse(a):
    i = 0
    while i < len(a) / 2:
        tmp = a[i]
        a[i] = a[-i - 1]
        a[-i - 1] = tmp
        i += 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def reverse(a):
    i = 0
    while i < len(a) / 2:
        swap(i, -i - 1)
        i += 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def reverse(a):
    i = 0
    while i < len(a) / 2:
        swap(a, i, -i - 1)
        i += 1


def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j += 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += 1
    tmp = a[p]
    a[p] = a[i]
    a[i] = tmp
    i += 1


def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += 1
    tmp = a[p]
    a[p] = a[i]
    a[i] = tmp
    i += 1


def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i += 1


def reverse(a):
    i = 0
    while i < len(a):
        b.append(a[len(a) - 1 - i])
        i = i + 1
    a = b
    return a


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def find_position_of_smallest(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def sort(a):
    i = 0
    while i < len(a):
        p = find_position_of_smallest(a, i)
        swap(a, p, i)
        i = i + 1


def reverse(a):
    a = a[::-1]
    return a

Iteratively reverse a list of elements.


Iteratively reverse a list of elements.


def find_position_of_smallest(a, i):
    j = i
    while i < len(a):
        if a[i] < a[j]:
            j = i
        i = i + 1
    return j

def sort(a):
    i = 0
    while i < len(a):
        k = find_position_of_smallest(a, i)
        swap(a, i, k)
        i = i + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def reverse(a):
    i = 0
    while i < len(a) / 2:
        swap(a, i, len(a) - 1 - i)
        i += 1


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = low + (high - low) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low

Search for element q in the sorted array a.


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (high + low) / 2
        if a[mid] < q:
            low = mid
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (high + low) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    lo = 0
    hi = len(a)
    while lo < hi:
        mid = (lo + hi) / 2
        if a[mid] < q:
            lo = mid + 1
        else:
            hi = mid
    return lo


def bsearch(a, q):
    low = 0
    high = len(a)
    while high != low:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    print(low)


def bsearch(a, q):
    low = 0
    high = len(a)
    while high != low:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
        return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
        return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
        return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
        return mid


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = low + high / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if q > a[mid]:
            assert a[low - 1] < q
            low = mid + 1
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if q > a[mid]:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if q > a[mid]:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low != high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    print(low)


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
    if a[mid] < q:
        low = mid + 1
    else:
        high = mid


def bsearch(a, q):
    high = len(a)
    low = 0
    while low < high:
        mid = (low + high) / 2
        if a[mid] < p:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
    if a[mid] < q:
        low = mid + 1
    else:
        high = mid
    return low


def bsearch(a, q):
    high = len(a)
    low = 0
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low != high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
        assert low == 0 or a[low - 1] < q
        assert high == len(a) or q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    assert low == 0 or a[low - 1] < q
    assert high == len(a) or q <= a[high]
    while low < high:
        mid = (low + high) / 2
    if a[mid] < q:
        low = mid + 1
    else:
        high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low != high:
        mid = (low + high) / 2
        if a[mid] <= q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = 0
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    mid = 0
    i = 0
    if q in a:
        while a[i] != q:
            i += 1
        print(i)
    else:
        while low != high:
            mid = (high + low) / 2
            if q[mid] < low:
                high = mid
            else:
                low = mid
            print(low)


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            assert a[low - i] < q
            low = mid + 1
        else:
            assert q <= a[high]
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (high + low) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low != high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            assert a[mid + 1 - 1] < q
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= [high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high - low) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] <= q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(arr, tgt):
    lo = 0
    hi = len(arr)
    while lo != hi:
        mid = (lo + hi) / 2
        if arr[mid] < tgt:
            lo = mid + 1
        else:
            hi = mid - 1
    return (lo + hi) // 2 + 1 if arr[-1] == tgt else (lo + hi) // 2


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
    return low


def bsearch(arr, tgt):
    lo = 0
    hi = len(arr)
    while lo <= hi:
        mid = (lo + hi) / 2
        if arr[mid] < tgt:
            lo = mid + 1
        else:
            hi = mid - 1
    return (lo + hi) / 2


def bsearch(arr, tgt):
    lo = 0
    hi = len(arr)
    while lo != hi:
        mid = (lo + hi) / 2
        if arr[mid] < tgt:
            lo = mid + 1
        else:
            hi = mid - 1
    return (lo + hi) / 2


def bsearch(a, q):
    low = 0
    high = len(a) - 1
    while True:
        if high < low:
            return -1
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        elif a[mid] > q:
            high = mid - 1
        else:
            return mid


def bsearch(a, q):
    low = 0
    high = len(a)
    while True:
        if high < low:
            return -1
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        elif a[mid] > q:
            high = mid - 1
        else:
            return mid


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if q > a[mid]:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(arr, tgt):
    lo = 0
    hi = len(arr)
    while lo <= hi and (low + hi) / 2 < len(arr):
        mid = (lo + hi) / 2
        if arr[mid] < tgt:
            lo = mid + 1
        else:
            hi = mid - 1
    return (lo + hi) / 2


def bsearch(arr, tgt):
    lo = 0
    hi = len(arr)
    while lo <= hi and (lo + hi) / 2 < len(arr):
        mid = (lo + hi) / 2
        if arr[mid] < tgt:
            lo = mid + 1
        else:
            hi = mid - 1
    return (lo + hi) / 2


def bsearch(a, q):
    low = 0
    high = len(a)
    mid = 0
    i = 0
    if q in a:
        while a[i] != q:
            i += 1
        print(i)
    else:
        while low != high:
            mid = (high + low) / 2
            if a[mid] < low:
                high = mid
            else:
                low = mid
            print(low)


def bsearch(a, q):
    low = 0
    high = len(a) - 1
    while True:
        if high < low:
            return -1
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            return mid


def bsearch(arr, tgt):
    lo = 0
    hi = len(arr)
    while lo <= hi and (lo + hi) / 2 < len(arr):
        mid = (lo + hi) / 2
        if arr[mid] < tgt:
            lo = mid + 1
        else:
            hi = mid - 1
    return (lo + hi) / 2 + 1


def bsearch(a, q):
    low = 0
    high = len(a)
    i = 0
    if q in a:
        while a[i] != q:
            i += 1
        print(i)


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    A = False
    found = A
    newSet = q
    while found != True or newSet > 0:
        midpoint = int(len(newSet) / 2)
        if a < newSet[midpoint]:
            found = A
            newSet = newSet[:midpoint]
        elif a > newSet[midpoint]:
            found = A
            newSet = newSet[midpoint:]
        elif a == newSet[midpoint]:
            found = True
    return found


def bsearch(a, q):
    low = 0
    high = len(a)
    i = 0
    if q in a:
        while a[i] != q:
            i += 1
        print(i)
    else:
        while low != high:
            mid = (high + low) / 2
            if a[mid] < low:
                high = mid
            else:
                low = mid
            return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
        return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] <= q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    i = 0
    while low != high:
        mid = (high + low) / 2
        if a[mid] < low:
            high = mid
        else:
            low = mid
        return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low == 0 and a[low - 1] < q
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
            return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = low
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    i = 0
    while low != high:
        mid = (high + low) / 2
        if a[mid] < q:
            high = mid
        else:
            low = mid
        return low


def bsearch(a, q):
    low = 0
    high = len(a) - 1
    while low != high:
        if high < low:
            return -1
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            return mid


def bsearch(a, t):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < t:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    i = 0
    while low != high:
        mid = (high + low) / 2
        if a[mid] < q:
            high = mid
        else:
            low = mid
    return low


def bsearch(a, t):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < t:
            low = mid + 1
        else:
            high = mid - 1
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (high + low) / 2
        if a[mid] < q:
            assert low == 0 or a[low - 1] < q
            assert high == len(a) or q <= a[high]
        else:
            mid = low


def bsearch(a, q):
    low = 0
    high = len(a) - 1
    while low != high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            return mid


def bsearch(a, q):
    low = 0
    high = len(a) - 1
    while low != high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = low + 1
        else:
            return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (high + low) / 2
        if a[mid + 1] < q:
            assert low == 0 or a[low - 1] < q
            assert high == len(a) or q <= a[high]
        else:
            mid = low


def bsearch(a, q):
    high = len(a)
    low = 0
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (high + low) / 2
        if low < q:
            low = mid + 1
        else:
            high = mid
    print(low)


def bsearch(a, q):
    low = 0
    high = len(a)
    while low != high:
        m = (low + high) / 2
        if a[m] < q:
            low = m + 1
        else:
            high = m
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low != high:
        mid = (high + low) / 2
        if a[mid] < q:
            low = mid
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = low + (high - low) / 2
        if a[mid] < q:
            low = mid + 1
        elif a[mid] >= q:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (high + low) / 2
        if low < q:
            low = low + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
        return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < a
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (high + low) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (high + low) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (high + low) / 2
        if low < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = low + (high - low) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
        return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = low + (high - low) / 2
        if a[mid] < q:
            low = mid
        else:
            high = mid + 1
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a) - 1
    mid = 0
    while low < len(a) and a[low] < q:
        mid = (high + low) // 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    print(q)
    print(a, len(a))
    print(low, high)
    while low != high:
        mid = (low + high) / 2
        if a[mid] < q:
            0
        else:
            0
        print(q)
        print(a, len(a))
        print(low, mid, high)
        assert low == 0 or a[low - 1] < q
        assert high == len(a) or q <= a[high]
        low = high
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    print(q)
    print(a, len(a))
    print(low, high)
    while low != high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
        print(q)
        print(a, len(a))
        print(low, mid, high)
        assert low == 0 or a[low - 1] < q
        assert high == len(a) or q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low != high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
        print(q)
        print(a, len(a))
        print(low, mid, high)
        assert low == 0 or a[low - 1] < q
        assert high == len(a) or q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low != high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
        assert low == 0 or a[low - 1] < q
        assert high == len(a) or q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
    if a[mid] < q:
        low = mid + 1
        assert low == 0 or a[low - 1] < q
    else:
        high = mid
        assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (high + low) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
    if a[mid] < q:
        low = mid + 1
    else:
        high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
    if a[mid] < q:
        low = mid
    else:
        high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = low + high / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        middle = (low + high) / 2
        if a[mid] < q:
            low = mid
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        middle = (low + high) / 2
        if a[middle] < q:
            low = middle
            assert low == 0 or a[low - 1] < q
        else:
            high = middle
            assert high == len(a) or q <= a[high]


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (high + low) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return high


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = low + (high - low) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        middle = (low + high) / 2
        if a[middle] < q:
            low = middle
            assert low == 0 or a[low - 1] < q
        else:
            high = middle
            assert high == len(a) or q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        middle = (low + high) / 2
        if a[middle] < q:
            low = middle
            assert low == 0 or a[low - 1] < q
        else:
            high = middle
            assert high == len(a) or q <= a[high]
        return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        middle = (low + high) / 2
        if a[middle] < q:
            low = middle
            assert low == 0 or a[low - 1] < q
        else:
            high = middle
            assert high == len(a) or q <= a[high]
        return low[i]


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
        return low, high


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
        return mid


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
        return high - low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
        return len(a)


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        middle = (low + high) / 2
        if a[middle] < q:
            low = middle + 1
            assert low == 0 or a[low - 1] < q
        else:
            high = middle
            assert high == len(a) or q <= a[high]
        return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
        return high


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
        return high - mid


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q or low == 0
        else:
            high = mid
            assert q <= a[high] or high == len(a)
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        middle = (low + high) / 2
        if a[middle] < q:
            low = middle + 1
        else:
            high = middle
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
    if a[mid] < q:
        low = mid + 1
        assert a[low - 1] < q
    elif a[mid] == q:
        return mid
    else:
        high = mid
        assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        elif a[mid] == q:
            return mid
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
        return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        elif a[mid] == q:
            return mid
        else:
            high = mid
            assert q <= a[high]
    assert low == 0 or a[low - 1] < q
    assert high == len(a) or q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    assert low == 0 or a[low - 1] < q
    assert high == len(a) or q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid and mid < high
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert low == 0 or a[low - 1] < q
        else:
            high = mid
            assert high == len(a) or q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while high != low:
        search = (high + low) / 2
        if a[search] == q:
            return True
        elif a[search] > q:
            high = search
        else:
            low = search
            if low == search:
                low += 1
    return False


def bsearch(a, q):
    low = 0
    high = len(a)
    while high != low:
        search = (high + low) / 2
        if a[search] == q:
            return search
        elif a[search] > q:
            high = search
        else:
            low = search
            if low == search:
                low += 1
    return search


def bsearch(a, q):
    low = 0
    high = len(a)
    search = (high + low) / 2
    while high != low and a[search] != q:
        search = (high + low) / 2
        if a[search] > q:
            high = search
        else:
            low = search
            if low == search:
                low += 1
    return search


def bsearch(a, q):
    low = 0
    high = len(a)
    while high != low:
        search = (high + low) / 2
        if a[search] == q and a[search - 1] != q:
            return search
        elif a[search] > q:
            high = search
        else:
            low = search
            if low == search:
                low += 1
    return search


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        search = (high + low) / 2
        assert low <= search < high
        if a[search] < q:
            low = search + 1
            assert a[low - 1] < q
        else:
            high = search
            assert q <= a[high]
    return low


def intersection(a, b):
    seen = {}
    appended = {}
    c = []
    i = 0
    while i < len(a):
        seen[a[i]] = True
        i = i + 1
    i = 0
    while i < len(b):
        if b[i] in seen and b[i] not in appended:
            c.append(b[i])
            appended[b[i]] = True
        i = i + 1
    return c


def union(a, b):
    a = a + b
    seen = {}
    c = []
    i = 0
    while i < len(a):
        if a[i] not in seen:
            c.append(a[i])
            seen[a[i]] = True
        i = i + 1
    return c

Merge two lists into a single one.


Merge two lists into a single one.


def walkback(a, q, i):
    while i > 1 and a[i - 1] == q:
        i -= 1
    return i

def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        guess = low + (high - low) / 2
        if a[guess] == q:
            return walkback(a, q, guess)
        elif a[guess] < q:
            low = guess + 1
        else:
            high = guess - 1
    return low


def walkback(a, q, i):
    while i > 1 and a[i - 1] == q:
        i -= 1
    return i

def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        guess = low + (high - low) // 2
        if a[guess] == q:
            return walkback(a, q, guess)
        elif a[guess] < q:
            low = guess + 1
        else:
            high = guess
    return low


def walkback(a, q, i):
    while i > 0 and a[i - 1] == q:
        i -= 1
    return i

def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        guess = low + (high - low) // 2
        if a[guess] == q:
            return walkback(a, q, guess)
        elif a[guess] < q:
            low = guess + 1
        else:
            high = guess
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < a
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
        return low


Double a number or a string.


def circumference(r):
    return 2 * 3.141 * r

Return the circumference of a circle.


def circumference(r):
    return 2 * pi * r

Return the circumference of a circle.


Return the circumference of a circle.


def reverse(a):
    i = 0
    j = len(a) - 1
    while i < len(a) / 2:
        tmp = a[i]
        a[i] = a[j]
        a[j] = tmp
        i = i + 1
        j = j - 1


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        assert low <= mid < high
        if a[mid] < q:
            low = mid + 1
            assert a[low - 1] < q
        else:
            high = mid
            assert q <= a[high]
    return low


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
    return low


def reverse(a):
    a = a[::-1]
    return a


def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1


def swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp
    return

def reverse(a):
    return swap(a, 2, 3)


def swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp
    return

def reverse(a):
    i = 0
    while i < len(a) / 2:
        swap(a, i, len(a) - 1 - i)
        i = i + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp
    return a

def reverse(a):
    i = 0
    while i < len(a) / 2:
        swap(a, a[i], a[len(a) - i - 1])
    return a


def swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp
    return a

def reverse(a):
    i = 0
    while i < len(a) / 2:
        swap(a, a[i], a[len(a) - i - 1])
    return a


def swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp
    return a

def reverse(a):
    i = 0
    while i < len(a) / 2:
        j = len(a) - i - 1
        swap(a, i, j)
        i = i + 1
    return a


def selection_sort(a):
    i = 0
    while i < len(a):
        j = i + 1
        min_ind = i
        while j < len(a):
            if a[j] < a[min_ind]:
                min_ind = j
            j += 1
        tmp = a[i]
        a[i] = a[min_ind]
        a[min_ind] = tmp
        i += 1


def reverse(a):
    i = 0
    while i < len(a):
        print(len(a) - i)


def reverse(a):
    i = 0
    while i < len(a):
        print(len(a) - i)
    i = i + 1


def reverse(a):
    i = 0
    while i < len(a):
        print(len(a) - i)
        i = i + 1


def reverse(a):
    i = 1
    while i < len(a):
        print(len(a) - i)
        i = i + 1


def selection_sort(a):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    tmp = a[p]
    a[p] = a[i]
    a[i] = tmp
    i = i + 1
    return a


def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i = i + 1
    return a


def bsearch(a, q):
    low = 0
    high = len(a)
    while low < high:
        mid = (low + high) / 2
        if a[mid] < q:
            low = mid + 1
        else:
            high = mid
        return low


def double(n):
    n = a * 2
    return n

Double a number or a string.


def double(n):
    a = n * 2
    return a

Double a number or a string.


Double a number or a string.


def swap(a, i, j):
    tmp = a[j]
    a[j] = a[i]
    a[i] = tmp

def reverse(a):
    i = 0
    while i < len(a) / 2:
        swap(a, i, len(a) - 1 - i)
        i = i + 1


def circumference(r):
    return 2 * pi * r

Return the circumference of a circle.


Return the circumference of a circle.


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def reverse(a):
    i = 0
    j = len(a) - 1
    while i < len(a) / 2:
        swap(a, i, j)
        i = i + 1
        j = j - 1


def double(n):
    n = n * 2
    return n

Double a number or a string.


def circumference(r):
    a = 2 * 3.141 * r
    return a

Return the circumference of a circle.


def area(r):
    r = r ** 2
    a = 2 * 3.141 * r
    return a


def circumference(r):
    r = 2 * 3.141 * r
    return r

Return the circumference of a circle.


def area(r):
    r = r ** 2
    r = 3.141 * r
    return r


def circumference(r):
    a = 2 * pi * r
    return a

Return the circumference of a circle.


def area(r):
    r = r ** 2
    a = pi * r
    return a


def reverse(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if int(a[j]) > int(a[p]):
            p = j
        j = j + 1
    return p


def reverse(a):
    p = i
    j = i + 1
    while j < len(a):
        if int(a[j]) > int(a[p]):
            p = j
        j = j + 1
    return p


def reverse(a):
    i = 0
    j = len(a) - 1
    while i < len(a) / 2:
        tmp = a[i]
        a[i] = a[j]
        a[j] = tmp
        i = i + 1
        j = j - 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j = j + 1
        swap(a, i, p)
        i = i + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def reverse(a):
    i = 0
    while i < len(a) / 2:
        swap(a, i, len(a) - 1 - i)
        i = i + 1


def double(n):
    y = n * 2
    return y

Double a number or a string.


Double a number or a string.


def circumference(r):
    y = 2 * pi * r
    return y

Return the circumference of a circle.


def area(r):
    x = (pi * r) ** 2
    return x


def area(r):
    x = pi * r ** 2
    return x


Return the circumference of a circle.


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def reverse(a):
    i = 0
    while i < len(a) / 2:
        swap(a, i, len(a) - i - 1)
        i = i + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def reverse(a):
    i = 0
    while i < len(a) / 2:
        j = len(a) - i - 1
        swap(a, i, j)
        i = i + 1


def selection_sort(a):
    i = 0
    j = i + 1
    while i < len(a):
        if a[j] < a[i]:
            tmp = a[j]
            a[j] = a[i]
            a[i] = tmp
        j = j + 1
    i = i + 1
    return a


def selection_sort(a):
    i = 0
    j = i + 1
    while i < len(a):
        j = i + 1
        while j < len(a):
            if a[j] < a[i]:
                tmp = a[j]
                a[j] = a[i]
                a[i] = tmp
        j = j + 1
    i = i + 1
    return a


def selection_sort(a):
    i = 0
    j = i + 1
    while i < len(a):
        j = i + 1
        while j < len(a):
            if a[j] < a[i]:
                tmp = a[j]
                a[j] = a[i]
                a[i] = tmp
            j = j + 1
        i = i + 1
        return a


def selection_sort(a):
    i = 0
    while i < len(a):
        j = i + 1
        while j < len(a):
            if a[j] < a[i]:
                tmp = a[j]
                a[j] = a[i]
                a[i] = tmp
            j = j + 1
        i = i + 1
        return a


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[p] < a[j]:
                j = p
            j = j + 1
        i = i + 1
    swap(a, i, p)


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def smallest_element(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[p] < a[j]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        smallest_element(a, i)
        swap(a, i, j)
        i = i + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def smallest_element(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[p] < a[j]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = smallest_element(a, i)
        swap(a, i, j)
        i = i + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def smallest_element(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[p] < a[j]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = smallest_element(a, i)
        swap(a, i, p)
        i = i + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def smallest_element(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[p] < a[j]:
            j = p
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = smallest_element(a, i)
        swap(a, i, p)
        i = i + 1


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def smallest_element(a, i):
    p = i
    j = i + 1
    while j < len(a):
        if a[j] < a[p]:
            p = j
        j = j + 1
    return p

def selection_sort(a):
    i = 0
    while i < len(a):
        p = smallest_element(a, i)
        swap(a, i, p)
        i = i + 1


def double(n):
    n = n * 2
    return n

Double a number or a string.


Double a number or a string.


def swap(a, i, j):
    tmp = a[i]
    a[i] = a[j]
    a[j] = tmp

def reverse(a):
    i = 0
    while i < len(a) / 2:
        swap(a, i, -i - 1)
        i += 1


def selection_sort(a):
    i = 0
    while i < len(a):
        p = i
        j = i + 1
        while j < len(a):
            if a[j] < a[p]:
                p = j
            j += 1
        tmp = a[p]
        a[p] = a[i]
        a[i] = tmp
        i += 1