akhauriyash/Code-Regression huggingface dataset:
import sys
sys.setrecursionlimit(10**8)
def ii(): return int(sys.stdin.readline())
def mi(): return map(int, sys.stdin.readline().split())
def li(): return list(map(int, sys.stdin.readline().split()))
def li2(N): return [list(map(int, sys.stdin.readline().split())) for i in range(N)]
def dp2(ini, i, j): return [[ini]*i for i2 in range(j)]
#import bisect #bisect.bisect_left(B, a)
#from collections import defaultdict #d = defaultdict(int) d[key] += value
#from collections import Counter # a = Counter(A).most_common()
#from itertools import accumulate #list(accumulate(A))

S = input()
T = input()
cnt = 0
for i in range(len(S)):
    if S[i] != T[i]:
        cnt += 1

print(cnt)

Measured memory_bytes: 9388
#include <iostream>
#include <string>
#include <vector>
#include <algorithm> 
#include <utility> 
#include <tuple> 
#include <cstdint> 
#include <cstdio> 
#include <map> 
#include <queue> 
#include <set> 
#include <stack> 
#include <deque> 
#include <unordered_map> 
#include <unordered_set> 
#include <bitset> 
#include <cctype> 
#include <cmath>
#include <iomanip>
#include <ctype.h>

using namespace std;
using ll = long long;
using PAIR = pair<int, int>;
using PAIRLL = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;

#define TR ","
#define rep(i,N) for(ll i=0;i<(ll)N;++i)
#define repe(i,a,b) for(ll i=a;i<(ll)b;++i)
#define all(v) v.begin(), v.end()
#define IO ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define INF 100000000

ll gcd(ll a, ll b) {
    if (a < b) swap(a, b);
    if (b == 0) return a;
    return gcd(b, a % b);
}

ll lcm(ll x, ll y) {
    return x / gcd(x, y) * y;
}

ll waz = 76543217;

ll inv(ll x) {
    if (x == 1) { return 1; }
    if (x == 0) { return 0; }
    else {
        ll a = (waz - inv(waz % x) * (waz / x)) % waz;
        if (a >= 0) { return a; }
        else { return waz + a; }
    }
}

void printVector(const vector<int>& vec) {
    for (int value : vec) {
        cout << value << " ";
    }
    cout << endl;
}

vector<ll> p;

ll phi(ll x) {
    ll a = x;
    ll b = x;
    for (ll k = 0; k != p.size(); ++k) {
        if (a % p[k] == 0) {
            while (a % p[k] == 0) {
                a /= p[k];
            }
            b = b / p[k] * (p[k] - 1);
        }
        if (a == 1) { break; }
    }
    return b;
}

bool my_compare(pair<string, int> a, pair<string, int> b) {
    if (a.first != b.first) {
        return a.first < b.first;
    }

    if (a.second != b.second) {
        return a.second > b.second;
    }
    else {
        return true;
    }
}

int main()
{
    IO;

    ll N, K; cin >> N >> K;

    if (N >= K / 2) {
        if (K % 2 != 0) {
            ll a = N / K;
            cout << (ll)pow(a,3) << endl;
        }
        else {
            ll a = N / K;
            ll b = max((N - K / 2) / K + 1, (ll)0);
            cout << (ll)pow(a,3) + (ll)pow(b,3) << endl;
        }
    }
    else {
        cout << 0 << endl;
    }

}

Measured memory_bytes: 3592
#include <iostream>
#include <cstring>
using namespace std;
int main () {

  string number;
  int sum;

  while(1){

    sum = 0;

    cin >> number;

    if( number[0] - '0' == 0 ) break;

    for(int i=0; i < number.size() ; i++){
    
      sum=sum+number[i] - '0';

    }
  
    cout << sum <<"\n";
      }
  return 0;
}

