akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define f(i,j,k) for(int i=j;i<k;i++)
#define f2(i,j,k) for(int i=j;i>k;i--)
using namespace std;
int main(){
    long long n,d,ans;
    cin>>d>>n;
    if(n==100){
        ans=101*pow(100,d);
    }
    else{
        ans=n*pow(100,d);
    }
    cout<<ans<<endl;
    return 0;
}


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

#define FOR(a, b, c) for(int a = b; a <= c; ++a)
#define FORW(a, b, c) for(int a = b; a >= c; --a)
#define fi first
#define se second
#define pb push_back
#define int long long

typedef pair<int, int> ii;
typedef pair<int, ii> iii;

const int N = 3e3 + 100;
const int maxN = 1e16;
const int oo = 1e18;
const int mod  = 998244353;
const int base = 26;
const double PI = 3.14159265358979323846;


signed main()  {
//    freopen("test.inp", "r", stdin);
//    freopen("spm.out", "w", stdout);
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    int r; cin >> r;
    cout << fixed << setprecision(10) << 2.00 * r * PI;
}


Measured memory_bytes: 3792
#!/usr/bin/env python3
import collections
import itertools as it
import math
#import numpy as np
 
#  = input()
#  = int(input())
a, b, x  = map(int, input().split())
#  = list(map(int, input().split()))
#  = [int(input()) for i in range(N)]
#
# c = collections.Counter()


def f(a, b, x):
    """
    """
    if a * a * b / 2 <= x:
        return math.atan(2 * (a * a * b - x) / (a * a * a))
    else:
        return math.pi / 2 - math.atan(2 * x / (a * b * b))

#print(f(a, b, x) * 180 / math.pi)
print(math.degrees(f(a, b, x)))


Measured memory_bytes: 3444
#include <bits/stdc++.h>

#define sz(a) (int)(a).size()
#define pb push_back
#define all(a) (a).begin(), (a).end()

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef long double ld;

struct node
{
    map<int, int> m;
};

vector<node> t;
vector<int> a;

void build(int v, int tl, int tr)
{
    if (tl == tr) {
        t[v].m[a[tl]] = tl;
        return;
    }
    int tm = (tl + tr) >> 1;
    build(v * 2, tl, tm);
    build(v * 2 + 1, tm + 1, tr);
    t[v].m = t[v * 2].m;
    for (auto it : t[v * 2 + 1].m) {
        t[v].m[it.first] = it.second;
    }
}

int get(int v, int tl, int tr, int l, int r, int val)
{
    if (l > r) {
        return -1;
    }
    if (tl == l && tr == r) {
        if (t[v].m.count(val)) {
            return t[v].m[val];
        } else {
            return -1;
        }
    }
    int tm = (tl + tr) >> 1;
    int ans = -1;
    if (r > tm) {
        ans = max(ans, get(v * 2 + 1, tm + 1, tr, max(l, tm + 1), r, val));
    }
    if (ans != -1) {
        return ans;
    }
    if (l <= tm) {
        ans = max(ans, get(v * 2, tl, tm, l, min(r, tm), val));
    }
    return ans;
}

void kill(int v, int tl, int tr, int pos)
{
    if (tl == tr) {
        t[v].m.clear();
        return;
    }
    int tm = (tl + tr) >> 1;
    if (pos <= tm) {
        kill(v * 2, tl, tm, pos);
    } else {
        kill(v * 2 + 1, tm + 1, tr, pos);
    }
    t[v].m.erase(a[pos]);
    if (t[v * 2 + 1].m.count(a[pos])) {
        t[v].m[a[pos]] = t[v * 2 + 1].m[a[pos]];
    } else if (t[v * 2].m.count(a[pos])) {
        t[v].m[a[pos]] = t[v * 2].m[a[pos]];
    }
}

int main()
{

    //freopen("input.txt", "r", stdin);

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

    int q;
    scanf("%d", &q);
    vector<int> ptr(n, q - 1);

    a.resize(q);
    vector<vector<int> > positions(m + 1);
    for (int i = 0; i < q; ++i) {
        scanf("%d", &a[i]);
        positions[a[i]].pb(i);
    }

    t.resize(4 * q);
    build(1, 0, q - 1);

    set<int> dead;
    int curr = 1;
    for (int i = q - 1; i >= 0; --i) {
        if (dead.count(a[i])) {
            continue;
        }
        for (int j = 0; j < n; ++j) {
            if (ptr[j] == -1) {
                break;
            }
            if (j) {
                ptr[j] = min(ptr[j], ptr[j - 1] - 1);
            }
            int x = get(1, 0, q - 1, 0, ptr[j], a[i]);
            if (x == -1) {
                ptr[j] = -1;
                for (int s = j + 1; s < n; ++s) {
                    ptr[s] = -1;
                }
                break;
            } else {
                ptr[j] = x;
            }
            //cout << "!" << j << " " << ptr[j] << "\n";
        }
        if (ptr.back() == -1) {
            if (a[i] != curr) {
                cout << "No\n";
                return 0;
            }
        }
        dead.insert(a[i]);
        while (dead.count(curr)) {
            ++curr;
        }
        for (int x : positions[a[i]]) {
            kill(1, 0, q - 1, x);
        }
    }
    cout << "Yes\n";

}


Measured memory_bytes: 108160
// D - Fennec VS. Snuke

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
// const int INF = 2147483647;
// const ll INF = 9223372036854775807;
// const ll MOD = 1e9 + 7;

const int NONE = 0;
const int BLACK = 1;
const int WHITE = 2;

struct Node {
	vector<int> neighbors;
	int color = NONE;
};

int N;

vector<Node> nodes;
vector<bool> visited;
vector<int> route;
vector<int> to_Snuke;
int black_terminal, white_terminal;
int black_cnt = 0;
int white_cnt = 0;

void dfs_to_snuke(int node_idx) {
	visited[node_idx] = true;
	route.push_back(node_idx);

	if (node_idx == N-1) {
		to_Snuke = route;
		return;
	}

	for (int next_node_idx : nodes[node_idx].neighbors) {
		if (visited[next_node_idx]) continue;
		dfs_to_snuke(next_node_idx);
		route.pop_back();
	}
}

