Harryxun/stf_run huggingface dataset:
import copy
from collections import Counter

import numpy as np

N, M, X = map(int, input().split())
CA = np.array([list(map(int, input().split())) for _ in range(N)])

cc = np.sum(CA[:, 0])
U = 10**5 * cc +1

dp = np.full([M, 10**5 * M + 1], U, dtype=np.int32)
dp[:, 0] = 0

for ca in CA:
    c = ca[0]
    a = ca[1:]

    for i, v in enumerate(a):
        p_dp = copy.deepcopy(dp)
        np.minimum(dp[i, v:], p_dp[i, :-v] + c, out=dp[i, v:])

p_ans = dp[:, X:]

ans_list = []
for i in range(M):
    ans_list += list(set(p_ans[i]))

C = sorted(Counter(ans_list).items())

for k, v in C:
    if v >= M:
        if k >= U:
            print(-1)
            break
        else:
            print(k)
            break
else:
    print(-1)


### FIXED CODE ###

import itertools

N, M, X = map(int, input().split())
CA = [list(map(int, input().split())) for _ in range(N)]

ans = []

for s in itertools.product(range(2), repeat=N):

    li = [0 for _ in range(M)]
    cum = 0
    for i, v in enumerate(s):
        if v == 1:
            ca = CA[i]
            cum += ca[0]

            for j, x in enumerate(ca[1:]):
                li[j] += x

        q = [p >= X for p in li]
        if all(q):
            ans.append(cum)

print(min(ans) if ans else -1)
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using T = tuple<int, int, int>;

template <typename T>
struct Dijkstra {
  struct Edge {
    int to;
    T cost;
  };
  vector<int> prev;
  vector<vector<Edge>> g;
  Dijkstra(int n) : prev(n, -1), g(n) {}

  void addEdge(int u, int v, T w) {
    g[u].push_back({v, w});
  }
  vector<T> build(int s) {
    vector<T> dist(g.size(), -1);
    using Node = pair<T, int>;
    priority_queue<Node, vector<Node>, greater<Node>> pq;
    pq.push({dist[s] = 0, s});

    while (!pq.empty()) {
      auto d = pq.top().first;
      auto u = pq.top().second;
      pq.pop();
      if (dist[u] < d) continue;
      for (auto&& v : g[u]) {
        if (dist[v.to] < 0 || dist[v.to] > dist[u] + v.cost) {
          dist[v.to] = dist[u] + v.cost;
          prev[v.to] = u;
          pq.push({dist[v.to], v.to});
        }
      }
    }
    return dist;
  }
  vector<int> getPath(int t) {
    vector<int> path;
    for (; t != -1; t = prev[t]) path.push_back(t);
    reverse(begin(path), end(path));
    return path;
  }
};

int main() {
  int n, m;
  cin >> n >> m;
  Dijkstra<ll> g(n);
  for (int i = 0; i < n - 2; i++) {
    g.addEdge(i + 1, i, 0);
  }
  for (int i = 0; i < m; i++) {
    int l, r, c;
    cin >> l >> r >> c, l--, r--;
    g.addEdge(l, r, c);
  }
  auto d = g.build(0);
  cout << ((d[n - 1] >= 0) ? d[n - 1] : -1) << endl;
}


### FIXED CODE ###

#!/usr/bin/env python3
from collections import Counter
MOD = 998244353
n = int(input())
d = list(map(int, input().split()))
if d[0] != 0:
    print(0)
    exit()
c = Counter(d)
if c[0] != 1:
    print(0)
    exit()
ans = 1
for i in range(1, len(c)):
    if c[i] == 0:
        print(0)
        exit()
    ans *= c[i - 1]**c[i]
    ans %= MOD
print(ans)
print(int(input()/3))

### FIXED CODE ###