Measured memory_bytes: 1184
#define ll long long
#define INF 99999999
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#include<bits/stdc++.h>
using namespace std;
int main (){
    int n,k,f;
    cin>> n >> k;
    int d[n] = {0};
    int keep;
    int g;
    int ans = 0;
    for (int i = 0; i < k; i++)
    {
        cin >> f;
        for(keep=0;keep<f;keep++){
            cin >> g;
            d[g-1] = 1;
        }
    }
    rep(i,n){
        if(d[i] != 1){
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3636
#include <iostream>
#include <algorithm>
#include <vector>
#include <array>
#include <string>
#include <queue>
#include <cmath>

using namespace std;
using lli = long long int;

int main(void){
    char a,b;
    cin >> a >> b;
    if(a > b){
        cout << ">" << endl;
    }else if(a == b){
        cout << "=" << endl;
    }else{
        cout << "<" << endl;
    }
    cout << endl;
}


Measured memory_bytes: 256
/**Bismillahir Rahmanir Raheem
    Author:Refatul Fahad**/

#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define ull unsigned long long
#define ff first
#define ss second
#define pb push_back
#define vi vector<int>
#define pii pair<int,int>
#define pil pair<int,ll>
const int N = 1e5 + 5;
const ll M = (ll)1e9 + 7;
const double pi=2*acos(0.0);
const double esp=1e-9;
int Set(int N,int pos) {
    return N=N | (1<<pos);
}
int reset(int N,int pos) {
    return N= N & ~(1<<pos);
}
bool check(int N,int pos) {
    return (bool)(N & (1<<pos));
}

int dx[]= {0,0,1,-1};
int dy[]= {1,-1,0,0};

vi adj[2*N];
bool vis[N];
int cnt=0,dis[N];
void bfs(int node){
   queue<int>q;
   q.push(node);
   vis[node]=true;
   dis[1]=0;
   while(!q.empty()){
      int n=q.front();
      q.pop();
      for(int x:adj[n]){
        if(!vis[x]){
            q.push(x);
            vis[x]=true;
            dis[x]=n;
            cnt++;
        }
      }
   }
}
int main() {

    ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
    /// freopen("input.txt","r",stdin);
    /// freopen("output.txt","w",stdout);

    int test=1;
    //cin>>test;
    for(int cs=1; cs<=test; ++cs) {
       int n,m;
       cin>>n>>m;
       for(int i=1;i<=m;++i){
        int x,y;
        cin>>x>>y;
        adj[x].pb(y);
        adj[y].pb(x);
       }
       bfs(1);

       if(cnt<n-1){
        cout<<"No"<<endl;
       }
       else{
        cout<<"Yes"<<endl;
        for(int i=2;i<=n;++i){
            cout<<dis[i]<<endl;
        }
       }
    }
    return 0;
}



Measured memory_bytes: 12860
#include <bits/stdc++.h>
using namespace std;

//type
#define ll long long
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007    //10^9+7:合同式の法
#define MAXR 100000       //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first      //pairの一つ目の要素
#define S second     //pairの二つ目の要素
#define Z class
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (int i = 0; i < (n); i++)
#define repd(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= (b); i++)
#define FORD(i, a, b) for (ll i = a; i >= (b); i--)
#define FORA(i, I) for (const auto &i : I)

// vector
#define ALL(x) x.begin(), x.end()

// output
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
  cout << a;
  ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
  cout << a << ' ';
}

int ans = 0;
bool check = 0;
string s, t;
int N = 3;
vector<int> v(N);
int a, b;
int x, y;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

int main()
{
  cin>> a ;
  if(a%2==0)pr(a/2);
  else pr(a/2+1);
}

Measured memory_bytes: 3636
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>

int main()
{
    long l,r,c,min=2019,tmp;
    long i,j;

    scanf("%ld %ld",&l,&r);
    
    for(i=l;i<r;i++){
            for(j=i+1;j<=r;j++){
                tmp = (i * j) % 2019;
            if(min > tmp){
                min = tmp;
            }
            if(min == 0)
            {
                break;
            }
        }

        if(min == 0)
        {
            break;
        }
    }
    
    printf("%ld\n",min);
    

    return 0;
}

Measured memory_bytes: 128
def main():
  n = int(input())

  arr = sorted(map(int, input().split()), reverse=True)

  ans = arr[0]
  n -= 2

  F = [arr[0], arr[0]]
  i = 1
  while n >= 0:
    if n <= 1:
      ans += n * arr[i]
      break

    ans += 2 * arr[i]
    i += 1
    n -= 2

  print(ans)


main()


Measured memory_bytes: 31524
from sys import stdin
 
A, B, N = [int(x) for x in stdin.readline().rstrip().split()]
 
ans1 = ((A*N)//B)-A*int(N/B)
 
if B-1<=N:
	ans2 = (A*(B-1))//B
else:
  	ans2=0
 
print(max(ans1,ans2))

Measured memory_bytes: 9160
#include <bits/stdc++.h>
#define rep(i, a, n) for(int i = a; i < n; i++)
#define repr(i, a, b) for(int i = a; i >= b; i--)
#define int long long
#define all(a) a.begin(), a.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef pair<int, int> P;
const int mod = 1000000007;
const int INF = 1e18;

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    string s;
    cin >> s;
    int ans = 0;
    int now = 0;
    rep(i, 0, s.size()){
        if(s[i] == 'W'){
            ans += i - now;
            now++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 720
import sys
N = int(sys.stdin.readline().rstrip())
a = [int(x) for x in sys.stdin.readline().rstrip().split(' ')]
d = [abs(sum(a)/float(N) - ai) for ai in a]

if len(set(d))==1:
  print(0)
else:
  print(d.index(min(d)))

Measured memory_bytes: 2568
#include<iostream>
#include<string>

using namespace std;

int main() {
	string str_a, str_b;
	int a, b;
	while (getline(cin, str_a)) {
		getline(cin, str_b);
		int hit = 0, blow = 0;
		for (int i = 0; i < str_a.length(); i++) {
			if ('1' <= str_a[i] && str_a[i] <= '9') {
				a = str_a.find(str_a[i]);
				b = str_b.find(str_a[i]);
				if (a != -1 && b != -1) {
					if (a == b) {
						hit += 1;
					}
					else {
						blow += 1;
					}
				}
			}
		}
		cout << hit << " " << blow << endl;

	}
	return 0;
}


Measured memory_bytes: 3004
#include <stdio.h>
#include <stdlib.h>

#define MAX_N 200001

void dfs(int node, int parent, int *tree[], int child_num[], int node_num[]){
  int i,child;

  for(i=0;i<child_num[node];i++){
    child=tree[node][i];
    if(child!=parent){
      node_num[child]+=node_num[node];
      dfs(child,node,tree,child_num,node_num);
    }
  }
}

void input_node(int a, int b, int *tree[], int tree_size[], int child_num[]){
  if(tree_size[a]==0){
    tree[a]=(int *)malloc(sizeof(int));
    tree_size[a]=1;
  }else if(child_num[a]==tree_size[a]){
    tree[a]=(int *)realloc(tree[a],sizeof(int)*tree_size[a]*2);
    tree_size[a]*=2;
  }
  tree[a][child_num[a]++]=b;
}

int main(void){
  int i,j;

  int n,q;
  scanf("%d%d",&n,&q);

  int *tree[MAX_N];
  int tree_size[MAX_N]={};
  int child_num[MAX_N]={};

  int a,b;
  for(i=0;i<n-1;i++){
    scanf("%d%d",&a,&b);
    input_node(a, b, tree, tree_size, child_num);
    input_node(b, a, tree, tree_size, child_num);
  }

  int p,x;
  int node_num[MAX_N]={};
  for(i=0;i<q;i++){
    scanf("%d%d",&p,&x);
    node_num[p]+=x;
  }

  dfs(1,0,tree,child_num,node_num);

  for(i=1;i<=n;i++){
    printf("%d ",node_num[i]);
  }
  printf("\n");

  return 0;
}


Measured memory_bytes: 31232
#include "bits/stdc++.h"
using namespace std;

const int N=1e2+20;

int n,a[N],ans=INT_MAX;

int main()
{
	cin>>n;
	for(int i=0;i<n;i++) cin>>a[i];

	for(int i=1;i<N;i++)
	{
		int t=0;
		for(int j=0;j<n;j++) t+=(a[j]-i)*(a[j]-i);
		ans=min(ans,t);
	}
	cout<<ans;
}

Measured memory_bytes: 256
//https://onlinejudge.u-aizu.ac.jp/challenges/sources/JOI/Prelim/0631?year=2017

#include <bits/stdc++.h>

using namespace std;

int main() {
    int n, m;
    cin >> n >> m;

    vector<int> vt;
    for (int i = 0; i < m; ++i) {
        int a, b;
        cin >> a >> b;
        vt.emplace_back(max(n - a, 0));
    }

    sort(vt.begin(), vt.end());
    cout << accumulate(vt.begin(), vt.begin() + m - 1, 0) << endl;
    return 0;
}

/*
 * カードが全部でm枚あるうちのm-1枚を「当たり」にしたい。
 * 1枚は無視してよい。
 *
 */


Measured memory_bytes: 3104
fun main(args:Array<String>):Unit {
    val (h, y) = readLine()!!.trim().split(' ').map(String::toInt)
    println(
            if (h == 0) yTow(y)
            else wToy(h, y)
    )
}
fun yTow(year:Int):String {
    return when{
        year <= 1911 -> "M" + "${year - 1867}"
        year <= 1925 -> "T" + "${year - 1911}"
        year <= 1988 -> "S" + "${year - 1925}"
        else -> "H" + "${year - 1988}"
    }
}
fun wToy(h:Int, year:Int):Int {
    return when(h){
        1 -> year + 1867
        2 -> year + 1911
        3 -> year + 1925
        else -> year + 1988
    }
}


Measured memory_bytes: 34144
from collections import Counter,defaultdict,deque
import sys,bisect,math,itertools,string,queue
from heapq import heappop, heappush
sys.setrecursionlimit(10**8)
mod = 10**9+7
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))
def inpl_str(): return list(sys.stdin.readline().split())
def inpln(n): return list(int(sys.stdin.readline()) for i in range(n))


n = inp()
s = input()
acc = [0] * n
L = ''
for i in range(n):
    if i == 0:
        if s[i] == '(':
            acc[i] = 1
        else:
            acc[i] = -1
    else:
        if s[i] == '(':
            acc[i] = acc[i-1] + 1
        else:
            acc[i] = acc[i-1] - 1
x = min(acc)
if x < 0:
    L += '(' * abs(x) + s + ')' * (acc[-1] - x)
else:
    L += s + ')' * acc[-1]
print(L)

Measured memory_bytes: 38636
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

int main() {
    int N;
    cin >> N;

    vector<int> X(N);
    for (int i = 0; i < N; i++) {
        cin >> X[i];
    }

    int output = INT_MAX;
    for (int i = 1; i <= 100; i++) {
        int tmp = 0;
        for (int j = 0; j < N; j++) {
            tmp += pow(i - X[j], 2);
        }
        if (tmp < output) {
            output = tmp;
        }
    }

    cout << output << endl;

    return 0;
}


Measured memory_bytes: 3608
/* 
	بسم الله الرحمن الرحیم
	
	(; طلا یک جهانی
*/

#include <bits/stdc++.h>
using namespace std;

const int MAX_N = 100 * 1000 + 5;
int n, s[MAX_N];
bool mark[MAX_N];

void read_input() {
	cin >> n;
	for (int i = 0; i < n; i++)
		cin >> s[i];
}

void solve() {
	long long ans = 0;
	for (int i = 1; i < n; i++) {
		long long sum = 0;
		for (int j = 0; j < (n - 1) / i && !mark[i * j] && !mark[n - 1 - i * j] && i * j != n - 1 - i * j; j++) {
			sum += s[i * j] + s[n - 1 - i * j];
			mark[i * j] = mark[n - 1 - i * j] = true;
			ans = max(ans, sum);
		}
		for (int j = 0; j < (n - 1) / i; j++)
			mark[i * j] = mark[n - 1 - i * j] = false;
	}
	cout << ans;
}

int main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	read_input();
	solve();
}


Measured memory_bytes: 768
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions
from decimal import Decimal
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n,x,y = inpl()
res = 0
for i in range(1,n+1):
    cnt = 0
    for xx in list(str(i)):
        cnt += int(xx)
    if x <= cnt <= y:
        res += i
print(res)

Measured memory_bytes: 66664
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;


public class Main {
	
	public static void main(String[] args) {
		HashMap<String, Integer> map = new HashMap<String, Integer>();
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		//Scanner in2 = new Scanner(System.in);
        in.nextLine();
		for(int i=0; i<n; i++) {
			String s = in.nextLine();
			if (map.containsKey(s)) {
				map.put(s, map.get(s)+1);
			}else {
				map.put(s, 1);
			}	
		}
		ArrayList<Map.Entry<String,Integer>> list = new ArrayList<Map.Entry<String,Integer>>(map.entrySet());
		Collections.sort(list,new Comparator<Map.Entry<String,Integer>>() {
	            public int compare(Entry<String, Integer> o1,
	                    Entry<String, Integer> o2) {
	            	if(o2.getValue().equals(o1.getValue())){
	            		return o1.getKey().compareTo(o2.getKey());
	            	}else return o2.getValue().compareTo(o1.getValue());
	            }
	            
	    });
		int max = list.get(0).getValue();
		//System.out.println("\nmax:" + max);
		for(Map.Entry<String,Integer> mapping:list) {
			//System.out.println(mapping.getKey()+":"+mapping.getValue()); 
			if(mapping.getValue()==max) System.out.println(mapping.getKey());
		}
		
	}
}


Measured memory_bytes: 180156
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
const int mod = 1e9 + 7;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N;
    cin >> N;
    for (int i = 0; i < N; i++) {
        int A;
        cin >> A;
        if (A % 2 == 0 && A % 3 != 0 && A % 5 != 0) {
            cout << "DENIED" << endl;
            return 0;
        }
    }
    cout << "APPROVED" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

using ll = long long;

const int N = 105;
const ll inf = ll(1e18);

int n, m, v[N], l[N], x, y;
vector<int> e[N];
ll r = inf;

int g(int x, int p){
    int r = 1;
    for(int i : e[x]) if(i != p) r = max(r, g(i, x) + 1);
    return r;
}

void h(int x, int p, int d){
    l[d] = max(l[d], int(e[x].size()) - (!!p));
    for(int i : e[x]) if(i != p) h(i, x, d + 1);
}

ll f(int x, int y){
    ll t = 1 + (!!y);
    h(x, y, 0);
    if(y) h(y, x, 0);
    for(int i = 0; l[i]; i++){
        t *= l[i];
        l[i] = 0;
    }
    return t;
}

int main(){
    scanf("%d", &n);
    for(int i = 0, x, y; i < n - 1; i++){
        scanf("%d%d", &x, &y);
        e[x].push_back(y);
        e[y].push_back(x);
    }
    m = n;
    for(int i = 1; i <= n; i++) m = min(m, v[i] = g(i, 0));
    for(int i = 1; i <= n; i++){
        if(v[i] == m){
            if(x) y = i;
            else x = i;
        }
    }
    if(!y){
        r = min(r, f(x, 0));
        for(int i : e[x]) r = min(r, f(x, i));
    }
    else r = min(r, f(x, y));
    printf("%d %lld\n", m - (!!y), r);
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
typedef long long ll;
typedef pair<int,int> pint;
typedef pair<ll,int> pli;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

int main(){
  ll x,y;
  cin >> x >> y;
  if(x%y==0){
    cout << -1 << endl;
    return 0;
  }
  cout << x << endl;
return 0;}

Measured memory_bytes: 256
times, disp_rate = map(int, input().split())

int_rate = 0

# 参加回数が10回未満の場合
if times < 10:
    # 内部レートを計算する
    int_rate = disp_rate + 100 * (10-times)
else:
    int_rate = disp_rate

print(int_rate)

Measured memory_bytes: 2940
import sys
import numpy as np
from math import ceil as C, floor as F, sqrt
from collections import defaultdict as D, Counter as CNT
from functools import reduce as R
import heapq as HQ

class Heap:
  def __init__(self, data, reverse=False):
    self.reverse = -1 if reverse else 1
    self.data = [self.reverse * d for d in data]
    HQ.heapify(self.data)
  def push(self, x): return HQ.heappush(self.data, self.reverse * x)
  def pop(self): return self.reverse * HQ.heappop(self.data)

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(): return list(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 = I()
xs = Is()

ans = 0
now = xs[0]
for x in xs[1:]:
    if x < now:
        ans += (now - x)
    now = max(x, now)

print(ans)

Measured memory_bytes: 51492
n = int(input())
ans = 0
for i in range(1,n+1):
    if i % 2 == 0:
        continue
    count = 0
    for j in range (1,i+1):
        if i % j == 0:
            count += 1
    if count == 8:
        ans += 1
print(ans)

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;

using ll = long long;
using pii = pair<ll, ll>;
using vi = vector<ll>;
using vvi = vector<vi>;

template <class T>
using max_heap = priority_queue<T>;
template <class T>
using min_heap = priority_queue<T, vector<T>, greater<T>>;

template <class T, class U>
void chmax(T &a, U b) {
    if (a < b) a = b;
}
template <class T, class U>
void chmin(T &a, U b) {
    if (b < a) a = b;
}

#define rep(i, j) for (int i = 0; i < j; i++)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define debug(x) cerr << #x << ": " << x << endl;
#define int ll

const ll mod = 1e9 + 7;
const ll inf = (1LL << 50);

void solve(long long N, long long R) {
    cout << R + 100 * max(0LL, 10 - N) << endl;
}

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);
    cout << fixed;

    long long N;
    scanf("%lld", &N);
    long long R;
    scanf("%lld", &R);
    solve(N, R);
    return 0;
}


Measured memory_bytes: 256
import java.util.*;
import java.io.*;

public class Main {	

	private static void solve(){
		//Implement solution here.
		int R = ni();
		System.out.println((double)R * 2 * Math.PI);
	}
	
	//Switch input source (stdin/file)
	private static BufferedReader br;
	public static void main(String[] args){
		br = new BufferedReader(new InputStreamReader(System.in));
		String debugDataPath = System.getenv("DD_PATH");        
		if(debugDataPath != null){
			try{
				br = new BufferedReader(new InputStreamReader(new FileInputStream(new File(debugDataPath))));
			}catch(Exception e){
				throw new RuntimeException(e);
			}
		}
		boolean hasNext = true;
		while(hasNext){
			solve();	
			try{
				br.mark(1);
				if(br.read() > 0){
					br.reset();			
					System.out.println("---");
				} else {
					hasNext = false;
				}
			}catch(Exception e){
				throw new RuntimeException(e);
			} 
		}
	}

	//Input read utility
	private static StringTokenizer tokenizer = null;
	public static String next() {
		while (tokenizer == null || !tokenizer.hasMoreTokens()) {
			try {
				tokenizer = new StringTokenizer(br.readLine());
			} catch (Exception e) {
				throw new RuntimeException(e);
			}
		}
		return tokenizer.nextToken();
	}
	//Get next single int
	private static int ni() {
		return Integer.parseInt(next());
	}
	//Get next single long
	private static long nl() {
		return Long.parseLong(next());
	}
	//Get next single double
	private static double nd() {
		return Double.parseDouble(next());
	}
	//Get next int array from one line
	private static int[] na(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)
			a[i] = ni();
		return a;
	}
	//Get next char array from one line
	private static char[] ns() {
		return next().toCharArray();
	}
	//Get next long array from one line
	private static long[] nal(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)
			a[i] = nl();
		return a;
	}
}