void dfs_count_black(int node_idx) {
	nodes[node_idx].color = BLACK;
	black_cnt++;

	for (int next_node_idx : nodes[node_idx].neighbors) {
		if (nodes[next_node_idx].color == BLACK) continue;
		if (next_node_idx == black_terminal) continue;
		dfs_count_black(next_node_idx);
	}
}

void dfs_count_white(int node_idx) {
	nodes[node_idx].color = WHITE;
	white_cnt++;

	for (int next_node_idx : nodes[node_idx].neighbors) {
		if (nodes[next_node_idx].color == WHITE) continue;
		if (next_node_idx == white_terminal) continue;
		dfs_count_white(next_node_idx);
	}
}

int main() {
	cin >> N;

	nodes = vector<Node>(N);
	visited = vector<bool>(N);

	int a, b;
	for (int i=0; i<N-1; i++) {
		cin >> a >> b;
		a--;
		b--;
		nodes[a].neighbors.push_back(b);
		nodes[b].neighbors.push_back(a);
	}

	dfs_to_snuke(0);

	black_terminal = to_Snuke[(to_Snuke.size() + 1) / 2];
	white_terminal = to_Snuke[(to_Snuke.size() + 1) / 2 - 1];


	// **** debug ****
	/*
	for (int idx : to_Snuke) {
		cout << idx << " ";
	}
	cout << endl;
	cout << "black_terminal:" << black_terminal << endl;
	cout << "white_terminal:" << white_terminal << endl;
	*/

	dfs_count_black(0);
	dfs_count_white(N-1);

	string ans;
	if (black_cnt > white_cnt) {
		ans = "Fennec";
	} else {
		ans = "Snuke";
	}

	cout << ans << endl;

	return 0;
}



Measured memory_bytes: 13688
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
 
#define REP(i,m,n) for(int i=(int)(m);i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m);i>=(int)(n);--i)
#define debug(x) cout << #x << "=" << (x) << endl;
 
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<typename T> void fail(T v){cout << v << endl;exit(0);}
//template end

void solve(){
  int N;
  cin>>N;
  vector<int> imos(101010);
  rep(i,N){
    int a,b;
    cin>>a>>b;
    a--;b--;
    imos[a]++;
    imos[b+1]--;
  }
  rep(i,imos.size()-1)
    imos[i+1]+=imos[i];
  int m=0;
  rep(i,imos.size())
    if(imos[i]>=i)
    m=max(m,i);
  cout<<m<<endl;
}
 
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  solve();
  return 0;
}


Measured memory_bytes: 3352
#include <iostream>
#include <stdio.h>
#include <string>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <limits.h>
#include <queue>
#include <bits/stdc++.h>
#include <stack>
#include <vector>
#include <list>
#define NUMBER 100000

using namespace std;

int main()
{
  char s[NUMBER];
  cin >> s;
  int n = strlen(s);
  int K;
  cin >> K;

  int j = 0;
  while(K){
    //cout << "s = " << s << endl;
    if(j==n-1){
      //cout << "ttt = " << (s[n-1] % 'a') << endl;
      int tmp = ((K % 26) + (s[n-1] % 'a')) % 26;
      //cout << "now = " << tmp << endl;
      s[n-1] = tmp + 'a';
      K = 0;
    }
    else if(s[j]+K >'z'){
      while(s[j]!='a'){
        if(s[j]=='z')
          s[j] = 'a';
        else
          s[j]+=1;
        K--;
      }
    }
    j++;
  }

  cout << s << endl;


  return 0;
}

Measured memory_bytes: 512
// ------------------------------------
// Date:2018/ 3/ 1
// Problem:ABC 053 X:YetAnotherDieGame c.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto&& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl

typedef long long ll;

static const int MOD = 1000000007;

int main()
{
  ll x;
  cin >> x;
  cout << (x / 11) * 2 + ((x % 11 ) > 6 ? 2 : (x % 11) > 0 ? 1 : 0) << endl;
  return 0;
}



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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()

const int N = 1005;

char a[N][N];

struct dt {
  int fi, sc, th;
  dt() {}
  dt(int fi, int sc, int th):
    fi(fi), sc(sc), th(th) {}
};

class cmp {
public:
  bool operator()(dt a, dt b) {
    return a.th > b.th;
  }
};

void solve() {
  int n, m;
  cin >> n >> m;
  int cx, cy, dx, dy;
  cin >> cx >> cy >> dx >> dy;
  for (int i = 1; i <= n; i++)
  for (int j = 1; j <= m; j++) {
    cin >> a[i][j];
  }
  priority_queue<dt, vector<dt>, cmp> q;
  q.push(dt(cx, cy, 0));
  while (q.size()) {
    int x = q.top().fi, y = q.top().sc, z = q.top().th;
    q.pop();
    if (x < 1 || x > n || y < 1 || y > m) continue;
    if (a[x][y] == '#') continue;
    a[x][y] = '#';
    if (x == dx && y == dy) {
      cout << z << '\n';
      return;
    }
    q.push(dt(x - 1, y, z));
    q.push(dt(x + 1, y, z));
    q.push(dt(x, y - 1, z));
    q.push(dt(x, y + 1, z));
    for (int i = -2; i <= 2; i++)
    for (int j = -2; j <= 2; j++) {
      q.push(dt(x + i, y + j, z + 1));
    }
  }
  cout << -1 << '\n';
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) solve();
}


Measured memory_bytes: 16412
#include <bits/stdc++.h>

using namespace std;

typedef long long int ll;
typedef pair<ll, ll> pll;

#define FOR(i, n, m) for(ll (i)=(m);(i)<(n);++(i))
#define REP(i, n) FOR(i,n,0)
#define OF64 std::setprecision(10)

const ll MOD = 1000000007;
const ll INF = (ll) 1e15;

pll A[100005];