a = int(input())
print(int(a/3))
n = int(input())
    l = [int(input()) for i in range(n)]
    l = sorted(l)
    print(sum(l) - l[-1]//2)

### FIXED CODE ###

n = int(input())
l = [int(input()) for i in range(n)]
l = sorted(l)
print(sum(l) - l[-1]//2)
x = input()
 
def Combination(x):
  if x[0] == x[1]　and x[2] == x[3]:
      return "Yes"
  elif x[0] == x[2]　and x[1] == x[3]:
      return "Yes"
  elif x[0] == x[3] and x[1] == x[2]:
      return "Yes"
  else:
    return "No"
print(Combination(x))

### FIXED CODE ###

x = input()
 
def Combination(x):
  if x[0] == x[1] and x[2] == x[3] and x[0] != x[2]:
      return "Yes"
  elif x[0] == x[2] and x[1] == x[3] and x[0] != x[1]:
      return "Yes"
  elif x[0] == x[3] and x[1] == x[2] and x[0] != x[2]:
      return "Yes"
  else:
    return "No"
print(Combination(x))
import sys
def input():
    return sys.stdin.readline()[:-1]
inf=float("inf")
h,w,k=map(int,input().split())
s=[input() for i in range(h)]
# print(s)
chk="."*w
li=[]
for i in range(h):
    if s[i]==chk:
        li.append(i)
cnt=1
flag=0
flag2=0
ans=[[0]*w for i in range(h)]
# print(ans)
# ans[2]=ans[1]
# ans[2][0]=1
# print(ans)
for i in range(h):
    flag2=0
    if i in li:
        if flag==0:
            ans[i]=ans[i+1]
        else:
            ans[i]=ans[i-1]
        flag=1
        continue
    for j in range(w):
        if flag2==0 and s[i][j]==".":
            ans[i][j]=cnt
        elif flag2==0 and s[i][j]=="#":
            ans[i][j]=cnt
            flag2=1
            cnt+=1
        elif (flag2==1 or flag2==2) and s[i][j]==".":
            ans[i][j]=ans[i][j-1]
        elif flag2==1 and s[i][j]=="#":
            ans[i][j]=cnt
            cnt+=1
    # cnt+=1
for i in range(h):
    print(" ".join(map(str,ans[i])))

### FIXED CODE ###

import sys
def input():
    return sys.stdin.readline()[:-1]
inf=float("inf")
h,w,k=map(int,input().split())
s=[input() for i in range(h)]
# print(s)
chk="."*w
li=[]
for i in range(h):
    if s[i]==chk:
        li.append(i)
cnt=1
flag=0
flag2=0
ans=[[0]*w for i in range(h)]
# print(ans)
# ans[2]=ans[1]
# ans[2][0]=1
# print(ans)
for i in range(h):
    flag2=0
    # if i in li:
    #     if flag==0:
    #         ans[i]=ans[i+1]
    #         if i+1 not in li:
    #             flag=1
    #     else:
    #         ans[i]=ans[i-1]
    #     continue
    for j in range(w):
        if flag2==0 and s[i][j]==".":
            ans[i][j]=cnt
        elif flag2==0 and s[i][j]=="#":
            ans[i][j]=cnt
            flag2=1
            cnt+=1
        elif (flag2==1 or flag2==2) and s[i][j]==".":
            ans[i][j]=ans[i][j-1]
        elif flag2==1 and s[i][j]=="#":
            ans[i][j]=cnt
            cnt+=1
    # cnt+=1
cnt2=0
last=0
for i in range(h):
    if i in li:
        cnt2+=1
    else:
        flag=1
        for j in range(cnt2):
            print(" ".join(map(str,ans[i])))
        print(" ".join(map(str,ans[i])))
        cnt2=0
        last=i
for i in range(cnt2):
    print(" ".join(map(str,ans[last])))
def resolve():
    s,t = input().split()
    a,b = map(int,input().split())
    u = input()
    print(a-(s==u),b-(t==u))
reoslve()

### FIXED CODE ###

def resolve():
    s,t = input().split()
    a,b = map(int,input().split())
    u = input()
    print(a-(s==u),b-(t==u))
resolve()
import math
a,b = map(int,input().split())
print(int(a * b / math.gcd(a, b)))

### FIXED CODE ###

def gcd(a,b):
    if b == 0:
        return a
    else:
        return gcd(b,a%b)
a,b = map(int,input().split())
print(int(a * b / gcd(a, b)))
a=int(input())
s=input()

if a>=3200:
    input(s)
else:
    input("red")

### FIXED CODE ###

a=int(input())
s=str(input())

if a>=3200:
    print(s)
else:
    print("red")
import math
(_,), a  = [list(map(int, s.split())) for s in open(0)]

def fast_prime_factorize(num):
    prime_factor_sets = [set() for _ in range(num+1)]
    for i in range(2, int(math.sqrt(num)) + 2):
        if len(prime_factor_sets[i]) == 0:
            for j in range(i, num+1, i):
                prime_factor_sets[j].add(i)
    return prime_factor_sets

prime_factor_sets = fast_prime_factorize(max(a))

x = a[0]
y = prime_factor_sets[x]
if len(y) == 0 and x != 1:
    y = {x}
g = y.copy()
l = set()
s = 0
for x in a:
    y = prime_factor_sets[x]
    if len(y) == 0 and x != 1:
        y = {x}
    g &= y
    l |= y
    s += len(y)

if len(g) != 0:
    ans = 'not coprime'
elif len(l) != s:
    ans = 'setwise coprime'
else:
    ans = 'pairwise coprime'
print(ans)

### FIXED CODE ###

import math
(_,), a  = [list(map(int, s.split())) for s in open(0)]

def fast_factorize(num):
    min_factor_list = list(range(num + 1))
    for i in range(int(math.sqrt(num) + 1), 1, -1):
        for j in range(i, num+1, i):
            min_factor_list[j] = i
    return min_factor_list

min_factor_list = fast_factorize(max(a))

prime_factor_sets = []
for x in a:
    prime_factor_set = set()
    while min_factor_list[x] != 1:
        prime_factor_set.add(min_factor_list[x])
        x //= min_factor_list[x]
    prime_factor_sets.append(prime_factor_set)

g = prime_factor_sets[0].copy()
l = prime_factor_sets[0].copy()
s = 0
for x in prime_factor_sets:
    g &= x
    l |= x
    s += len(x)

if len(g) != 0:
    ans = 'not coprime'
elif len(l) != s:
    ans = 'setwise coprime'
else:
    ans = 'pairwise coprime'
print(ans)
a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
a = a1+a2+a3
n = int(input())
b = list(int(input()) for _ in range(n))

for i in b:
    if i in a :
        a[a.index(a)] = "h"

if a[0:3].count("h") == 3 or a[3:6].count("h") == 3 or a[6:9].count("h") == 3:
    print("Yes")
elif a[0] == "h" and a[4] == "h" and a[8] == "h":
    print("Yes")
elif a[2] == "h" and a[4] == "h" and a[6] == "h":
    print("Yes")
elif a[0] == "h" and a[3] == "h" and a[6] == "h":
    print("Yes") 
elif a[1] == "h" and a[4] == "h" and a[7] == "h":
    print("Yes") 
elif a[2] == "h" and a[5] == "h" and a[8] == "h":
    print("Yes") 
else:
    print("No")

### FIXED CODE ###

a1 = list(map(int, input().split()))
a2 = list(map(int, input().split()))
a3 = list(map(int, input().split()))
a = a1+a2+a3
n = int(input())
b = list(int(input()) for _ in range(n))

for i in b:
    if i in a :
        a[a.index(i)] = "h"

if a[0:3].count("h") == 3 or a[3:6].count("h") == 3 or a[6:9].count("h") == 3:
    print("Yes")
elif a[0] == "h" and a[4] == "h" and a[8] == "h":
    print("Yes")
elif a[2] == "h" and a[4] == "h" and a[6] == "h":
    print("Yes")
elif a[0] == "h" and a[3] == "h" and a[6] == "h":
    print("Yes") 
elif a[1] == "h" and a[4] == "h" and a[7] == "h":
    print("Yes") 
elif a[2] == "h" and a[5] == "h" and a[8] == "h":
    print("Yes") 
else:
    print("No")
N = int(input().strip())

n_list = [[] for i in range(N)]
d = [0] * N

for i in range(N-1):
    a, b = map(int, input().strip().split())
    a -= 1
    b -= 1
    n_list[a].append([b,i])
    n_list[b].append([a,i])
    d[a] += 1
    d[b] += 1


#print(n_list)
#print(d)

d_dict = {}
for i in range(N):
    d_dict[i] = d[i]
tmp = sorted(d_dict.items(), key = lambda x:x[1], reverse = True)

colors = [0] * (N)

root = tmp[0][0]

def paint(node, parent_edge_id):
    #print(node, parent_edge_id)
    tmp_color = 1
    for edge in n_list[node]:
        #print("ege:", edge)
        if edge[1] != parent_edge_id:
            #try: 
            if parent_edge_id != -1 and tmp_color == colors[parent_edge_id]:
                tmp_color += 1
            colors[edge[1]] = tmp_color
            #except Exception as e:
                #print(0)
            paint(edge[0], edge[1])
            tmp_color += 1

    

paint(tmp[0][0], -1)
print(tmp[0][1]) # color num 
for i in range(N-1):
    print(colors[i])

### FIXED CODE ###

import sys
N = int(input().strip())

n_list = [[] for i in range(N)]
d = [0] * N

for i in range(N-1):
    a, b = map(int, input().strip().split())
    a -= 1
    b -= 1
    n_list[a].append([b,i])
    n_list[b].append([a,i])
    d[a] += 1
    d[b] += 1


#print(n_list)
#print(d)

d_dict = {}
for i in range(N):
    d_dict[i] = d[i]
tmp = sorted(d_dict.items(), key = lambda x:x[1], reverse = True)

colors = [0] * (N)

root = tmp[0][0]

def paint(node, parent_edge_id):
    #print(node, parent_edge_id)
    tmp_color = 1
    for edge in n_list[node]:
        #print("ege:", edge)
        if edge[1] != parent_edge_id:
            if parent_edge_id != -1 and tmp_color == colors[parent_edge_id]:
                tmp_color += 1
            colors[edge[1]] = tmp_color
            paint(edge[0], edge[1])
            tmp_color += 1

    
sys.setrecursionlimit(10**7)
paint(tmp[0][0], -1)
print(tmp[0][1]) # color num 
for i in range(N-1):
    print(colors[i])
import sys
import numpy as np
from math import ceil
from collections import defaultdict as D
 
def S(): return sys.stdin.readline().rstrip().split(' ')
def Ss(): return list(S())
def I(): return _I(S())
def Is(): return list(I())
def _I(ss): return map(int, ss) if len(ss) > 1 else int(ss[0])
 
N, K = I()
xs = sorted(Is())
print(np.sum(xs[:K]))

### FIXED CODE ###

import sys
import numpy as np
from math import ceil as C, floor as F
from collections import defaultdict as D
from functools import reduce as R

ALP = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
alp = 'abcdefghijklmnopqrstuvwxyz'
def _X(): return sys.stdin.readline().rstrip().split(' ')
def _S(ss): return tuple(ss) if len(ss) > 1 else ss[0]
def S(): return _S(_X())
def _Ss(ss): return list(ss) if isinstance(ss, tuple) else [ss]
def Ss(): return _Ss(S())
def _I(ss): return tuple([int(s) for s in ss]) if isinstance(ss, tuple) else int(ss)
def I(): return _I(S())
def _Is(ss): return list(ss) if isinstance(ss, tuple) else [ss]
def Is(): return _Is(I())

N, K = I()
xs = sorted(Is())
print(np.sum(xs[:K]))
S = input()
l = len(S)

S1 = S[0:(l-1)//2]
S2 = S[(l+3)//2]

def Kaibun(Str):
	return Str == Str[::-1]:

if Kaibun(S) and Kaibun(S1) and Kaibun(S2):
	print("Yes")
else:
	print("No")

### FIXED CODE ###

def f(x):
  return x==x[::-1]
S=input()
n=(len(S)-1)//2
S1,S2=S[:n],S[n+1:]
if f(S) and f(S1) and f(S2):
  print('Yes')
else:
  print('No')
N = int(input())
count = 0
T, X, Y = 0, 0, 0
for i in range(N):
  t, x, y = map(int, input().split())
  if abs(x-X)+abs(y-Y) <= t-T and t % 2 == (x+y) % 2:
    count += 1
  T, X, Y = t, x, y
  
 print('Yes' if count == N else 'No')

### FIXED CODE ###

N = int(input())
count = 0
T, X, Y = 0, 0, 0
for i in range(N):
  t, x, y = map(int, input().split())
  if abs(x-X)+abs(y-Y) <= t-T and t % 2 == (x+y) % 2:
    count += 1
  T, X, Y = t, x, y
  
print('Yes' if count == N else 'No')
A.B.C = map(int,input().split())

print(C-(A-B))

### FIXED CODE ###

A,B,C = map(int,input().split())

if C-(A-B) > 0:
    print(C-(A-B))
else:
    print(0)
import itertools

N=int(input())
S=input

print(len(list(itertools.combinations_with_replacement(S, 3))) 

### FIXED CODE ###

N=int(input())
S=input()
cnt=0
 
for i in range(10):
    a=S.find(str(i))
    if a==-1:
        continue
    for j in range(10):
        b=S.find(str(j),a+1)
        if b==-1:
            continue
        for k in range(10):
            if S.find(str(k),b+1)!=-1:
                cnt+=1
print(cnt)
import math
def gcd(a, b):
	if a < b:
		a, b = b, a
	if b == 0:
		return a
	c = a % b
	return gcd(b, c)

n = int(input())
a = list(map(int,input().split()))
gcds = []

maxt = 0
for i in range(n):
	b = []
	for k in range(n):
		if (i != k):
			b.append(a[k])
	tmp = b[0]

	for bi in b[1::]:
		tmp = math.gcd(tmp,bi)
		
	if maxt < tmp:
		maxt = tmp
 
print (maxt)

### FIXED CODE ###

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


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

l = [0]*(n+2) # l(i) = A1, A2, ..., A(i-1)のgcd
r = [0]*(n+2) # r(i) = Ai, A(i+1), ..., A(n)のgcd

for i in range(n):
	l[i+1] = gcd(l[i],a[i])
for i in reversed(range(n)):
	r[i] = gcd(r[i+1],a[i])

ext = [0] * n
for i in range(n):
	ext[i] = gcd(l[i],r[i+1])

print (max(ext))
n = int(input())
a = list(map(int,input().split()))

import math

def comb(n, r):
    if n <= 1:
        return 0
    else:
        return math.factorial(n) // (math.factorial(n - r) * math.factorial(r))


count = 0
kaisuu = []
sum = 0
kaisuu = [0 for _ in range(n)]
for num in range(1,max(a)+1):
    count = 0
    for i in range(n):
        if a[i] == num:
            count += 1
    #kaisuu.append(count)
    kaisuu[num] = count
    sum += count * (count - 1)/2

#print('kaisuu',kaisuu)

for k in range(n):
    ans = sum - kaisuu[a[k]] + 1
    print(int(ans))

### FIXED CODE ###

import collections
# import time
#start = time.time()



x=int(input())
a=list(map(int,input().split()))
 
c=collections.Counter(a)
#print(c)

num=0
for i in c.values():
    num += i*(i-1)/2
    
for i in range(x):
    print(int(num-c[a[i]]+1))
import sys
input = sys.stdin.readline

L,R = map(int,input().split())
lst = []

if L <= 2019 and R >= 2019:
    print(0)
else:
    for i in range(L,R+1):
        if i % 2019 == 0:
            print(0)
            break
        for j in range(i+1,R+1):
            if j % 2019 == 0:
                print(0)
                break
            lst.append((i * j) % 2019)
        else:
            continue
        break
        print(min(lst))


### FIXED CODE ###

N, A, B = map(int, input().split())
print(min(A*N, B))
C = []
A = input()
for i in A:
    if i == '0':
        C.append(i)
    if i == '1':
        C.append(i)
    if i == 'B' and  len(C)!=0:
        C.pop()

print("".join(C)

### FIXED CODE ###

C = []
A = input()
for i in A:
    if i == '0':
        C.append(i)
    if i == '1':
        C.append(i)
    if i == 'B' and  len(C)!=0:
        C.pop()
    else: pass

print("".join(C))
n = int(input())
s = input()

r = [0] * n
g = [0] * n
b = [0] * n
dc = {'R':[0]*n,'G':[0]*n,'B':[0]*n}
for i in range(n-1):
    dc['R'][i] = dc['R'][i + 1]
    dc['G'][i] = dc['G'][i + 1]
    dc['B'][i] = dc['B'][i + 1]
    dc[s[i]] += 1
# print(r)
# print(g)
# print(b)
dcc = {('R','G'):'B',('R','B'):'G',('B','G'):'R',('G','R'):'B',('B','R'):'G',('G','B'):'R'}
if(n <= 3):print(0)
else:
    c = 0
    for i in range(n):
        for j in range(i+1,n):
            if(s[i] == s[j]):continue
            d = j - i
            c += dc[dcc[(s[i],s[j])]][j]
            k = j + d
            if(k < n):
                if(s[k] == dcc[(s[i],s[j])]):c -= 1
print(c)

### FIXED CODE ###

n = int(input())
s = input()
d = [0,0,0]
for i in s:
    if(i == 'R'):d[0] += 1
    elif(i == 'G'):d[1] += 1
    elif(i == 'B'):d[2] += 1
c = d[0] * d[1] * d[2]

for i in range(n):
    for j in range(i+1,n):
        k = 2 * j - i
        if(k >= n):continue
        if(s[i] == s[j]):continue
        if(s[j] == s[k]):continue
        if(s[i] == s[k]):continue
        c -= 1

print(c)
K = int(input())
    n = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
    print(n[K-1])

### FIXED CODE ###

K = int(input())
n = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]
print(n[K-1])
a, b, c = map(int, input().sprit())

count = 0:
for x in range(a, b + 1)
    if c % x == 0:
    count += 1
    	
print(count)

### FIXED CODE ###

a, b, c = map(int, input().split())

count = 0
for x in range(a, b + 1):
    if c % x == 0:
        count += 1
    	
print(count)
N, M = map(int, input().split())

B = [list(map(int, input().split())) for _ in range(M)][::-1]

S = []
pt = []
G = [None] * (N+1)
C = [0] * (N+1)
idx = 0
cnt = 0
for pair in B:
    d = []
    for i, x in enumerate(pair):
        if not G[x] is None:
            d.append(G[x])

    if len(d) <= 0:
        pt.append(1)
        w = [idx]
        C[idx] += 2
        idx += 1
        for x in pair:
            G[x] = w
    elif len(d) == 1:
        pt.append(C[d[0][0]])
        C[d[0][0]] += 1
        for x in pair:
            if G[x] is None:
                G[x] = d[0]
    else:
        if d[0][0] == d[1][0]:
            pt.append(0)
        else:
            pt.append(C[d[0][0]] * C[d[1][0]])
            C[d[0][0]] += C[d[1][0]]
            d[1][0] = d[0][0]

    print(G)

cnt = 0
for x in pt[::-1]:
    cnt += x
    print(cnt)


### FIXED CODE ###

N, M = map(int, input().split())
B = [list(map(int, input().split())) for _ in range(M)]

pt = []
G = [[None, 1] for x in range(N+1)]

def find(x):
    n = G[x]
    c = []
    while not n[0] is None:
        c.append(n)
        n = n[0]
    for ci in c:
        ci[0] = n
    return n

cnt = 0
while len(B):
    x, y = B.pop()
    wx = find(x)
    wy = find(y)
    if wx is wy:
        pt.append(0)
    else:
        pt.append(wx[1] * wy[1])
        wx[1] += wy[1]
        wy[0] = wx

    #print(G)

cnt = 0
for _ in range(M):
    cnt += pt.pop()
    print(cnt)
N,M,C = map(int, input().split())
B = list(map(int, input().split()))
ans = 0
for i in range(N):
  A = list(map(int, input().split()))
  condition = C
  for j in range(M):
    condition += A[j]*B[j]
  if condition > 0:
    ans += 1
print(ans)

### FIXED CODE ###

H,W = map(int, input().split(" "))
h,w = map(int, input().split(" "))
print((H-h)*(W-w))
import math
a = int(input())
d = a * a * round(math.pi, 6)
r = 2 * a * round(math.pi, 6)
print("{0:.6f} {1:.6f}".format(d, r))

### FIXED CODE ###

import math
a = float(input())
d = a * a * math.pi
r = 2 * a * math.pi
print("{0:.6f} {1:.6f}".format(d, r))
N = int(input())
A = list(map(int,input().split()))
B = [0]*(N)
for i in range(N):
    B[A[i]] = A[i]
print(B)

### FIXED CODE ###

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

B = [0]*N
for i in range(N):
    B[A[i]-1] = i+1

print(' '.join(map(str,B)))
N = int(input())
D = [map(int, input().split()) for i in range(N)]

seq = 0
for i in range(len(D)):
    if D[i][0] == D[i][1]:
        if D[i+1][0] == D[i+1][1]:
            if D[i+2][0] == D[i+2][1]:
                print('Yes')
                exit()

print('No')


### FIXED CODE ###

N = int(input())
D = [list(map(int, input().split())) for i in range(N)]

seq = 0
for i in range(len(D)-2):
    if D[i][0] == D[i][1]:
        if D[i+1][0] == D[i+1][1]:
            if D[i+2][0] == D[i+2][1]:
                print('Yes')
                exit()
print('No')
import itertools

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


base = max(a)
ans = 0
ans_set = []
for x in a:
    if x == base:
        pass
    elif len(list(itertools.combinations(range(base), x))) > ans:
        ans = len(list(itertools.combinations(range(base), x)))
        ans_set = [base, x]
print(*ans_set)

### FIXED CODE ###

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

base = max(a)
tmp = 10**9
tmp_i = 0
for x in a:
    if x == base:
        pass
    elif abs(base - 2*x) < tmp:
        tmp = abs(base - 2*x)
        tmp_i = x

print(base, tmp_i)
n,m=map(int,input().split());a,b=[list(map(int,input().split()))for i in range(n)],[float("INF")]*(n+1);b[1]=0
for i in range(1,n+1):
    for s,t,u in a:
        if b[t]>b[s]-u:
            b[t]=b[s]-u
            if i==n and t==n:print("inf");exit()
print(-b[-1])

### FIXED CODE ###

n,m=map(int,input().split());a,b=[list(map(int,input().split()))for i in range(m)],[float("INF")]*(n+1);b[1]=0
for i in range(1,n+1):
    for s,t,u in a:
        if b[t]>b[s]-u:
            b[t]=b[s]-u
            if i==n and t==n:print("inf");exit()
print(-b[-1])
n, p = map(int, input().split())
a = list(map(int, input().split())

odd = 0
even = 0

for i in a:
    if a %2 ==0:
        even +=1
    else:
        odd+=1
if even == n:
    if p == 0:
        print(2**n)
    else:
        print(0)
else:
    print(2**(n-1))

### FIXED CODE ###

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

odd = 0
even = 0

for i in a:
    if i %2 ==0:
        even +=1
    else:
        odd+=1
if even == n:
    if p == 0:
        print(2**n)
    else:
        print(0)
else:
    print(2**(n-1))
total = 0

for _ in range(int(input()))
	list1 = list(map(int, input().split()))
	for ele in range(0, len(list1)):
		total = total + list1[ele]
	print(total-min(list1))

### FIXED CODE ###

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

a=sorted(a,reverse=True)
if n==2:
    print(max(a))
    exit(0)

ans=a[0]
a=a[1:]
from math import floor

for i in range(n-2):
    index=floor(i/2)
    ans+=a[index]

print(ans)
N = input()
if N in "aiueo"
	print("vowel")
else
	print("consonant")
  

### FIXED CODE ###

N = input()
if N in "aiueo":
	print("vowel")
else:
	print("consonant")
a =  input().split()

if a[1] ==  "+":
    print(int(a[0]) + int(a[2]))
else a[1] == "-":
    print(int(a[0]) - int(a[2]))

### FIXED CODE ###

print(eval(input()))