Measured memory_bytes: 25540
#include<bits/stdc++.h>
using namespace std;
 
#define REP(i, n) for(int i = 0; i < n; i++)
#define FOR(i, a, b) for(int i = a; i <= b; i++)
#define ST first
#define ND second
 
ostream& operator<<(ostream &out, string str) {
	for(char c : str) out << c;
	return out;
}
 
template<class L, class R> ostream& operator<<(ostream &out, pair<L, R> p) {
	return out << "(" << p.ST << ", " << p.ND << ")";
}

template<class T> auto operator<<(ostream &out, T &&x) -> decltype(x.begin(), out) {
	out << '{';
	for(auto &e : x)
        	out << e << (&e == &*--x.end() ? "" : ", ");
	return out << '}';
}

template<class... Args> void dump(Args&&... args) {
	((cerr << args << ";  "), ...);
}
 
#ifdef DEBUG
#  define debug(x...) cerr << "[" #x "]: ", dump(x), cerr << "\n"
#else
#  define debug(...) false
#endif
 
template<class T> int size(T && a) { return (int) a.size(); }
 
using LL = long long;
using PII = pair<int, int>;

int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);

	int n, k;
	cin >> n >> k;
	vector<int> a(n);
	REP(i, n) cin >> a[i];

	REP(j, k) {
		bool end = true;
		REP(i, n) end &= (a[i] == n);
		if(end) break;

		vector<int> pref(n + 1);
		REP(i, n) {
			pref[max(0, i - a[i])]++;
			pref[min(n - 1, i + a[i]) + 1]--;
		}

		FOR(i, 1, n) pref[i] += pref[i - 1];
		REP(i, n) a[i] = pref[i];
	}

	REP(i, n) cout << a[i] << " ";
	cout << "\n";
}