int main() {
    ll N, M;
    cin >> N >> M;
    REP(i, M) {
        cin >> A[i].first >> A[i].second;
    }
    sort(A, A + M, [](pll a, pll b) { return a.second < b.second; });
    ll ans = 0;
    ll right = -INF;
    REP(i, M) {
        if (right > A[i].first)
            continue;
        ans++;
        right = A[i].second;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 1792
def solve():
    INF = float('inf')

    def Dijkstra(adjList, vSt):
        numV = len(adjList)
        useds = [False] * numV
        numUsed = 0
        costs = [INF] * numV
        costs[vSt] = 0
        while True:
            cNow, vNow = INF, -1
            for v in range(numV):
                if useds[v]: continue
                if costs[v] < cNow:
                    cNow, vNow = costs[v], v
            useds[vNow] = True
            numUsed += 1
            if numUsed == numV: break
            for v2, wt in adjList[vNow]:
                c2 = cNow + wt
                if c2 < costs[v2]:
                    costs[v2] = c2
        return costs

    N, M, L = map(int, input().split())
    adjL = [[] for _ in range(N)]
    for _ in range(M):
        A, B, C = map(int, input().split())
        A, B = A-1, B-1
        adjL[A].append((B, C))
        adjL[B].append((A, C))

    costss = [Dijkstra(adjL, vSt) for vSt in range(N)]

    adjL2 = [[] for _ in range(N)]
    for i, costs in enumerate(costss):
        for j, cost in enumerate(costs[i+1:], i+1):
            if cost <= L:
                adjL2[i].append((j, 1))
                adjL2[j].append((i, 1))

    costss = [Dijkstra(adjL2, vSt) for vSt in range(N)]

    Q = int(input())
    anss = []
    for _ in range(Q):
        s, t = map(int, input().split())
        s, t = s-1, t-1
        if costss[s][t] == INF:
            anss.append(-1)
        else:
            anss.append(costss[s][t]-1)

    print('\n'.join(map(str, anss)))


solve()


Measured memory_bytes: 84440
#include <bits/stdc++.h>
using namespace std;
#define int long long
typedef pair<int,int> pi;
#define f first
#define s second
#define FAST ios_base::sync_with_stdio(0); cin.tie(0);
const int maxn = 200010;
const int INF = INT_MAX/4;

int n,k;
int A[maxn];
int B[maxn];

int32_t main() {
	FAST
	cin >> n >> k;
	
	for (int i =0;i<n;i++) cin >> A[i];

	bool running = true;
	for (int x =0;x<k and running;x++) {
		memset(B,0,sizeof B);
		for (int i =0;i<n;i++) {
			int l = max(0ll, i - A[i]);
			int r = min(n, i + A[i] + 1);
			B[l]++; B[r]--;
		}

		int cur = 0;
		bool allmax = true;
		for (int i =0;i<n;i++) {
			cur += B[i];
			A[i] = cur;
			if (A[i] != n) allmax = false;
		}
		if (allmax) running = false;
	}
	for (int i =0;i<n;i++) {
		cout << A[i] << " ";
	}
	
}









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

using ll=long long int;

constexpr ll MOD=(ll)1e9+7;

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

int n;

std::string s[2];

int main() {

    std::cin>>n;

    for(int i=0;i<2;++i)
        std::cin>>s[i];

    if(n==1){
        std::cout<<3<<std::endl;
        return 0;
    }

    ll ans=1;

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

        if(s[0][i]==s[1][i]){
            if(i==0)
                ans*=3;
            else if(s[0][i-1]==s[1][i-1])
                ans*=2;
        }

        else{

            if(i==0)
                ans*=6;
            else{
                if(s[0][i-1]==s[1][i-1])
                    ans*=2;
                else
                    ans*=3;
            }
            ++i;
        }
        ans%=MOD;
    }

    std::cout<<ans<<std::endl;

    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
	#include <iostream>
	#include <vector>
	#include <algorithm>
	using namespace std;
	typedef long long ll;
	typedef std::vector<ll> lls;
	#define MIN(a, b) ( ((a)<(b)) ? (a) : (b) )
	#define MAX(a, b) ( ((a)>(b)) ? (a) : (b) )

	void cinv(lls& llVec, ll n) {
		ll val;
		llVec.reserve((size_t)(n));
		for (ll i = 0; i < n; i++) {
			cin >> val;
			llVec.push_back(val);
		}
	}


	int main()
	{
		ll A,B;

		cin >> A >> B;
		
		ll ret = MAX(A + B, A - B);
		ret = MAX(ret, A * B);




		cout << ret << '\n';

		return 0;
	}



Measured memory_bytes: 256
#include <stdio.h>

int saitan(int p, int q, int r) {

	int mix[3] = { p,q,r };
	int i = 0;
	int good[3];
	int total = p + q + r;
	int min ;

	for (i = 0; i < 3; i++) {
		good[i] = total - mix[i];
	}

	min = good[0];

	for (i = 1; i < 3; i++) {
		if (min >good[i]) {
			min = good[i];
		}
	}

	return min;

}

int main()
{
	//みっつの場合わけをしたらいいだけ。

	int P,Q,R = 0;

	scanf("%d %d %d", &P, &Q, &R);

	printf("%d\n", saitan(P, Q, R));

	return 0;

	
}

Measured memory_bytes: 128
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);
		String a = String.valueOf(scan.nextInt());
		String b = String.valueOf(scan.nextInt());
		int c = Integer.valueOf(a.concat(b));
		
		int d = (int) Math.sqrt(c);
		if (Math.pow(d, 2) == c) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<29;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-11;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};


int main(){
	int n,m;
	cin>>n>>m;
	vi a(m);
	for(int i=0;i<m;i++) cin>>a[i];
	vi b(n+1,1);
	for(int i=m-1;i>=0;i--){
		if(b[a[i]]){
			cout<<a[i]<<endl;
			b[a[i]]--;
		}
	}
	for(int i=1;i<=n;i++) if(b[i]) cout<<i<<endl;
}


Measured memory_bytes: 3888
#include<iostream>
#include<string>
#include<algorithm>

