Problem:


Score : 100 points

Problem Statement

A biscuit making machine produces B biscuits at the following moments: A seconds, 2A seconds, 3A seconds and each subsequent multiple of A seconds after activation.

Find the total number of biscuits produced within T + 0.5 seconds after activation.

Constraints

All values in input are integers.

1 \leq A, B, T \leq 20

Input

Input is given from Standard Input in the following format:

A B T

Output

Print the total number of biscuits produced within T + 0.5 seconds after activation.

Sample Input 1

3 5 7

Sample Output 1

10

Five biscuits will be produced three seconds after activation.

Another five biscuits will be produced six seconds after activation.

Thus, a total of ten biscuits will be produced within 7.5 seconds after activation.

Sample Input 2

3 2 9

Sample Output 2

6

Sample Input 3

20 20 19

Sample Output 3

0



Sample input:
3 5 7


Sample output:
10

Submission status: Runtime Error

Solution code:

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

def main( ) :

  n = int(input())
  v = [int(i) for i in input().split()]

  l = [0 for i in range(n)]
  r = l[:]

  for i in range(1, n) :
      l[i] = gcd(l[i-1], v[i-1])
      r[-i-1] = gcd(r[-i], v[-i])

  ans = 0
  for i in range(n) :
      ans = max(ans, gcd(l[i], r[i]))
  print(ans)
                 

main()

Submission status: Runtime Error

Solution code:
import heapq

# input
N = int(input())
A = [int(x) for x in input().split()]

# Common divisor
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y)

CD = []
for i in A[1:]:
    if A[0] >= i:
        CD.append(gcd(A[0], i))
    else:
        CD.append(gcd(i, A[0]))


print(max(heapq.nsmallest(2, CD)))

Submission status: Runtime Error

Solution code:
import heapq

# input
N = int(input())
A = [int(x) for x in input().split()]

# Common divisor
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y) #再帰定義

CD = []
for i in A[1:]:
    if A[0] >= i:
        CD.append(gcd(A[0], i))
    else:
        CD.append(gcd(i, A[0]))


print(min(heapq.nlargest(2, CD)))

Submission status: Runtime Error

Solution code:
import heapq

# input
N = int(input())
A = [int(x) for x in input().split()]

# N = 3
# A = [12, 15, 18]
# A = [random.randint(0, 1000000) for i in range(100)]
# process

# Common divisor
def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y) #再帰定義

CD = []
for i in A[1:]:
    if A[0] >= i:
        CD.append(gcd(A[0], i))
    else:
        CD.append(gcd(i, A[0]))


print(min(heapq.nlargest(2, CD)))

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map(int,input().split()))

def GCD(L):
  while(len(L)>1):
    a=min(L)
    M=map(lambda x: x%a, L)
    L=[a]+list(filter(lambda x: x!=0, M))
  return a

cogcd=[ 0 for i in range(N)]

for i in range(N):
  cogcd[i]=GCD(A[:i]+A[i+1:])

print(max(cogcd))

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map(int,input().split()))

def GCD(a,b):
  if(a<b): a,b=b,a
  while(b!=0):
    a,b=b,a%b
  return a

cogcd=[0 for i in range(N)]
allgcd=GCD(A[0],A[1])
cogcd[0]=A[1]
cogcd[1]=A[0]

for i in range(2,N):
  for j in range(i):
    cogcd[j]=GCD(cogcd[j],A[i])
  cogcd[i]=allgcd
  allgcd=GCD(allgcd,A[i])
print(max(cogcd))

Submission status: Runtime Error

Solution code:
s = input()
d = s.split("/")
m = int(d[1])
if m > 4:
 print("TBD")
else:
 print("Heisei")

Submission status: Runtime Error

Solution code:
a, b, t = map(float(input().split()))
answer = int((t + 0.5) / a) * b
print(answer)

Submission status: Runtime Error

Solution code:
a, b, t = (float(i) for i in input().split())
print(int(t + 0.5) / a) * b)

Submission status: Runtime Error

Solution code:
import math
a, b, t = (float(i) for i in input().split())
print(int(math.fllor((t + 0.5) / b)) * a)

Submission status: Runtime Error

Solution code:
A,B,T=map(int,input(),split())
num=(T+0.5)//A
print(num*B)

Submission status: Runtime Error