Measured memory_bytes: 4928
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <list>
#include <ctime>
#include <sstream>
#include <queue>
#include <stack>
#include <random>
#include <bitset>
#include <numeric>
#include <cassert>
using namespace std;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;
#define rep(x, b, e) for(int x=(b); x<(e); ++x)
#define ford(x, b, e) for(int x=((int)(b))-1; x>=(e); --x)
#define all(c) c.begin(),c.end()
#define sz(x) ((int)((x).size()))
#define pb push_back
#define st first
#define nd second
#define mp(x,y) make_pair(x,y)
typedef short int sint;

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it) {
	*this << ((it != d.b) ? ", " : "") << *it;
  }
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

int main() {
	ios_base::sync_with_stdio(false);
	char c;
	cin >> c;
	if (c >= 'a') {
		cout << 'a' << endl;
	} else {
		cout << 'A' << endl;
	}
	
}

Measured memory_bytes: 3664
#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c,k,sum=0;
    cin>>a>>b>>c>>k;
    while(k>0){
        if(a>=k && k>0)
        {
            sum+=k;
            break;
        }
        else if(a<k && k>0)
        {
            sum+=a;
            k-=a;
        }
        if(b>=k && k>0){
            break;
        }
        else if(b<k && k>0){
            k-=b;
        }
        if(c>=k && k>0){
            sum-=k;
            break;
        }
        else if(c<k && k>0){
            sum-=c;
            break;

        }
    }
    cout<<sum<<endl;
}