using namespace std ;
int main () {
  int N,T;
  int c[100],t[100];
  int tmpc=1001,tmpt=1001;
  cin >> N >> T;
  for(int i=0;i<N;i++) {
    cin >> c[i] >> t[i];
  }
  for(int i=0;i<N;i++) {
    if(T>=t[i]) {
      if(tmpc>c[i]) {
        tmpc=c[i];
        tmpt=t[i];
      }
    }
  }
  if(tmpt==1001) cout << "TLE" << endl;
  else cout << tmpc << endl;
  return(0);
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include<algorithm>
#include<sstream>
#include<iomanip>


using namespace std;

typedef long long ll;

const ll MOD_CONST = 1000000007;
const ll BIG_NUM = 1000000000000000000;

int main() {
	ll n, x;
	cin >> n >> x;

	vector<ll> cnt_layer(n + 1);
	vector<ll> cnt_pat(n + 1);
	cnt_layer[0] = 1;
	cnt_pat[0] = 1;
	for (int i = 1; i <= n;i++) {
		cnt_layer[i] = cnt_layer[i - 1] * 2 + 3;
		cnt_pat[i] = cnt_pat[i - 1] * 2 + 1;
	}

	ll sum = 0;
	if (cnt_layer[n] == x) {
		sum = cnt_pat[n];
	}
	else {
		int l = n - 1;
		while (x != 0) {
			x--;
			if (cnt_layer[l] <= x) {
				sum += cnt_pat[l];
				x -= cnt_layer[l];
				if (x > 0) {
					x--;
					sum++;
				}
			}



			if (cnt_layer[l] == x) {
				x = 0;
				sum += cnt_pat[l];
			}
			l--;

		}
	}

	cout << sum << endl;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <cmath>
#include <iomanip>
#include <queue> 
#include <tuple>
#include <map>
 
using namespace std;

typedef long long ll;

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

    int N;

    cin >> N;

    vector<pair<int, int> > A(N);

    for(int i = 0; i < N; i++) {
        int a;
        cin >> a;
        A[i] = make_pair(a, i + 1);
    }

    sort(A.begin(), A.end());

    for(int i = 0; i < N; i++) {
        cout << A[i].second << " ";
    }
}


Measured memory_bytes: 1664
use std::io;

fn main() {
    let mut s = String::new();
    io::stdin().read_line(&mut s).ok();
    let k: usize = s.trim().parse().ok().unwrap();
    let mut m: usize = 7 % k;
    let mut b: Vec<bool> = vec![false; k];
    let mut c: usize = 1;
    loop {
        if m % k == 0 {
            println!("{}", c);
            break;
        } else if b[m] {
            println!("-1");
            break;
        } else {
            b[m] = true;
            c += 1;
            m = ((m * 10) + 7) % k;
        }
    }
}


Measured memory_bytes: 2888
#include <bit>
#include <bitset>
#include <assert.h>
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <math.h>
#include <stdlib.h>
#include <queue>
#include <stack>


typedef long double ld;
typedef long long ll;

using namespace std;

int main() {
	string s, t;
	int n;
	cin >> n;
	cin >> s >> t;
	for (int i = 0; i < s.length(); i++) {
		cout << s[i] << t[i];
	}
	cout << endl;

	return 0;
}


Measured memory_bytes: 3588
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		int h = scan.nextInt();
		int s = (a + b) * h / 2;
		System.out.println(s);
	}
}

Measured memory_bytes: 23764
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.util.StringTokenizer;

public class Main {
    public static void main(final String[] args) {
        final FastScanner scanner = new FastScanner(System.in);
        final int n = scanner.nextInt();
        int min = Integer.MAX_VALUE;

        final List<Point> points = new ArrayList<>();

        for (int i = 0; i < n; i++) {
            final int x = scanner.nextInt();
            final int y = scanner.nextInt();
            final int h = scanner.nextInt();

            min = Math.min(h, min);
            points.add(new Point(x, y, h));
        }

        for (int x = 0; x <= 100; x++) {
            for (int y = 0; y <= 100; y++) {
                int h;
                for (h = min; h <= min + 200; h++) {
					boolean flag = true;
                    for (final Point point : points) {
                        if (point.getH() != Math.max(0, h - Math.abs(x - point.getX()) - Math.abs(y - point.getY()))) {
                            flag = false;
                            break;
                        }
                    }

					if (flag) {
						System.out.println(x + " " + y + " " + h);
						return;
					}
                }
            }
        }

    }

    static class Point {
        private final int x;
        private final int y;
        private final int h;

        public Point(final int x, final int y, final int h) {
            this.x = x;
            this.y = y;
            this.h = h;
        }

        public int getX() {
            return x;
        }

        public int getY() {
            return y;
        }

        public int getH() {
            return h;
        }
    }

    static class FastScanner {
        private final BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(final InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }

            return tokenizer.nextToken("\n");
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        double nextDouble() {
            return Double.parseDouble(next());
        }
    }
}


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

int main() {
	while(1){
		long n; long a[10]={0};
		cin >> n ; if(!n) break;
		for(int i=0;i<n;i++){
			int age; cin >> age ;
			age/=10;
			if(age>=6) a[6]++; else a[age]++;
		}
		for(int i=0;i<=6;i++) cout << a[i] << '\n';
	}
}

Measured memory_bytes: 1160
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long n,ans=0;
    cin>>n;
    for(int i=1;i<=n;i++)
    {
        if(i%3!=0 &&i%5!=0)
        {
            ans+=i;
        }
    }
    
    cout<<ans<<"\n";
    return 0;
}

Measured memory_bytes: 3604
# coding: utf-8
import sys
sys.setrecursionlimit(100000)
n,m=map(int,input().split())
g=[set() for i in range(n)]
revg=[set() for i in range(n)]
for i in range(n+m-1):
    a,b=map(int,input().split())
    a-=1
    b-=1
    g[a].add(b)
    revg[b].add(a)
p=0
while True:
    if len(revg[p])==0:
        break
    for nxt in revg[p]:
        p=nxt
        break
ans=[-1 for i in range(n)]
ans[p]=0
def check(pos):
    for nxt in g[pos]:
        revg[nxt].remove(pos)
    for nxt in g[pos]:
        if len(revg[nxt])==0 and ans[nxt]==-1:
            ans[nxt]=pos+1
            check(nxt)
check(p)
print(*ans,sep='\n')
        

Measured memory_bytes: 146104
import sys
input = sys.stdin.readline
n = int(input())
a = [int(x) for x in input().split()]