Solution code:
(T // A) *B

Submission status: Runtime Error

Solution code:
return ((T + 0.5) // A) * B

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
import math
import random



def gcd(x, y):
    if y == 0:
        return x
    else:
        return gcd(y, x % y) #再帰定義

def solve(N, A):
    left = [A[0]]
    right = [A[N-1]]
    for i in range(1, N):
        left.append(gcd(left[i-1], A[i]))
    for i,j in zip(range(1,N),range(N-2, -1, -1)):
        right.append(gcd(right[i-1], A[j]))

    result = -1
    max_value = -1

    for i in range(N):
        if i == 0:
            current_value = right[N-2]
        elif i == N-1:
            current_value = left[N-2]
        else:
            current_value = gcd(left[i-1], right[N-i-2])
        if current_value > max_value:
            max_value = current_value
    print(max_value)

# Generated by 1.1.4 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [ int(next(tokens)) for _ in range(N) ]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
a,b,t=list(map(int,input()))
print(t*(b//a))

Submission status: Runtime Error

Solution code:
a,b,t=list(map(int,input()))
print(t(*b//a))

Submission status: Runtime Error

Solution code:
a,b,t=list(map(int,input()))
print(t*b(//a))

Submission status: Runtime Error

Solution code:
a,b,t=list(map(int,input()))
print(t*b//a)

Submission status: Runtime Error

Solution code:
x=int(input())
y=int(input())
z=int(input())
a=int((z/x)*y)-1
print (a)

Submission status: Runtime Error

Solution code:
x=int(input())
y=int(input())
z=int(input())
a=int((z%x)*y)
print (a)

Submission status: Runtime Error

Solution code:
x=input()
y=input()
z=input()
a=(z%x)*y
print (a)

Submission status: Runtime Error

Solution code:
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
using namespace std;



int main(){
    //input    
    int A,B,T;
    cin >> A >> B >> T;
    int ans;
    ans = (T / A)*B;
    cout << ans << endl;
    

    return 0;
}

Submission status: Runtime Error

Solution code:
A, B, T = map(int, input.split())

print((T+0.5) // A * B)

Submission status: Runtime Error

Solution code:
import fractions

n_str = input()
n = int(n_str)
a_str = input().split()
a = []
for i in range(n):
    a.append(int(a_str[i]))
tmp1 = [0] * (n + 1)
tmp2 = [0] * (n + 1)
tmp = []
for i in range(n + 1):
    for j in range(i):
        if j == 0:
            tmp1[j + 1] = fractions.gcd(0, a[j])
        else:
            tmp1[j + 1] = fractions.gcd(tmp1[j], a[j])
    for j in range(n - 1, i, -1):
        if j == n - 1:
            tmp2[j] = fractions.gcd(0, a[j])
        else:
            tmp2[j] = fractions.gcd(tmp2[j + 1], a[j])
    if i == 0:
        tmp.append(fractions.gcd(0, tmp2[i + 1]))
    elif i == n:
        tmp.append(fractions.gcd(tmp1[i], 0))
    else:
        tmp.append(fractions.gcd(tmp1[i], tmp2[i + 1]))
print(max(tmp))

Submission status: Runtime Error

Solution code:
[print(a//t*b)for a,b,t in[[int(i)for i in input().split()]]

Submission status: Runtime Error

Solution code:
A, B, T = input.split(' ')
print(T / A * B)

Submission status: Runtime Error

Solution code:
a,b,t = map(input,input().split())
ans = b*(t+0.5)//a
print(ans)

Submission status: Runtime Error

Solution code:
a,b,t = map(input,input().split())
ans = (t+0.5)*b/a
print(ans)

Submission status: Runtime Error

Solution code:
a, b, t = input().split()
t = t + 0.5
o = 0

while t > 0:
	t = t - a
    o = o + b

print(o)

Submission status: Runtime Error

Solution code:
N = int(input())
V = list(map(int,input().split()))
C = list(map(int,input().split()))

count = 0
for i in range(N):
    if V[i] > C[i]:
        count += V[i] - C[i]

print (count)

Submission status: Runtime Error

Solution code:
    a,b,t = map(int,input().split())
    x = t // a
    y = x * b
    print(y)

Submission status: Runtime Error

Solution code:
N = int(input().strip())
A = list(map(int, input().strip().split(' ')))
A = sorted(A)

# 約数列挙
def divisor(n):
  result = []
  for i in range(1, int(n**0.5)+1):
    if n % i == 0:
      result.append(i)
      if i != n // i:
        result.append(n//i)
  return result

# A(intのlist)のうちdで割り切れるものがlen(A)-1個以上あればTrue
def check(A, d):
  count = 0
  for a in A:
    if a % d == 0:
      continue
    count += 1
    if count > 1:
      return False
  return True

for i in sorted(list(set(divisor(A[0])+divisor(A[1]))))[::-1]:
  if check(A, i):
    print(i)
    exit()

Submission status: Runtime Error

Solution code:
import math

a = 6
b = 4

print(math.gcd(a, b))
# 2

Submission status: Runtime Error

Solution code:
ZXC

Submission status: Runtime Error

Solution code:
N = int(input())
V = list(map(int, input().split()))
C = list(map(int, input().split()))

ans = 0
for i in range(1<<N):
    val = 0
    for j in range(N):
        if i >> j & 1:
            val+=V[j]
            val-=C[j]
    ans = max(ans, val)
print(ans)

Submission status: Runtime Error

Solution code:
print(B*(T//A))

Submission status: Runtime Error

Solution code:
print(B*((T+0.5)//A))

Submission status: Runtime Error

Solution code:
A,B,T=map(int,input().split)
print((T/A)*B)

Submission status: Runtime Error

Solution code:
A = int(input())
B = int(input())
T = int(input())
x = T // A
y = B * x
print(y)

Submission status: Runtime Error

Solution code:
import copy

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

def gcd_list(numbers):
    g = numbers[0]
    for m in numbers:
        g = gcd(g, m)
    return g

N = int(input())
A = list(map(int, input().split(" ")))

gcds = list()
for a in A:
    B = copy.deepcopy(A)
    B.remove(a)
    g = gcd_list(B)
    gcds.append(g)
print(max(gcds))

Submission status: Runtime Error

Solution code:
x = T % A
y = x * B
print(y)

Submission status: Runtime Error

Solution code:
#include <iostream>
using namespace std;

int main(void){
    // Your code here!
    int a,b,c;
    cin >>a >> b >> c;
    cout << (c/a)*b;
}

Submission status: Runtime Error

Solution code:
#include "bits/stdc++.h"

using namespace std;

int main(){
  int A, B, T;
  cin >> A >> B >> T;

  cout << T/A*B << endl;
}

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
a, b, t = map(int, input().split())

# 何回生産出来るか
p = (t+0.5)//a

anc = int(p*b)

print(ans)

Submission status: Runtime Error

Solution code:
def gcd(a,b):
    if b>a:
        a,b=b,a
    while b:
        a,b=b, a%b
    return a


def cul(n,x):
    l=len(x)
    b=[x[i] for i in range(l)]
    b.pop(n)
    tmp=b[0]
    for i in range(1,l-1):
        tmp=gcd(tmp,b[i])
    return tmp

import sys
import math
p=10
N=int(input())
a=list(map(int,input().split()))
if N<=p:
    ans=0
    
    for i in range(N):
        tmp=cul(i,a)        
        if tmp>ans: ans=tmp
    print(ans)
    sys.exit()
        
M=a[0]
for i in range(1,p):
    M=gcd(M,a[i])

ans=0
for i in range(1,math.ceil(M**0.5)+1 ):
    if M%i==0:
        cnt=0
        for j in range(p,N):
            if a[i]%i!=0:
                cnt+=1
                if cnt==2: break
            elif i==N-1 and i>ans: ans=i
        
        x=M//i
        cnt=0
        for j in range(p,N):
            if a[i]%x!=0:
                cnt+=1
                if cnt==2: break
            elif i==N-1 and x>ans: ans=x



print(ans)

Submission status: Runtime Error

Solution code:
A,B,T=map(input(),split())
a=int(T/A+0.5)
print(a*B)

Submission status: Runtime Error

Solution code:
a,b,c=map(int,input(),split());print(c//a*b)

Submission status: Runtime Error

Solution code:
a = 0
b = 0
t = 0
an = 0
a = int(input())
b = int(input())
t = float(input())
aa = a
t = t + 0.5
while float(a) < t :
    an += b
    a += aa
print(an)

Submission status: Runtime Error

Solution code:
def gcd(a, b):
    while True:
        bigger=max(a,b)
        smaller=min(a,b)
        mod=bigger%smaller
        if mod==0:
            return smaller
        else:
            return gcd(smaller, mod)

n = int(input())
a = list(map(int, input().split()))
ansers=[]
non_remove=a[0]
ansers.append(a[1])
for i in range(1, n):
    ansers = [ gcd(ans, a[i]) for ans in ansers ]
    ansers.append(non_remove)
    non_remove = gcd(non_remove, a[i])
print(max(ansers))

Submission status: Runtime Error

Solution code:
from fractions import gcd
 
def main():
    n = int(input())
    a = list(map(int, input().split()))
    left = [0]
    right = [0]
    for l in a[:-1]:
        g = gcd(left[-1], l)
        left.append(g)
    for r in a[n:0:-1]:
        g = gcd(right[-1], r)
        right.append(g)
    right.reverse()
    m = 0
    for i in range(n):
        m = max(m, gcd(left[i], right[i]))
    print(m)
    
if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map(int,input().split()))

A[0]=A[0]-1
A[1]=A[1]-1
sum=0

for a in A:
    if a>0:
        sum+=a

print(sum)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
A.sort()

w_min = A[1]

for i in range(w_min,0,-1):
    count = 0
    for j in A:
        if j%i != 0:
            count = count + 1
            if count > 1:
                break
    if count < 2:
        print(i)
        break

Submission status: Runtime Error

Solution code:
import fractions
import functools

N = int(input())
A = list(map(int,input().split()))

ans = 1

for i in range(1,N):
    A_i = A[:i-1] + A[i:]
    ans = max(ans, functools.reduce(fractions.gcd, A_i))

print(ans)

Submission status: Runtime Error

Solution code:
import fractions

def main():
    N=int(input())
    num=list(map(int,input().split()))
    gcd=0
    gcd_list_front=[]
    gcd_list_back=[]
    gcd_list_front.append(num[0])
    gcd_list_back.append(num[-1])

    for  i in range(1,N-1):
        gcd_list_front.append(fractions.gcd(gcd_list_front[i-1],num[i]))
        gcd_list_back.append(fractions.gcd(gcd_list_back[i-1],num[-i-1]))
    gcd_list_back.reverse()

    gcd=max(gcd_list_back[0],gcd_list_front[-1])
    for i in range(0,N-2):
       temp_gcd=fractions.gcd(gcd_list_front[i],gcd_list_back[i+1])
       if temp_gcd>gcd:
           gcd=temp_gcd
    print(gcd)


if  __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
import fractions

def main():
    N=int(input())
    num=list(map(int,input().split()))
    gcd=0
    gcd_list_front=[]
    gcd_list_back=[]
    gcd_list_front.append(num[0])
    gcd_list_back.append(num[-1])

    for  i in range(1,N-1):
        gcd_list_front.append(fractions.gcd(gcd_list_front[i-1],num[i]))
        gcd_list_back.append(fractions.gcd(gcd_list_back[i-1],num[-i-1]))
    gcd_list_back.reverse()

    gcd=max(gcd_list_back[0],gcd_list_front[-1])
    for i in range(0,N-2):
       temp_gcd=fractions.gcd(gcd_list_front[i],gcd_list_back[i+1])
       if temp_gcd>gcd:
           gcd=temp_gcd
    print(gcd)


if  __name__=="__main__":
    main()

Submission status: Runtime Error

Solution code:
import fractions

def main():
    N=int(input())
    num=list(map(int,input().split()))
    gcd=0
    gcd_list_front=[]
    gcd_list_back=[]
    gcd_list_front.append(num[0])
    gcd_list_back.append(num[-1])

    for  i in range(l,N-1):
        gcd_list_front.append(fractions.gcd(gcd_list_front[i-1],num[i]))
        gcd_list_back.append(fractions.gcd(gcd_list_back[i-1],num[-i-1]))
   gcd_list_back.reverse()

   gcd=max(gcd_list_back[0],gcd_list_front[-1])
   for i in range(0,N-2):
       temp_gcd=fractions.gcd(gcd_list_front[i],gcd_list_back[i+1])
       if temp_gcd>gcd:
           gcd=temp_gcd
    print(gcd)


if  __name__="__main__":
    main()

Submission status: Runtime Error

Solution code:
#!/usr/bin/env python3
import sys
import math
from collections import Counter
import collections
INF = float("inf")


import math


class SegmentTree(object):
    # セグメント木

    def __init__(self, N):
        """サイズNの配列を元にしたセグメント木
        """
        # 単位元
        self.idelem = 0
        # 比較関数
        self.func = GCD

        self.N0 = 2**(math.ceil(math.log2(N)))
        self.tree = [self.idelem]*(2*self.N0)

    def update(self, k, x):
        """k番目の値をxに更新
        """
        k += self.N0-1
        self.tree[k] = x
        while k > 1:
            k = (k-1)//2
            self.tree[k] = self.func(self.tree[2*k+1], self.tree[2*k+2])

    def query(self, l, r):
        """区間[l, r)の最小値
        """
        l += self.N0-1
        r += self.N0-1
        s = self.idelem
        while l < r:
            if r % 2 == 0:
                r -= 1
                s = self.func(s, self.tree[r])

            if l % 2 == 0:
                s = self.func(s, self.tree[l])
                l += 1
            l //= 2
            r //= 2
        return s

    def __str__(self):
        return str(self.tree[self.N0-1:-1])


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


def GCDs(*a):
    # リストで入力しないよう注意。
    if len(a) == 0:
        return -1  # エラー

    if len(a) == 1:
        return a[0]

    res = a[0]
    for i in range(1, len(a)):
        res = GCD(res, a[i])
    return res


def solve(N: int, A: "List[int]"):

    st = SegmentTree(N)
    for i, a in enumerate(A):
        st.update(i, a)

    buf = []
    for i in range(N):
        buf.append(GCD(st.query(0, i), st.query(i+1, N)))
    print(max(buf))

    return


def main():

    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)


if __name__ == '__main__':
    main()

Submission status: Runtime Error

Solution code:
def gcd(a, b):
    while b != 0:
        a, b = b, a % b
    return a


N = int(input())
A = list(map(int, input().split()))
L = [0 for i in range(N)]
R = [0 for i in range(N)]
T = [0 for i in range(N)]

for i in range(N):
    if i == 0:
        L[i] = 0
    else:
        L[i] = gcd(L[i-1], A[i-1])
for i in range(N-1, 0, -1):
    if i == N-1:
        R[i] = 0
    else:
        R[i] = gcd(R[i+1], A[i+1])
for i in range(N):
    T[i] = gcd(L[i], R[i])

print(max(T))

Submission status: Runtime Error

Solution code:
import numpy as np
import fractions

N = int(input())
A = np.array([int(i) for i in (input()).split(" ")])
maxA = np.max(A)

if(maxA == np.min(A)):
    print(maxA)
else:
    check = np.unique(maxA // np.arange(1,maxA))
    #check = minA // np.arange(1,minA)
    for i in check[::-1]:
        #全てのAに対してiで割り切れるか＝最大公約数
        #iで割り切れた数＝len(A)-1なら，残りの数にiをかけて最大公約数に出来る．
        num = np.sum((A % i>0))
        if(num < 2):
            print(i)
            break

Submission status: Runtime Error

Solution code:
import numpy as np
import math

N = int(input())
A = np.array([int(i) for i in (input()).split(" ")])
minA = np.min(A)

if(minA == np.max(A)):
    print(minA)
else:
    check = np.unique(minA // np.arange(1,minA))
    #check = minA // np.arange(1,minA)
    for i in check[::-1]:
        #全てのAに対してiで割り切れるか＝最大公約数
        #iで割り切れた数＝len(A)-1なら，残りの数にiをかけて最大公約数に出来る．
        num = np.sum((A % i>0))
        if(num < 2):
            j = A[np.where(A % i>0)][0]
            #print(i,j,i*j//math.gcd(i,j))
            if(i*j//math.gcd(i,j) < 10**9):
                print(i)
                break

Submission status: Runtime Error

Solution code:
A,B,T = map(int, input().split())
for i in range(T/A):
	i += B
print(i)

Submission status: Runtime Error

Solution code:
A,B,T = map(int, input().split())
for i in range(T/A)
	i += B
print(i)

Submission status: Runtime Error

Solution code:
n = int(input())

a = [int(i) for i in input().split()]

# n が 2なら 大きい方を出力して終わり

#def euclid(m, n):
#  if n == 0:
#    return m
#  new_m = n
#  new_n = m % n
#  return euclid(new_m, new_n)
#
#def array_euclid(numbers):
#  n = len(numbers)
#  v = numbers[n-1] % numbers[n-2]
#  if v == 0:
#    if n == 2:
#      return numbers[0]
#    
#    numbers.pop()
#    return array_euclid(numbers)
#
#  numbers[n-1] = numbers[n-2]
#  numbers[n-2] = v
#  return array_euclid(numbers)

#print(array_euclid(a))

#if n == 2:
#  print(euclid(a[0], a[1]))
#if n > 2:
#  max_list = []
#  max_list.append(array_euclid(a[:]))
#  for i in range(n):
#    a2 = a[:]
#    a2.pop(i)
#    max_list.append(array_euclid(a2))
#  print(max(max_list))
#


# n が3になるまでやって、大きい方が答え？

#for i in range(n-1):


#print(euclid(a[0],a[1]))


# 最大公約数を求めるには math.gcd を使う

from fractions import gcd
from functools import reduce

def gcd_list(numbers):
  return reduce(gcd, numbers)

max_list = []
max_list.append(gcd_list(a))
for i in range(n):
  a2 = a[0:i] + a[i+1:]
  #a2.pop(i)
  max_list.append(gcd_list(a2))
print(max(max_list))

Submission status: Runtime Error

Solution code:
import math

N=int(input())
A=list(map(int,input().split()))

L=[0,0]
for ai in A:
    #L.append(gcd(L[-1],ai))
    L.append(math.gcd(L[-1],ai))
    print(L)

R=[0,0]
for ai in A[::-1]:
    #R.append(gcd(R[-1],ai))
    R.append(math.gcd(L[-1],ai))
    print(R)

print(max(math.gcd(l,r) for l,r in zip(L,reversed(R))))

Submission status: Runtime Error

Solution code:
A = int(input(A))
B = int(input(B))
T = int(input(T))

count = (T + 0.5) // A
biscuit = B * count
print(biscuit)

Submission status: Runtime Error

Solution code:
A = int(A)
B = int(B)
T = int(T)

count = (T + 0.5) // A
biscuit = B * count
print(biscuit)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))


for i in range(max(A),1,-1):
    l = list(map(lambda x: x % i,A))
    if l.count(0) >= len(A)-1:
        print(i)
        break

Submission status: Runtime Error

Solution code:
li = input().split()
s=(int(li[2])*int(li[1])/int(li[0])
print(str(s))

Submission status: Runtime Error

Solution code:
from fractions import gcd
import functools

n = int(input())
a = input().split()

i = 0
list = []
while i < n:
    list.append(int(a[i]))
    i += 1
    
gc = functools.reduce(gcd, list)
print(gc)

Submission status: Runtime Error

Solution code:
import gcd
import functools

n = int(input())
a = input().split()

i = 0
list = []
while i < n:
    list.append(int(a[i]))
    i += 1
    
gc = functools.reduce(gcd, list)
print(gc)

Submission status: Runtime Error

Solution code:
#abc125b

n=int(raw_input())
v=map(int,raw_input().split())
c=map(int,raw_input().split())
res=0
for i in xrange(n):
 if v[i]-c[i]>0:
  res+=v[i]-c[i]
print res

Submission status: Runtime Error

Solution code:
from functools import reduce
import math

N = int(input())
A = list(map(int,input().split()))

gcd = []

for i in range(len(A)):
    B = A[i]
    A.pop(i)
    gcd.extend([reduce(math.gcd,A)])
    A.insert(i,B)

print(max(gcd))

Submission status: Runtime Error

Solution code:
A, B, T = int(sys.stdin.readline().strip())
return T // A * B

Submission status: Runtime Error

Solution code:
N = int(input())
# スペース区切りの整数の入力
A = list(map(int, input().split()))
C=list(set(A))

#print(A)
#print(C)
def gcd(a, b):
  while b > 0:
    a, b = b, a%b
  return a

anslist=[]

if len(C)==1:
  ans=C[0]

elif len(C)==2:
  sol=max(A[0],A[1])

else:
  for i in range(3):
    B=A[:]
    B.remove(C[i])
    sol=0
    for b in B:
        sol=gcd(sol,b)
    anslist.append(sol)
    ans=max(anslist)

#print(anslist)
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
# スペース区切りの整数の入力
A = list(map(int, input().split()))


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

ans=[]

for i in range(3):
    B=A[:]
    del B[i]
    sol=0
    for b in B:
        sol=gcd(sol,b)
    ans.append(sol)


print(max(ans))

Submission status: Runtime Error

Solution code:
import math

N = int(input())
A = list(map(int, input().split()))

gcd_l = [0]
gcd_r = [0]

for i in range(N):
    gcd_l.append(math.gcd(gcd_l[i], A[i]))
    gcd_r.append(math.gcd(gcd_r[i], A[-(i+1)]))
gcd_r = gcd_r[::-1]

ans = []
for i in range(N):
    ans.append(math.gcd(gcd_l[i], gcd_r[i+1]))
print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())

V = list(map(int, input().split()))
C = list(map(int, input().split()))

outcome = 0
for v, c in zip(V, C):
  if v > c:
    outcome = outcome + v -c
print(outcome)

Submission status: Runtime Error

Solution code:
a=int(input())
def sei(a):
  v=list(map(int , a.split()))
  return v
buysell=[]
for i in range(2):
  buysell+=[sei(input())]
X=0
for i in range(a):
  if buysell[0][i]>buysell[1][i]:
    X+=buysell[0][i]-buysell[1][i]
print(X)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
G = []

for i in range(N):
    for j in range(N):
        if i == j:
            pass
        else:
            G.append(gcd(A[i], A[j]))
            

print(max(G))

Submission status: Runtime Error

Solution code:
# import math
import fractions
import numpy as np
from itertools import accumulate, chain, islice, starmap
N = int(input())
numbers = list(map(int, input().split()))
# numbers = [2, 4, 8, 8]
# N = len(numbers)


def calculate_maximum_subgcd_with_np_ufunc(numbers):
    gcd = np.frompyfunc(fractions.gcd, 2, 1)
    cumgcds = gcd.accumulate(numbers, dtype=np.object).astype(np.int)
    sub_cumgcds = np.roll(cumgcds, 1)
    sub_cumgcds[0] = 0
    reverse_cumgcds = gcd.accumulate(
        numbers[::-1], dtype=np.object).astype(np.int)
    sub_reverse_cumgcds = np.roll(reverse_cumgcds, 1)
    sub_reverse_cumgcds[0] = 0
    return np.max(gcd(sub_cumgcds, sub_reverse_cumgcds[::-1]))


def calculate_maximum_subgcd_with_func(numbers):
    operation = fractions.gcd
    cumgcds = accumulate(numbers, operation)
    sub_cumgcds = islice(chain([0], cumgcds), len(numbers))
    reverse_cumgcds = accumulate(numbers[::-1], operation)
    sub_reverse_cumgcds = islice(chain([0], reverse_cumgcds), len(numbers))
    sub_gcds = starmap(operation, zip(sub_cumgcds, list(sub_reverse_cumgcds)[::-1]))
    return max(sub_gcds)


calculate_maximum_subgcd = calculate_maximum_subgcd_with_np_ufunc
# calculate_maximum_subgcd = calculate_maximum_subgcd_with_func

print(calculate_maximum_subgcd(numbers))

Submission status: Runtime Error

Solution code:
import fractions
 
N = int(input())
A = list(map(int,input().split()))
L = [0] * N
R = [0] * N

for i in range(1, N):
    L[i] = fractions.gcd(L[i-1], A[i-1])
    R[-i-1] = fractions.gcd(R[-i], A[-i])

ans = [0] * N

for i in range(0, N):
    ans[i] = fractions.gcd(L[i], R[i])

print(max(ans))

Submission status: Runtime Error

Solution code:
count = (T + 0.5) // A
biscuit = B * count
print(biscuit)

Submission status: Runtime Error

Solution code:
s = list(map(int, input().split()))
if(0<=s[0]=<20 and 0<=s[1]=<20 and 0<=s[2]=<20)
	z=round((s[2]+0.5)/s[0])
	w=s[1]*z
	print(w)
    
else:
  print("error")

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))
 
import fractions
from functools import reduce
 
def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
 
score = 0
for i in range(N):
    B = A
    keep = B.pop(0)
    n = gcd_list(B)
    if n > score:
        score = n
    A.append(keep)
 
 
print(score)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))

import fractions
from functools import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

score = 0
for i in range(N):
    B = A
    keep = B.pop(0)
    n = gcd_list(B)
    if n > score:
        score = n
    A.append(keep)


print(score)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))

import fractions
from fractions import reduce

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

score = 0
for i in range(N):
    B = A
    keep = B.pop(0)
    n = gcd_list(B)
    if n > score:
        score = n
    A.append(keep)


print(score)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int,input().split()))

import fraction
from fraction import reduce

def gcd_list(numbers):
    return reduce(functools.gcd, numbers)

score = 0
for i in range(N):
    B = A
    keep = B.pop(0)
    n = gcd_list(B)
    if n > score:
        score = n
    A.append(keep)


print(score)

Submission status: Runtime Error

Solution code:
def main():
    N = int(input())
    A = list(map(int, input().split()))

    if N == 2:
        print(max(A[0]+A[1], (-A[0])+(-A[1])))
        return

    a_sum, a1, a2 = 0, A[0], A[1]
    b_sum, b1, b2 = 0, -A[0], -A[1]

    for i in range(2, N):

        if (a_sum + a1 + a2 + A[i]) > (b_sum + b1 + b2 + A[i]):
            new_a_sum = a_sum + a1
            new_a1 = a2
            new_a2 = A[i]
        else:
            new_a_sum = b_sum + b1
            new_a1 = b2
            new_a2 = A[i]

        if (a_sum + a1 - a2 - A[i]) > (b_sum + b1 - b2 - A[i]):
            new_b_sum = a_sum + a1
            new_b1 = -a2
            new_b2 = -A[i]
        else:
            new_b_sum = b_sum + b1
            new_b1 = -b2
            new_b2 = -A[i]

        a_sum, a1, a2 = new_a_sum, new_a1, new_a2
        b_sum, b1, b2 = new_b_sum, new_b1, new_b2

    print(max(a_sum+a1+a2, b_sum+b1+b2))

main()

Submission status: Runtime Error

Solution code:
l = [int(i) for i in input().split()]
print((l[3] + 0.5) // l[0] * l[1])

Submission status: Runtime Error

Solution code:
###
### atcorder test program
###

### math class
class math:
    ### GCD
    def gcd(self, a, b):
        if b == 0:
            return a
        return self.gcd(b, a%b)

    def gcd_list(self, A):
        if not A:
            return 0
        for i in reversed(range(1, self.gcd(max(A),min(A))+1)):
            count = 0
            for j in A:
                if (j % i) == 0:
                    count += 1
            if count == len(A):
                return i
        return 0

### input num
#i = input()
#A, B, T = [int(x) for x in i.split()]
N = int(input())
A = [int(x) for x in input().split()]
#C = [int(x) for x in input().split()]

### input debug
#print("debug:{}".format(gcd(max(A),min(A))))
#print(list(reversed(range(1, gcd(max(A),min(A))+1))))

mathfunc = math()
anslist = []

for i in range(N):
    Rgcd = mathfunc.gcd_list(A[:i])
    Lgcd = mathfunc.gcd_list(A[i+1:])
    anslist.append(mathfunc.gcd(Rgcd,Lgcd))

### output
print(max(anslist))

Submission status: Runtime Error

Solution code:
n = int(input())
a = list(map(int,input().split()))
b = list(map(abs,a))
c = [a for a in A if a < 0]

if len(c) % 2 == 0:
    print(sum(b))
else:
    print(sum(b)-min(b)*2)

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-

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


n = int(input())

a = (list(map(int, input().split())))

if n==2:
    print(max(a))
    exit()
'''
L = [gcd(a[0], a[1])]
R = [gcd(a[n-2], a[n-1])]
'''
#L = [0 for i in range(n+1)]
#R = [0 for i in range(n+1)]
L = [0]
R = [0]
for i in range(1,n+1):
    L.append(gcd(L[i-1], a[i-1]))

for i in range(n)[::-1]:
    R.append(gcd(R[i+1], a[i]))

#m = [0 for i in range(n)]
m = []
for i in range(n):
    m.append(gcd(L[i], R[i+1]))

print(max(m))

Submission status: Runtime Error

Solution code:
n = int(input())
a = input().split()
mi = abs(int(a[0]))
ans =  0 
count = 0
for i in range(n):
    ans = ans + abs(int(a[i]))
    if mi > abs(int(a[i])):
        mi = abs(int(a[i]))
    if int(a[i])<0:
        count = count + 1
if count%2 ==0:
    print(ans)
else:
    print(ans-2*mi)