Measured memory_bytes: 3596
def func(a, n, x, a0)
    res=x
    sum=a0
    (1...n).each do |i|
        t=sum+a[i]
        if t==0 || (sum>0)==(t>0)
            t=sum>0 ? -1 :1
            res+=(t-sum-a[i]).abs
        end
        sum=t
    end
    res
end

n, *a=`dd`.split.map &:to_i
if a[0]==0
    puts [func(a, n, 1, 1), func(a, n, 1, -1)].min
else
    puts [func(a, n, 0, a[0]), func(a, n, (a[0]).abs+1, a[0]>0 ? -1 : 1)].min
end

Measured memory_bytes: 9356
#include<bits/stdc++.h>
using namespace std;

int main(){
    string s;
    cin>>s;
    if(s[0]=='A'&&s[1]=='A'&&s[2]=='A'||s[0]=='B'&&s[1]=='B'&&s[2]=='B'){
    cout<<"No"<<endl;
    return 0;
    }else{
    cout<<"Yes"<<endl;
    return 0;
    }
    }

Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<math.h>
#include<stdlib.h>
#include<algorithm>
using namespace std;


const int END_OF_INPUT = 0;


bool check_prime(int s){
	if (s == 2) return true;
	for(int i = 2; i <= ((int)sqrt(s)+1); ++i){
		if (s % i == 0){
			return false;
		}
	}
	return true;
}

int main() {
	int input_num, num_of_primes;
	
	while (cin >> input_num && input_num != END_OF_INPUT){
		num_of_primes = 0;
		for (int i = input_num + 1; i <= input_num * 2; ++i){
			num_of_primes = check_prime(i) ? num_of_primes + 1: num_of_primes;
		}
		cout << num_of_primes << endl;
	}


}

Measured memory_bytes: 1160
#include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;
int main(void) 
{
	int a, b;
	double S;
	cin >> a >> b;
	S = a * b / 3.305785;
	cout << fixed << setprecision(6) << S << endl;
	return 0;
}


Measured memory_bytes: 3268
#include <bits/stdc++.h>
#define int long long
using namespace std;

map<int,int> mp;

inline int dfs(int lvl){
	if(mp[lvl]) return mp[lvl];
	if(lvl==1ll){
		mp[lvl]=1ll;
		return mp[lvl];
	}
	mp[lvl]=1ll+dfs(lvl/2ll)*2ll;
	return mp[lvl];
}

signed main()
{
	ios::sync_with_stdio(false);
	int h;
	cin>>h;
	cout<<dfs(h)<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define x first
#define y second
#define mp make_pair
#define pb push_back
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int sz=1e5+9;
int n;
pii a[sz];
int k;
int cnt[sz];
int ans[sz];
vector<int> v[sz],m[sz];

void dfs(int idx,int cant=0,int par=0){
	int color=1;
	if(cant==color) color++;
	for(int i=0;i<v[idx].size();i++){
		int u=v[idx][i];
		if(u==par) continue;
		ans[m[idx][i]]=color;
		dfs(u,color,idx);
		color++;
		if(cant==color) color++;
	}
}

int main(){
	scanf("%d",&n);
	for(int i=0;i<n-1;i++){
		scanf("%d %d",&a[i].x,&a[i].y);
		cnt[a[i].x]++;
		cnt[a[i].y]++;
		v[a[i].x].pb(a[i].y);
		v[a[i].y].pb(a[i].x);
		m[a[i].x].pb(i);
		m[a[i].y].pb(i);
		k=max(k,cnt[a[i].x]);
		k=max(k,cnt[a[i].y]);	
	}    
	dfs(1);
	printf("%d\n",k);
	for(int i=0;i<n-1;i++) printf("%d\n",ans[i]);
    return 0;
}


Measured memory_bytes: 14720
#include <bits/stdc++.h>
using namespace std;

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int N;
    cin >> N;
    int T[N];
    for (int i = 0; i < N; ++i) cin >> T[i];

    int M;
    cin >> M;
    int tmp[N];
    int res[M] = {0};

    for (int m = 0; m < M; ++m){
        
        int P, X;
        cin >> P >> X;
        for(int i = 0; i < N; ++i) tmp[i] = T[i];

        tmp[P - 1] = X;

        for(int i = 0; i < N; ++i) res[m] += tmp[i];
    }

    for(int i = 0; i < M; ++i) cout << res[i] << endl;

}

Measured memory_bytes: 256
N = int(input())
trans = []
for i in range(5):
  trans.append(int(input()))
count = 5
yusou_min = min(trans)