a.sort()
amax = a.pop()
ans = a[0]
for i in a :
    if abs(amax/2 - ans) > abs(amax/2 - i) :
        ans = i

print(amax, ans)


Measured memory_bytes: 58864
#include<iostream>
#include<cstdio>
using namespace std;
#define H 2000000
int A[H+1],n = 0;

void maxHeapify(int i){
    int l = i*2;
    int r = i*2+1;
    int maxi;
    if( l <= n && A[l] > A[i] ){
        maxi = l;
    } else maxi = i;
    if( r <= n && A[r] > A[maxi] ){
        maxi = r;
    }
    if( maxi != i ){
        int temp = A[i];
        A[i] = A[maxi];
        A[maxi] = temp;
        maxHeapify(maxi);
    }
}

void _insert(int i){
    n++;
    A[n] = i;
    int k = n;
    while(k){
        maxHeapify(k);
        k /= 2;
    }
}

void extract(){
    cout << A[1] << endl;
    A[1] = A[n];
    n--;
    maxHeapify(1);
}

int main(){
    int i,j,k;
    char s[20];
    do{
        scanf("%s",s);
        if( s[0] == 'i' ){
            scanf("%d",&k);
            _insert(k);
        }
        if( s[1] == 'x' ){
            extract();
        }
    }while(s[2] != 'd');
}



Measured memory_bytes: 7016
#include<stdio.h>

int main (void)

{
    int a,b;

    scanf("%d %d",&a,&b);

    if(a<b)
     printf("a < b\n");
    else if(a>b)
     printf("a > b\n");
    else
     printf("a == b\n");

    return 0;
}


Measured memory_bytes: 2100
#include <algorithm>
#include <cmath>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int i = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int i = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define MP make_pair
#define pb push_back
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1 << 30;
const ll LINF = 1LL << 61;
const int MOD = 1e9 + 7;

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    rep(i, N) cin >> A[i];
    int pre = 1;
    int cnt = 0;
    for(int i = 0; i < N; i++) {
        if(A[i] == pre) {
            cnt++;
            pre++;
        }
    }
    if(!cnt)
        cout << -1 << endl;
    else
        cout << N - cnt << endl;
    return 0;
}

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

int main(){
  vector<int> a(5);
  for(int i=0;i<5;i++){
    cin >> a.at(i);
  }
  for(int i=0;i<5;i++){
    if(a.at(i)==0){
      cout << i+1 << endl;
    }
  }
}

Measured memory_bytes: 3548
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int r = Integer.parseInt(sc.next());
        int d = Integer.parseInt(sc.next());
        int x = Integer.parseInt(sc.next());
        for (int i = 0; i < 10; i++) {
            int result = (r * x) - d;
            System.out.println(result);
            x = result;
        }
    }
}


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