if N % trans[0] == 0:
  count += (N // yusou_min - 1)
else:
  count += (N // yusou_min)
  
print(count)

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define int long long 
#define sz(x) (int)(x.size())
#define pii pair<int, int>
#define se second
#define fi first

struct FlowEdge {
    int v, u;
    int cap, flow = 0;
    FlowEdge(int v, int u, int cap) : v(v), u(u), cap(cap) {}
};

struct Dinic {
    const int flow_inf = 1e18;
    vector<FlowEdge> edges;
    vector<vector<int>> adj;
    int n, m = 0;
    int s, t;
    vector<int> level, ptr;
    queue<int> q;

    Dinic(int n, int s, int t) : n(n), s(s), t(t) {
        adj.resize(n);
        level.resize(n);
        ptr.resize(n);
    }

    void add_edge(int v, int u, int cap) {
        edges.emplace_back(v, u, cap);
        edges.emplace_back(u, v, 0);
        adj[v].push_back(m);
        adj[u].push_back(m + 1);
        m += 2;
    }

    bool bfs() {
        while (!q.empty()) {
            int v = q.front();
            q.pop();
            for (int id : adj[v]) {
                if (edges[id].cap - edges[id].flow < 1)
                    continue;
                if (level[edges[id].u] != -1)
                    continue;
                level[edges[id].u] = level[v] + 1;
                q.push(edges[id].u);
            }
        }
        return level[t] != -1;
    }

    int dfs(int v, int pushed) {
        if (pushed == 0)
            return 0;
        if (v == t)
            return pushed;
        for (int& cid = ptr[v]; cid < (int)adj[v].size(); cid++) {
            int id = adj[v][cid];
            int u = edges[id].u;
            if (level[v] + 1 != level[u] || edges[id].cap - edges[id].flow < 1)
                continue;
            int tr = dfs(u, min(pushed, edges[id].cap - edges[id].flow));
            if (tr == 0)
                continue;
            edges[id].flow += tr;
            edges[id ^ 1].flow -= tr;
            return tr;
        }
        return 0;
    }

    int flow() {
        int f = 0;
        while (true) {
            fill(level.begin(), level.end(), -1);
            level[s] = 0;
            q.push(s);
            if (!bfs())
                break;
            fill(ptr.begin(), ptr.end(), 0);
            while (int pushed = dfs(s, flow_inf)) {
                f += pushed;
            }
        }
        return f;
    }
};


signed main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
    int n;
    cin >> n;
    pii a[n + 1], b[n + 1];
    for (int i = 1; i <= n; i++) {
        cin >> a[i].fi >> a[i].se;
    }
    for (int i = 1; i <= n; i++) {
        cin >> b[i].fi >> b[i].se;
    }
    Dinic dnc(2 * n + 2, 0, 2 * n + 1);
    for (int i = 1; i <= n; i++) {
        dnc.add_edge(0, i, 1);
        dnc.add_edge(n + i, 2 * n + 1, 1);
        for (int j = 1; j <= n; j++) {
            if (a[i].fi < b[j].fi && a[i].se < b[j].se) {
                dnc.add_edge(i, j + n, 1);
            }
        }
    }
    cout << dnc.flow() << "\n";
}

Measured memory_bytes: 640
import math
n = int(input())
p = list(map(int, input().split()))
c = 0
s = []
for i in range(n):
  if p[i] == i+1:
    c +=1
  else:
    if c>0:
      s.append(c)
      c = 0
if c > 0:
  s.append(c)
ans = 0
for i in s:
  if i == 1:
    ans += 1
  else:
    ans += math.ceil(i/2)
print (ans)

Measured memory_bytes: 19908
#include <iostream>
#include <string>
#include <cmath>
using namespace std;

int main (void){
    int a, b;
    int i, j, k;
    cin >> a >> b;
    i = a + b;
    j = a - b;
    k = a * b;

   if(i < j){
       if(j < k){
           cout << k << endl;
       }else{
           cout << j << endl;
       }
   }else if(j < i){
       if(i < k){
           cout << k << endl;
       }else{
           cout << i << endl;
       }
   }else if(k < i){
       if(i < j){
           cout << j << endl;
       }else{
           cout << i << endl;
       }
   }else{
       cout << 0 << endl;
   }

    return 0;
}


Measured memory_bytes: 3632
#ifdef LOCAL
#define _GLIBCXX_DEBUG
#endif
#include<bits/stdc++.h>
using namespace std;
#define rep(i,s,t) for(ll i = (ll)(s); i < (ll)(t); i++)
#define rrep(i,s,t) for(ll i = (ll)(s-1);(ll)(t) <= i; i--)
#define all(x) (x).begin(), (x).end()
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> Pll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
constexpr ll INF = numeric_limits<ll>::max()/4;
constexpr ll n_max = 2e5+10;
#define int ll

template <typename A, typename B>
string to_string(pair<A, B> p);
string to_string(const string &s) {return '"' + s + '"';}
string to_string(const char c) {return to_string((string) &c);}
string to_string(bool b) {return (b ? "true" : "false");}
template <size_t N>
string to_string(bitset<N> v){
    string res = "";
    for(size_t i = 0; i < N; i++) res += static_cast<char>('0' + v[i]);
    return res;
}
template <typename A>
string to_string(A v) {
    bool first = true;
    string res = "{";
    for(const auto &x : v) {
        if(!first) res += ", ";
        first = false;
        res += to_string(x);
    }
    res += "}";
    return res;
}
template <typename A, typename B>
string to_string(pair<A, B> p){return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";}

void debug_out() {cerr << endl;}
template<typename Head, typename... Tail>
void debug_out(Head H, Tail... T) {
    cerr << " " << to_string(H);
    debug_out(T...);
}

#ifdef LOCAL
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#else
#define debug(...) 42
#endif

template<class T>
bool chmax(T &a, T b){if(a < b){a = b; return true;} return false;}
template<class T>
bool chmin(T &a, T b){if(a > b){a = b; return true;} return false;}
void YES(bool ok){
    cout << (ok ? "Yes" : "No") << endl;
}
signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    ll n; cin >> n;
    multiset<ll> mst;
    rep(i,0,1LL << n){
        ll a; cin >> a;
        mst.insert(-a);
    }
    vector<ll> v;
    bool ok = true;
    rep(i, 0, n+1){
        if(v.size() == 0){
            auto itr = mst.begin();
            v.emplace_back(*itr);
            mst.erase(itr);
            continue;
        }
        vector<ll> temp;
        for(auto &k : v){
            auto itr = mst.upper_bound(k);
            if(itr == mst.end()){
                ok = false;
                break;
            }
            temp.emplace_back(*itr);
            mst.erase(itr);
        }
        copy(all(temp), back_inserter(v));
        debug(v);
    }

    YES(ok);
}

Measured memory_bytes: 15560
import java.util.*;

class Main{
    public static void main(String[] args) {
        Scanner stdIn = new Scanner(System.in);
        int n = stdIn.nextInt();
        int[] a = new int[n];
        int[] b = new int [n];
        for(int i = 0; i < n ; i++){
            a[i] = stdIn.nextInt();
            b[i] = a[i];
        }
        Arrays.sort(b);
        
        for(int i = 0; i < n; i++){
            System.out.println(b[n - 1] == a[i] ? b[n - 2] : b[n - 1]);
        }
    }
}

Measured memory_bytes: 92976
//In The Name Of Allah
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define sz(x) (int)(x.size())
#define double long double 
#define x real()
#define y imag()
#define fi first
#define se second
#define pii pair<int, int>

const int N = 110, WW = 1e5 + 100;
int w[N], v[N], dp[N][WW];
signed main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);
	int n, W;
	cin >> n >> W;
	for (int i = 1; i <= n; i++) {
		cin >> w[i] >> v[i];
	}
	for (int i = w[1]; i <= W; i++) {
		dp[1][i] = v[1];
	}
	for (int i = 2; i <= n; i++) {
		for (int j = 0; j < w[i]; j++) {
			dp[i][j] = dp[i - 1][j];
		}
		for (int j = w[i]; j <= W; j++) {
			dp[i][j] = max({dp[i - 1][j - w[i]] + v[i],
					dp[i - 1][j]});
		}
	}
	cout << dp[n][W] << "\n";
}



Measured memory_bytes: 79360
#include <iostream>
using namespace std;
int main(){
	int n;
	string s;
	cin>>n>>s;
	int cnt1=0;
	int cnt2=0;
	for(int i=0;i<n;i++){
		if(s[i]=='.'){
			cnt2++;
		}
	}
	int ans=n;
	ans=min(ans,cnt1+cnt2);
	for(int i=0;i<n;i++){
		if(s[i]=='#'){
			cnt1++;
		}
		else{
			cnt2--;
		}
		ans=min(ans,cnt1+cnt2);
	}
	cout << ans << endl;
	
	return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;

int main() {
  char c;
  cin >> c;
  
  if(c=='a' || c=='i' || c=='u' || c=='e' || c=='o'){
    cout << "vowel" << endl;
  } else{
    cout << "consonant" << endl;
  }
}


Measured memory_bytes: 3636
#include <iostream>
using namespace std;

int main()
{
  long long n;
  cin >> n;
  long long ans = 0;
  for (long long i = 1; i <= n; i++)
  {
    if (i % 3 == 0 || i % 5 == 0 || i % 15 == 0)
      ans += i;
  }
  long long total = (1 + n) * n / 2;
  cout << total - ans << endl;
}

Measured memory_bytes: 3592
"use strict"
function main(arg) {
    var t = arg.trim().split("\n")[0].split(" ").map(Number)
    var a = t[0]
    var b = t[1]
    if (a <= 5) {
        console.log(0)
    } else if (a < 13) {
        console.log(b / 2)
    } else {
        console.log(b)
    }
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

Measured memory_bytes: 21192
#include <iostream>
#include <cstdio>
using namespace std;
char a[100][100];
int pd(char m)
{
    return m == '#'?1:0;
}
int main()
{
    int h,w;
    while(scanf("%d%d",&h,&w) == 2)
    {
        for(int i = 0; i <= h+1; i++)
            a[i][0] = '.';
        for(int i = 0; i <= w+1; i++)
            a[0][i] = '.';
        getchar();
        for(int i = 1; i <= h; i++)
        {
            for(int j = 1; j <= w+1; j++)
            {
                scanf("%c",&a[i][j]);
            }
        }
        for(int i = 1; i <= w+1; i++)
            a[h+1][i] = '.';
        for(int i = 1; i <= h; i++)
        {
            for(int j = 1; j <= w; j++)
            {
                if(a[i][j] == '.')
                    a[i][j] = pd(a[i-1][j-1]) + pd(a[i-1][j]) + pd(a[i-1][j+1]) + pd(a[i][j-1]) + pd(a[i][j+1]) +pd(a[i+1][j-1]) + pd(a[i+1][j]) + pd(a[i+1][j+1]) + '0';
            }
        }
        for(int i = 1; i <= h; i++)
        {
            for(int j = 1; j <= w; j++)
            {
                printf("%c",a[i][j]);
            }
            printf("\n");
        }
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include<math.h>
#include<list>
#include <algorithm>
#include<set>
#include<vector>
#include<math.h>
#include<map>
#include<string>
#include <numeric>
#include <queue>
#include <sstream>
#include <bitset>
#include<stack>
#include<functional>
#include<unordered_set>
#include<unordered_map>

using namespace std;
using ll = long long;
using vll = vector<long long>;
using sll = set<long long>;
const long long ll_max = 9223372036854775807;
const long long ll_min = -9223372036854775807;
const int int_max = 2147483647;

template<typename T>
T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
template<typename T>
T lcm(T a, T b) { return a / gcd(a, b) * b; }

template<typename T>
map<T, T> getPrimeFactor(T n) {
	map<T, T> ret;
	for (T i = 2; i * i <= n; ++i) {
		while (n % i == 0) {
			ret[i] ++;
			n /= i;
		}
	}
	if (n != 1) ret[n] = 1;
	return ret;
}

template<typename T>
bool IsPrimeNumber(T num)
{
	if (num <= 2) return true;
	else if (num % 2 == 0) return false;

	double sqrtNum = sqrt(num);
	for (int i = 3; i <= sqrtNum; i += 2)
	{
		if (num % i == 0)
		{
			return false;
		}
	}

	return true;
}

template<typename T>
T modinv(T a, T m) {
	T b = m, u = 1, v = 0;
	while (b) {
		long long t = a / b;
		a -= t * b; swap(a, b);
		u -= t * v; swap(u, v);
	}
	u %= m;
	if (u < 0) u += m;
	return u;
}



// 繰り返し二乗法
ll pow2(ll n, ll p, ll mod) {
	if (p == 0 || n == 1) {
		return 1;
	}
	else {
		ll ret = pow2(n * n % mod, p / 2, mod);
		if (p % 2 == 1) {
			ret *= n;
		}
		return ret % mod;
	}
}


#define rep(i,s,e) for(ll i=s;i<e;i++)
#define repeq(i,s,e) for(ll i=s;i<=e;i++)


int main() {
	ll a, b, t;
	cin >> a >> b >> t;

	cout << t / a * b << endl;
	return 0;
}


Measured memory_bytes: 3608
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <algorithm>
using namespace std;

int w, h;

// 0:→, 1:↑, 2:←, 3:↓
int dx[4] = {+1,0,-1,0};
int dy[4] = {0,-1,0,+1};

void debug(const vector<string>& s, int t){
	char H[256] = {0};
	H['E'] = '>'; H['W'] = '<'; H['N'] = '^'; H['S'] = 'v';
	H['X'] = 'X'; H['.'] = '.'; H['#'] = '#';
	
	cout << "time : " << t << endl;
	for(int y=0 ; y < h ; y++ ){
		for(int x=0 ; x < w ; x++ ){
			cout << H[s[y][x] ];
		}
		cout << endl;
	}
	cout << endl;
}

// 位置 (px,py), 向き d, の人が空いているマスを探し, 最初に見つけた向きを返す.
// ないときは d を返す. 
int search(const vector<string>& s, int px, int py, int d){
	// 右, 前, 左, 後ろの順に調べる.
	int f[4] = {+3,0,+1,+2};
	
	for(int i=0 ; i < 4 ; i++ ){
		int next_d = (d + f[i]) % 4;
		int mx = px + dx[next_d];
		int my = py + dy[next_d];
		
		if( mx < 0 || my < 0 || mx >= w || my >= h ) continue;
		 
		if( s[my][mx] == '.' || s[my][mx] == 'X' ){
			return next_d;
		}
	}
	return d;
}

bool is_person(char c){
	return ( c == 'E' || c == 'W' || c == 'N' || c == 'S');
}

int main(){
	char H[256] = {0};
	H['E'] = 0; H['N'] = 1; H['W'] = 2; H['S'] = 3;
	H[0] = 'E'; H[1] = 'N'; H[2] = 'W'; H[3] = 'S';
	
	while( cin >> w >> h, w || h ){
		vector<string> s(h);
		for(int y=0 ; y < h ; y++ ){
			cin >> s[y];
		}
		//debug( s , 0 );
		// N := 人の数
		int N=0;
		// 人の数を数える.
		for(int y=0 ; y < h ; y++ ){
			for(int x=0 ; x < w ; x++ ){
				if( is_person(s[y][x]) ) N++;
			}
		}
		int ans = -1;
		for(int t=1 ; t <= 180 ; t++ ){
			for(int y=0 ; y < h ; y++ ){
				for(int x=0 ; x < w ; x++ ){
					// (x,y)が人だったら向きを変える
					if( is_person(s[y][x]) ){
						int d = H[ s[y][x] ];
						int next_d = search( s , x , y , d );
						s[y][x] = H[next_d];
					}
				}
			}
			
			vector<string> s_ = s;
			bool cp[100][100] = {false};
			for(int y=0 ; y < h ; y++ ){
				for(int x=0 ; x < w ; x++ ){
					// (x,y) が移動可能なマス かつ まだ誰も移動していなければ調べる.
					if( s[y][x] == '.' || s[y][x] == 'X'){
						// 優先順位は マス(x,y) の右,上,左,下 の順.
						for(int i=0 ; i < 4 ; i++ ){
							int mx = x + dx[i];
							int my = y + dy[i];
							
							if( mx < 0 || my < 0 || mx >= w || my >= h ) continue;
							
							// (mx,my) にいる人が (x,y) に移動する. (x,y) が出口'X' なら人は消える.
							if( is_person(s[my][mx]) && abs(i-H[s[my][mx]]) == 2 ){
								if( s[y][x] == 'X' ){
									s_[my][mx] = '.';
									cp[my][mx] = true;
									N--;
								}else{
									s_[my][mx] = '.';
									s_[y][x] = s[my][mx];
									cp[y][x] = true;
									cp[my][mx] = true;
								}
								break;
							}
						}
					}
					if( !cp[y][x] ) s_[y][x] = s[y][x];
				}
			}
			s = s_;
			//debug( s , t );
			if( N == 0 ){
				ans  = t;
				break;
			}
		}
		if( ans == -1 ){
			cout << "NA" << endl;
		}else{
			cout << ans << endl;
		}
	}
}

Measured memory_bytes: 948
#include <iostream>
#include <algorithm>
#include <cmath>
#include <string>
#include <utility>
#include <climits>
#include <vector>
using namespace std;

#define ll long long int

const int MOD = 1000000007;

int max(int a, int b) {

	if (a > b)return a;
	else return b;

}
int main() {

	string W;
	int count[26];
	bool check = true;

	for (int i = 0; i < 26; i++) {

		count[i] = 0;

	}

	cin >> W;

	for (int i = 0; i < W.size(); i++) {

		if (W[i] == 'a')count[0]++;
		if (W[i] == 'b')count[1]++;
		if (W[i] == 'c')count[2]++;
		if (W[i] == 'd')count[3]++;
		if (W[i] == 'e')count[4]++;
		if (W[i] == 'f')count[5]++;
		if (W[i] == 'g')count[6]++;
		if (W[i] == 'h')count[7]++;
		if (W[i] == 'i')count[8]++;
		if (W[i] == 'j')count[9]++;
		if (W[i] == 'k')count[10]++;
		if (W[i] == 'l')count[11]++;
		if (W[i] == 'm')count[12]++;
		if (W[i] == 'n')count[13]++;
		if (W[i] == 'o')count[14]++;
		if (W[i] == 'p')count[15]++;
		if (W[i] == 'q')count[16]++;
		if (W[i] == 'r')count[17]++;
		if (W[i] == 's')count[18]++;
		if (W[i] == 't')count[19]++;
		if (W[i] == 'u')count[20]++;
		if (W[i] == 'v')count[21]++;
		if (W[i] == 'w')count[22]++;
		if (W[i] == 'x')count[23]++;
		if (W[i] == 'y')count[24]++;
		if (W[i] == 'z')count[25]++;

	}
	for (int i = 0; i < 26; i++) {

		if (count[i] % 2 == 1)check = false;

	}

	if (check)cout << "Yes" << endl;
	else cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
using ll = long long;
#define rep(i,n) for (ll i=0;i<n;i++)
using namespace std;

void solve(){

}
int main (){
    ios::sync_with_stdio(0);
    cin.tie(0);
    string s;
    string t;
    cin >>s >> t;
    ll s1,t1;
    s1 = s.size();
    t1 = t.size();
    ll ans = t1;
    for(ll i = 0; i< s1 - t1+1;i++){
        ll cnt = 0;
        rep(j,t1){
            if(s[j+i]==t[j]) cnt++;
        }
        ans = min(ans,t1-cnt);
    }
    cout << ans;

    return 0;
}

Measured memory_bytes: 3656
def maxValue(a,b,v):
	v2 = v
	for i in range(v2,-1,-1):
		for j in range(v2//a+1): #j:aの個数
			k = i-a*j
			if k%b==0:
				return i
	return -1

a,b,c,d,e,f = list(map(int, input().split()))

waVa = maxValue(a*100,b*100,f)
suVa = maxValue(c,d,min(f-waVa,waVa*e//100))
maxR = 0

anw = waVa
ans = suVa

while 1:
	waVa = maxValue(a*100,b*100,waVa-1)
	suVa = maxValue(c,d,min(f-waVa,waVa*e//100))
	if waVa == 0:
		break
	if maxR<100*suVa/(suVa+waVa):
		maxR = 100*suVa/(suVa+waVa)
		anw = waVa
		ans = suVa

print(anw+ans,ans)

Measured memory_bytes: 3316