int main(){
	int D, N;
	cin>>D>>N;
	long int A = pow(100, D);
	int answer;
	if(N!=100){
		answer = A*N;
	}	else{
		answer = A*(N+1);
	}
	cout<<answer;
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main(){
    ll n;
    ll m = 1000000007;
    cin >> n;
    ll a[n];
    ll p[n];
    for(int i=0;i<n;i++) cin >> a[i];
    ll res = 0;
    p[n-1]= a[n-1];
    for(int i=n-2;i>=0;i--){
        p[i] = (p[i+1]+a[i])%m;
    }
    for(int i=0;i<n-1;i++){
        res = (res%m + (a[i]*p[i+1])%m)%m;
    }
    cout << res;
}

Measured memory_bytes: 6736
#include <iostream>
#include<bits/stdc++.h>
#include<vector>
#include<string>
#define ll long long
#define IOS ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define vi vector<ll>
#define el printf("\n")
#define N 100001
using namespace std;
bool sortbysec(const pair<int,int> &a,
              const pair<int,int> &b)
{
    return (a.first < b.first);
}


int main()
{   IOS;
cout.precision(30);
   string ch;
   cin >> ch;
   ll res1=0,res0=0;
   for(int i=0;i<ch.size();i++)
   {
       if(ch[i]=='0')
        res0++;
       else
        res1++;
   }
   cout << min (res1,res0)*2;
    return 0;
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int MAXN = 2e5 + 5;
const int INF = 0x3f3f3f3f;
#define DEBUG(x) cout << (x) << '\n'

ll n, m, k, t, a[MAXN], b[MAXN];
queue<int> q, qq;
int find(int s){
    int l = 0, r = m, mid, res;
    while(l <= r){
        mid = (l + r) >> 1;
        if(b[mid] <= s) res = mid, l = mid + 1;
        else r = mid - 1;
    }
    return res;
}
void run(){
    cin >> n >> m >> k;
    for(int i = 1; i <= n; i++) cin >> t, a[i] = a[i-1] + t;
    for(int i = 1; i <= m; i++) cin >> t, b[i] = b[i-1] + t;
    int ans = 0;
    for(int i = 0; i <= n; i++){
        if(a[i] > k) break;
        ans = max(ans, i + find(k - a[i]));
    }
    cout << ans;
}
int main(){
#ifdef Irene
    freopen("in.txt", "r", stdin);
#endif // Irene
//    ios::sync_with_stdio(false);

    run();
}


Measured memory_bytes: 6704
use std::io::*;
use std::str::FromStr;
#[allow(unused_imports)]
use std::char::*;
use std::cmp::*;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char) 
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

//const MAX:usize = 100006;

pub trait LexicalPermutation {
    fn next_permutation(&mut self) -> bool;
    fn prev_permutation(&mut self) -> bool;
}

impl<T> LexicalPermutation for [T] where T: Ord {
    fn next_permutation(&mut self) -> bool {
        if self.len() < 2 { return false; }
        let mut i = self.len() - 1;
        while i > 0 && self[i-1] >= self[i] {
            i -= 1;
        }
        if i == 0 {
            return false;
        }
        let mut j = self.len() - 1;
        while j >= i && self[j] <= self[i-1]  {
            j -= 1;
        }
        self.swap(j, i-1);
        self[i..].reverse();
        true
    }

    fn prev_permutation(&mut self) -> bool {
        if self.len() < 2 { return false; }
        let mut i = self.len() - 1;
        while i > 0 && self[i-1] <= self[i] {
            i -= 1;
        }
        if i == 0 {
            return false;
        }
        self[i..].reverse();
        let mut j = self.len() - 1;
        while j >= i && self[j-1] < self[i-1]  {
            j -= 1;
        }
        self.swap(i-1, j);
        true
    }
}

fn func(v: &Vec<i32>, a: &Vec<(i32,i32)>) -> f64 {
    let mut res: f64 = 0.0;
    for &x in v.iter() {
        if x == (v.len()-1) as i32 {continue}
        let it:usize = x as usize;
        let i:usize = v[it] as usize;
        let j:usize = v[it+1] as usize;
        let d_x:f64 = (a[i].0 - a[j].0).pow(2) as f64;
        let d_y:f64 = (a[i].1 - a[j].1).pow(2) as f64;
        let dist:f64 = (d_x + d_y).sqrt();
        res += dist;
    }
    res
}

fn main(){
    let n:i32 = read();
    let a:Vec<(i32,i32)> = (0..n).map(|_| (read(),read())).collect();

    let mut v: Vec<i32> = (0..n).collect();

    let mut c:i32 = 0;
    let mut ans: f64 = 0.0;
    loop {
        //println!("{:?}", v);
        c += 1;
        ans += func(&v, &a);
        if !v.next_permutation() {break}
    }
    //println!("{}", c);
    println!("{}", format!("{:.10}",ans/(c as f64)));
}

Measured memory_bytes: 4352
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		int ans = 0;
		for(int i=0;i<N;i++){
			var h = new HashSet<char>();
			for(int j=0;j<3;j++) h.Add(S[j][i]);
			
			if(h.Count == 2) ans+=1;
			if(h.Count == 3) ans+=2;
			
		}
		Console.WriteLine(ans);
	}
	int N;
	String[] S;
	public Sol(){
		N = ri();
		S = new String[3];
		for(int i=0;i<3;i++) S[i] = rs();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


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

int main(){
    int sx,sy,tx,ty; cin >>sx >> sy >> tx >> ty;
    int dx = tx - sx, dy = ty - sy;

    cout << string(dx,'R') << string(dy,'U');
    cout << string(dx, 'L') << string(dy, 'D');

    cout << 'L' << string(dy + 1, 'U') << string(dx + 1, 'R') << 'D';
    cout << 'R' << string(dy + 1, 'D') << string(dx + 1, 'L') << 'U';

    cout <<endl;
    
}

Measured memory_bytes: 256
/**
 *    author:  otera    
**/
#include<iostream>
#include<string> 
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm> 
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<int, int> P;
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

void solve() {
	int k, a, b; cin >> k >> a >> b;
    for(int i = a; i <= b; ++ i) {
        if(i % k == 0) {
            cout << "OK" << endl;
            return;
        }
    }
    cout << "NG" << endl;
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
// statics
using namespace std;
using int64 = int_fast64_t;
using PAIR = pair<int64, int64>;
constexpr int INF = 1 << 30;
constexpr int64 LINF = 1LL << 60;
constexpr int MOD = 1e9 + 7;
constexpr int MAX_N = 1e5 + 1;

// init/input
#define int int64
#define INIT ios::sync_with_stdio(false);cin.tie(0);
#define VAR(type, ...) type __VA_ARGS__;MACRO_VAR_Scan(__VA_ARGS__);
template<typename T> void MACRO_VAR_Scan(T &t) {cin>>t;}
template<typename First, typename...Rest> void MACRO_VAR_Scan(First &first, Rest&...rest) {cin>>first;MACRO_VAR_Scan(rest...);}
#define VEC(type, c, n) vector<type> c(n);for(auto &&i:c)cin>>i;

// out
#define OUT(dist) cout<<(dist);
#define FOUT(n, dist) cout<<fixed<<setprecision(n)<<(dist);
#define SP cout<<" ";
#define BR cout<<endl;
#define zero(n) cout<<setfill('0')<<right<<setw(n)
#define debug(x) cerr<<#x<<":"<< (x);BR;

// utility
#define ALL(a) (a).begin(), (a).end()
#define EACH(i, a) for(auto &&i:(a))
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define RFOR(i, a, b) for(int i=(b)-1;i>=0;--i)
#define REP(i, n) for(int i=0;i<(n);++i)
#define RREP(i, n) for(int i=(n)-1;i>=0;--i)

signed main() {
  INIT;
	VAR(string, s);

	int b = 0, w = 0, ans = 0;
	RREP(i, s.size()) {
		if (s[i] == 'B') {
			b++;
			ans += s.size() - i - 1;
		}
	}
	// debug(ans)BR;

	ans -= b* (b - 1) / 2;

	OUT(ans)BR;
	
  return 0;
}


Measured memory_bytes: 720
N, K = input().split()
D = input().split()
E = [str(x) for x in range(10) if str(x) not in D]
n = len(N)

next_digit = [(str(d), 0) if str(d) not in D else None for d in range(10)]
for i in range(9, -1, -1):
    if next_digit[i] is None:
        j = (i + 1) % 10
        while next_digit[j] is None:
            j = (j + 1) % 10
        if i < j:
            next_digit[i] = next_digit[j]
        else:
            next_digit[i] = (next_digit[j][0], 1)

for i in range(n):
    if N[i] in D:
        carry = 0
        j = i
        reverse_mid = ""
        while j >= 0:
            d = N[j]
            if carry == 1:
                if d == '9':
                    d = '0'
                else:
                    d = chr(ord(d) + 1)
                    carry = 0
            nd, carry0 = next_digit[int(d)]
            reverse_mid += nd
            carry += carry0
            if carry == 0:
                break
            j -= 1
        if carry == 1:
            head = next_digit[1][0]
        else:
            head = N[:j]
        N = head + reverse_mid[::-1] + (E[0] * (n - 1 - i))
        break
print(N)

Measured memory_bytes: 3064
#include <iostream>
using namespace std;
int main(void){
    string s;
    getline(cin,s);
    if(s[0]==s[1]&&s[1]==s[2]){
        cout<<"Yes";
    }
    else if(s[3]==s[2]&&s[1]==s[2]){
        cout<<"Yes";
    }
    else{
        cout<<"No";
    }

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include "atcoder/all"
typedef long long int ll;
using namespace std;
// using namespace atcoder;
int main() {
    int n, k, c;
    string s;
    cin >> n >> k >> c >> s;
    int used[n];
    memset(used, -1, sizeof(used));
    int index = 0;
    int count = 0;
    while ((index < n)&&(count < k)) {
        if (s[index] == 'o') {
            // cout << index << endl;
            // cout << count << endl;
            used[index] = count;
            index += c + 1;
            count++;
        }
        else {
            index++;
        }
    }
    index = n - 1;
    count = 0;
    vector<int> ans;
    while ((index >= 0)&&(count < k)) {
        if (s[index] == 'o') {
            // cout << index << endl;
            if (used[index] == k - count - 1) {
                ans.push_back(index);
            }
            index -= c + 1;
            count++;
        }
        else {
            index--;
        }
    }
    sort(ans.begin(), ans.end());
    for (int i = 0; i < ans.size(); i++) {
        cout << ans[i] + 1 << endl;
    }
    return 0;
}

Measured memory_bytes: 5172
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#define max(a,b) ((a)>(b)?(a):(b))
#define min(a,b) ((a)<(b)?(a):(b))
#define abs(x) ((x)>0?(x):(-(x)))
using namespace std;
const int maxn=3e5+10;
typedef double db;
const db PI=acos(-1);
struct point
{
	int x,y;
}p[maxn];
int X1,Y1,X2,Y2,n,stack[maxn],top=0,e[maxn],cnt=0,mix,maxx,may,miy;
db ans,tmp;
bool flag=0;
bool Find(int,bool);
bool cp(int,int);
bool check(point);
bool cmp(const int&,const int&);
void halfFind(int&,int&);
int main()
{
	scanf("%d%d%d%d%d",&X1,&Y1,&X2,&Y2,&n);
	if(X1>X2) swap(X1,X2),swap(Y1,Y2);
	if(Y1>Y2) Y1=-Y1,Y2=-Y2,flag=1;
//	mix=min(X1,X2),maxx=max(X1,X2);
//	miy=min(Y1,Y2),may=max(Y1,Y2);
//	flag=X1>X2?(Y1>Y2?0:1):(Y1>Y2?1:0);
	for(int i=1;i<=n;i++)
	{
		scanf("%d%d",&p[i].x,&p[i].y);
		if(flag) p[i].y=-p[i].y;
		if(check(p[i])) e[++cnt]=i;
	}
	sort(e+1,e+cnt+1,cmp);
	int len=0;
	for(int i=1;i<=cnt;i++)
	{
		int l=1,r=len,t=0;
		while(l<=r)
		{
			int mid=(l+r)>>1;
			if(p[e[i]].y>stack[mid]) l=(t=mid)+1;
			else r=mid-1;
		}
		if(t==len) stack[++len]=p[e[i]].y;
		else stack[t+1]=min(stack[t+1],p[e[i]].y);
	}
	ans=(X2-X1+Y2-Y1)*100.0;
	if(X1==X2||Y1==Y2)
	{
		if(cnt) ans+=10.0*PI-20.0;
	}
	else
	{
		ans-=(20.0-5.0*PI)*len;
		if(len==min(X2-X1,Y2-Y1)+1) ans+=5*PI;
	}
//	flag=X1>X2?(Y1>Y2?0:1):(Y1>Y2?1:0);
//	for(int i=1;i<=cnt;i++)
//	{
//		while(top&&cp(p[stack[top]].y,p[e[i]].y)) top--;
//		stack[++top]=e[i];
//	}
//	ans=(abs(X1-X2)+abs(Y1-Y2))*100.0;
//	tmp=(20-5*PI)*top;
//	if(top==min(maxx-mix,may-miy)+1) ans+=5*PI;
	printf("%.20f",ans);
	return 0;
}//(mix==p[stack[e[1]]].x&&maxx==p[stack[top]].x)||(miy==p[stack[e[1]]].y&&may==p[stack[top]].y)
bool cp(int x,int y)
{
	if(flag) return x>y;
	else return x<y;
}
bool cmp(const int &a,const int &b)
{
	return p[a].x<p[b].x;
}
bool check(point a)
{
	return a.x>=X1&&a.x<=X2&&a.y>=Y1&&a.y<=Y2;
}

Measured memory_bytes: 3840
// Undone
#include <bits/stdc++.h>
#define int long long
#define double long double
#define INF 1e18
using namespace std;
signed main() {
  int A, B;
  cin>>A>>B;
  int ans;
  if (A >= 13) {
    ans = B;
  } else if (6 <= A && A <= 12) {
    ans = B/2;
  } else {
    ans = 0;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
/*
 * ID: 2259
 * Problem: Programming contest
 */

#include <stdio.h>

int main(void)
{
    int members, problems;
    scanf("%d %d", &members, &problems);

    int max = 0;
    for (int i = 0; i < members; i++) {
        int sum = 0;
        for (int j = 0; j < problems; j++) {
            int status;
            scanf("%d", &status);
            sum += status;
        }
        if (max < sum)
            max = sum;
    }

    printf("%d\n", max);

    return 0;
}



Measured memory_bytes: 2104
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<unordered_map>
#include<stack>
#include<queue>
#include<iomanip>
#include<math.h>
#include<bitset>
#include<cassert>
#include<random>
#include<time.h>
#include<functional>
using namespace std;
using ll=long long;
using ld=long double;
using pint=pair<int,int>;
using pll=pair<ll,ll>;
#define MOD 1000000007LL
#define INF 1000000000LL
#define EPS 1e-10
#define FOR(i,n,m) for(ll i=n;i<(ll)m;i++)
#define REP(i,n) FOR(i,0,n)
#define DUMP(a) REP(d,a.size()){cout<<a[d];if(d!=a.size()-1)cout<<" ";else cout<<endl;}
#define ALL(v) v.begin(),v.end()
#define UNIQUE(v)  sort(ALL(v));v.erase(unique(ALL(v)),v.end());
#define pb push_back

string k;
ll d;
ll n;
ll dp[10010][100][2];

ll dfs(ll a, ll b, ll c) {
	if(dp[a][b][c] != -1) return dp[a][b][c];
	ll ret = 0;
	if(!a) {
		REP(i, 10) {
			if(!c && i > (k[a] - '0')) break;
			if(i % d == b) ret++;
		}
	} else {
		REP(i, 10) {
			if(!c && i > (k[a] - '0')) break;
			ll rem = ((b - i) % d + d) % d;
			if(!c && i != (k[a] - '0')) {
				ret += dfs(a - 1, rem, !c);
			} else {
				ret += dfs(a - 1, rem, c);
			}
		}
	}
	return dp[a][b][c] = ret % MOD;
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	cin >> k >> d;
	n = (ll)k.size();
	reverse(ALL(k));
	REP(i, 10010) REP(j, 100) REP(k, 2) dp[i][j][k] = -1;
	cout << ((dfs(n - 1, 0, 0) - 1) % MOD + MOD) % MOD << endl;
	return 0;
}

/* --------------------------------------- */


Measured memory_bytes: 16640
#include<bits/stdc++.h>
using namespace std;
int main()
{
    long long int n,i;
    cin>>n;
    long long int a[n],b[n],c[n];
    for(i=0;i<n;i++)
        cin>>a[i]>>b[i]>>c[i];
    long long int dpa[n][2],dpb[n][2],dpc[n][2];
    dpa[0][1]=a[0];
    dpb[0][1]=b[0];
    dpc[0][1]=c[0];
    dpa[0][0]=max(dpb[0][1],dpc[0][1]);
    dpb[0][0]=max(dpc[0][1],dpa[0][1]);
    dpc[0][0]=max(dpa[0][1],dpb[0][1]);
    for(i=1;i<n;i++)
    {
        dpa[i][1]=a[i]+dpa[i-1][0];
        dpb[i][1]=b[i]+dpb[i-1][0];
        dpc[i][1]=c[i]+dpc[i-1][0];

        dpa[i][0]=max(dpb[i][1],dpc[i][1]);
        dpb[i][0]=max(dpa[i][1],dpc[i][1]);
        dpc[i][0]=max(dpa[i][1],dpb[i][1]);
    }
    cout<<max(dpa[n-1][0],dpa[n-1][1]);
    return 0;
}


Measured memory_bytes: 7296
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}


struct FastIO{
  FastIO(){
    cin.tie(0);
    ios::sync_with_stdio(0);
  }
}fastio_beet;


template<typename T>
struct fraction{
  T num,dom;
  fraction(){}
  fraction(T n,T d):num(n),dom(d){
    assert(dom!=0);
    if(dom<0) num*=-1,dom*=-1;
    T tmp=__gcd(abs(num),abs(dom));
    num/=tmp;
    dom/=tmp;
  }
  fraction operator+(const fraction a) const{
    return fraction(num*a.dom+a.num*dom,dom*a.dom);
  }
  fraction operator-(const fraction a) const{
    return fraction(num*a.dom-a.num*dom,dom*a.dom);
  }
  fraction operator*(const fraction a) const{
    return fraction(num*a.num,dom*a.dom);
  }
  fraction operator/(const fraction a){
    return fraction(num*a.dom,dom*a.num);
  }
  fraction operator*(T k) const{return fraction(num*k,dom);}
  fraction operator/(T k) const{return fraction(num,dom*k);}
  bool operator<(const fraction a)const{
    return num*a.dom<a.num*dom;
  }
  bool operator>(const fraction a)const{
    return num*a.dom>a.num*dom;
  }
  bool operator==(const fraction a)const{
    return num*a.dom==a.num*dom;
  }
  bool operator!=(const fraction a)const{
    return num*a.dom!=a.num*dom;
  }
  bool operator<=(const fraction a)const{
    return num*a.dom<=a.num*dom;
  }
  bool operator>=(const fraction a)const{
    return num*a.dom>=a.num*dom;
  }
};

//INSERT ABOVE HERE
signed main(){
  Int n;
  cin>>n;
  vector<Int> as(n),bs(n);
  for(Int i=0;i<n;i++) cin>>as[i]>>bs[i];

  vector<Int> ls(n),rs(n);
  for(Int i=0;i<n;i++){
    ls[i]=as[i];
    rs[i]=max(0LL,bs[i]-as[i]);
  }

  using P = pair<Int, Int>;
  priority_queue<P> pq;
  Int sum=0;
  for(Int i=0;i<n;i++){
    sum+=rs[i];
    pq.emplace(-ls[i]-rs[i],i);
  }

  if(sum==0){
    cout<<0<<" "<<1<<endl;
    return 0;
  }

  Int cnt=0;
  vector<Int> used(n,0);
  while(sum+pq.top().first>=0){
    sum+=pq.top().first;
    used[pq.top().second]=1;
    pq.pop();
    cnt++;
  }

  using F = fraction<Int>;
  F ans(1,1);
  for(Int i=0;i<n;i++){
    Int tmp=sum;
    if(!used[i]){
      tmp-=rs[i];
    }else{
      tmp+=ls[i];
      tmp+=pq.top().first;
    }
    if(tmp<=as[i])
      chmin(ans,F(as[i]-tmp,bs[i]));
    // cout<<i<<" "<<tmp<<" "<<as[i]<<" "<<bs[i]<<endl;
  }
  F res=F(1,1)-ans;
  // cout<<res.num<<" "<<res.dom<<endl;

  Int num=cnt*res.dom+res.num;
  Int dom=res.dom*n;
  Int g=__gcd(num,dom);
  cout<<num/g<<" "<<dom/g<<endl;
  return 0;
}


Measured memory_bytes: 5744
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


int table[26];
char buf[30];

int main(){

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

		table[i] = 0;
	}

	scanf("%s",buf);
	for(int i = 0; buf[i] != '\0'; i++){

		table[buf[i]-'a']++;
		if(table[buf[i]-'a'] == 2){

			printf("no\n");
			return 0;
		}
	}

	printf("yes\n");

	return 0;
}


Measured memory_bytes: 3736