akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

int main()
{
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  string s;
  cin >> s;
  if (s.size() < 26) {
    set<char> t;
    for (char c : s) {
      t.insert(c);
    }
    for (char c = 'a'; c <= 'z'; ++c) {
      if (t.find(c) == t.end()) {
        s += c;
        break;
      }
    }
    cout << s << endl;
    return 0;
  }
  set<char> t;
  t.insert(s.back());
  for (int i = s.size() - 2; i >= 0; --i) {
    if (s[i] < s[i + 1]) {
      auto it = t.lower_bound(s[i]);
      char c = *it;
      cout << s.substr(0, i) + c << endl;
      return 0;
    }
    t.insert(s[i]);
  }
  cout << -1 << endl;
  return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>

int main(){
	//入力機構
	size_t N;
	std::cin>>N;
	std::vector<int> a;
	a.reserve(N);
	for(size_t i=0;i<N;i++){
		int num;
		std::cin>>num;
		a.push_back(num);
	}

	//解答
	//色の制限は10000色なので、N<=100より全てのスライムを違う色に変えることは可能である。
	//先頭からスライムを調べていき、連続して同じ色が並んでいたらあとに来るスライムの色を変えればよい。その回数を数える。
	size_t ans=0;
	for(size_t i=0;i+1<N;i++){
		//i番目とi+1番目を比較する
		if(a[i]==a[i+1]){
			ans++;//i+1番目のスライムの色を変えるので+1回
			i++;//i+1番目のスライムの色を変えたらi+1番目とi+2番目を比較する必要はないので次のループでi+2番目とi+3番目の比較になるようにiを調整する
		}
	}

	//結果出力
	std::cout<<ans<<std::endl;
	
	return 0;
}


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

#define ll long long
#define mtv(kit) cout<<#kit<<" - "<<kit<<"\n";
#define ff first
#define ss second
#define pb push_back
#define rep(i,a,b) for(i=a;i<b;i++)
#define pii pair<ll , ll>
#define all(x) x.begin(),x.end()
#define nl "\n"
#define ump unordered_map

void doit(){
    ll n,i,j,req;
    cin >> n >> req;
    vector<ll>vis(n+5,-1),Coun(n+5),v(n+2);
    for(i = 1; i <= n; i++)cin>>v[i];
    ll cycle = 1, cur = 1, in = 1, cou = 1, before = 0;
    while(true){
        if(vis[cur] != -1){
            before = vis[cur] - 1;
            cycle =  cou - vis[cur];
            break;
        }
        else {
            Coun[in] = cur;
            in++;
            vis[cur] = cou;
            cou++;
            cur = v[cur];
        }
    }
   // mtv(cycle)
    req ++;
    if(req <= before){
        cout << Coun[req] << nl;
        return;
    }
    req -= before;
    req %= cycle;
    if(req == 0)req = cycle;
  //  mtv(before + req)
    cout << Coun[before + req] << nl;
}

int main() {
#ifndef ONLINE_JUDGE
    freopen("input1.txt","r",stdin);
    freopen("output1.txt","w",stdout);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t = 1;
   // cin >> t;
    for(ll i = 1; i <= t; i++){
        doit();
    }
}


Measured memory_bytes: 7916
#include<iostream>
#include<cstdio>
#include<vector>
#include<string>
#include<cstring>
#include<functional>
#include<stack>
#include<queue>
#include <iomanip>
#include<map>
#include<limits>
#include<cmath>
#include<algorithm>
#include<bitset>
#include<utility>
#include<complex>
#include<cstdlib>
#include<set>
#include<cctype>

#define DBG cerr << '!' << endl;
#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define rep(i,s,g) for(ll (i) = (s);(i) < (g);++i)
#define rrep(i,s,g) for(ll (i) = (s);i >= (g);--(i))
#define PB push_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {for(int W = 0;W < (n);W++)cerr << v[W] << ' ';cerr << endl << endl;}
#define SHOW2d(v,i,j) {for(int aaa = 0;aaa < i;aaa++){for(int bbb = 0;bbb < j;bbb++)cerr << v[aaa][bbb] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(10)

using namespace std;

typedef long long ll;
typedef vector<int> iv;
typedef vector<iv> iiv;
typedef vector<string> sv;

char mp[200][200];

int main()
{
	int h,w;cin >> h >> w;
	
	REP(i,h)
	{
		REP(j,w)
		{
			cin >> mp[i][j];
		}
	}
	
	REP(i,h)
	{
		REP(q,2)
		{
			cout << mp[i] << endl;
		}
	}
	
	return 0;
}

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

int main() {
  	long long n, a, b;
  	cin >> n >> a >> b;
  	if(a > b) swap(a, b);
  	if((b-a)&1) {
      	long long k1 =  min(b-1, n-a);
      	long long k2 = a + (b-a)/2;
      	long long k3 = (n-b+1) + (b-a)/2;
      	cout << min({k1, k2, k3}) << '\n';
    }
  	else {
    	cout << (b-a)/2 << '\n';
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define ld long double
#define endl "\n"
using namespace std;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.precision(10);

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

    int b[n];
    for (int i=0;i<=n-1;i++)
    {
        cin >> b[i];
    }

    int c[n-1];
    for (int i=0;i<=n-2;i++)
    {
        cin >> c[i];
    }

    int ans=0;
    for (int i=0;i<=n-1;i++)
    {
        int id=a[i];
        id--;
        ans=ans+b[id];

        if (i!=n-1)
        {
            int next_id=a[i+1];
            next_id--;
            if (id+1==next_id)
            {
                ans=ans+c[id];
            }
        }
    }

    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3612
#include <stdio.h> 

 
 int main(){ 
     int x;
     int i=0; 
     while(1){ 
         scanf("%d", &x); 
         if(x==0)break; 
         printf("Case %d: %d\n", ++i, x); 
     } 
    return 0; 
 } 



Measured memory_bytes: 2032
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
  public static void main(String[] args) throws IOException {
    Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
    int n = in.nextInt();
    int W = in.nextInt();
    int[] w = new int[n];
    int[] v = new int[n];
    for (int i = 0; i < n; i++) {
      w[i] = in.nextInt();
      v[i] = in.nextInt();
    }
    final Solver solve = new Solver();
    System.out.println(solve.solve(W, w, v));
  }
}

class Solver {
  public long solve(int W, int[] w, int[] v) {
    int n = w.length;
    long[][] dp = new long[n+1][W+1];

    for (int i = 1; i <= n; i++) {
      for (int j = 1; j <= W; j++) {
        long val = 0;
        if (j - w[i-1] >= 0) {
          val = dp[i-1][j - w[i-1]] + v[i-1];
        }
        dp[i][j] = Math.max(dp[i-1][j], val);
      }
    }

    return dp[n][W];
  }
}


Measured memory_bytes: 126548
#include<iostream>
#include<iomanip>
#include<climits>
#include<vector>
#include<list>
#include<functional>
#include<algorithm>
#include<string>
#include<cmath>
#include<complex>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<tuple>
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;


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

	int N;
	cin >> N;
	vector<int> sum(N + 1);
	sum[0] = 0;
	REP(i, N) {
		int w;
		cin >> w;
		sum[i + 1] = sum[i] + w;
	}
	int res = INT_MAX;
	REP(i, N - 1) {
		res = min(res, abs(sum[N] - 2 * sum[i + 1]));
	}

	cout << res << endl;

	return 0;
}


Measured memory_bytes: 256
import sys
input=sys.stdin.readline

def warshallFloyd(V, dp):
    for k in range(V):
        for i in range(V):
            for j in range(V):
                dp[i][j] = min(dp[i][j], dp[i][k] + dp[k][j])

def main(args):
    H,W = map(int,input().split())
    cost = [[0] for _ in range(10)]
    for i in range(10):
        cost[i] = list(map(int,input().split()))
    
    wall = [[] for _ in range(H)]
    for i in range(H):
        wall[i] = list(map(int,input().split()))
    
    warshallFloyd(10, cost)
    
    cost_to_one = [0]*10
    for i in range(10):
        cost_to_one[i] = cost[i][1]
    
    #print(cost_to_one)
      
    ans = 0
    for i in range(H):
        for j in range(W):
            if wall[i][j] != -1:
                ans += cost_to_one[wall[i][j]]
    
    print(ans)
    
if __name__ == '__main__':
    main(sys.argv[1:])

Measured memory_bytes: 41564
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <list>
#include <queue>
#include <deque>
#include <algorithm>
#include <numeric>
#include <utility>
#include <complex>
#include <functional>
using namespace std;
const int MOD = 1000000007;
typedef long long ll;
const int INF = (1 << 28);
const int dx[4] = {0, 1, 0, -1}, dy[4] = {-1, 0, 1, 0};
const int Dx[8] = {0, 1, 1, 1, 0, -1, -1, -1}, Dy[8] = {-1, -1, 0, 1, 1, 1, 0, -1};
#define yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define no cout << "No" << endl
#define NO cout << "NO" << endl
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
int n;
int d[100000];
int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    for (int i = 0; i < n; i++)
        cin >> d[i];
    sort(d, d + n);
    cout << d[n / 2] - d[n / 2 - 1] << "\n";
}

Measured memory_bytes: 640
#include<iostream>
#include<vector>
#include<cstdio>
#include<string>
#include<numeric>
#include<algorithm>
#include<complex>
#include<queue>
#include<stdlib.h>
#include<map>
#include<cmath>
#include<stdio.h>
#include<stdlib.h>
#include<set>

#define ll long long

using namespace std;

int main(){
    ll N;
    cin >> N;
    vector<ll> num(N);
    ll sum2=0;
    for(int i=0;i<N;i++){
        cin >> num[i];
        sum2+=num[i];
    }
    ll sum1=0;
    vector<pair<ll,ll>> ans;
    for(int i=0;i<N;i++){
        sum1+=num[i];
        sum2-=num[i];
        ans.push_back(make_pair(sum1,sum2));
    }
    /*for(int i=0;i<N;i++){
        cout << ans[i].first << " " << ans[i].second << " ";
        cout << endl;
    }
    cout << endl;*/
    vector<ll> tmp(N);
    for(int i=0;i<N;i++){
        tmp[i]=abs(ans[i].first-ans[i].second);
    }
    sort(tmp.begin(),tmp.end());
    cout << tmp[0] << endl;
    return 0;
}


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

int main() {
	static char s[110];
	scanf("%s", s);
	int n = strlen(s);
	int ans = 0;
	for (int i = 0; i < n / 2; i++) {
		if (s[i] != s[n - 1 - i]) ans++;
	}
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#ifdef ONLINE_JUDGE
#define LLD "%I64d"
#else
#define LLD "%lld"
#endif
#define fu(a,b,c) for(int a=b;a<=(int)c;++a)
#define fd(a,b,c) for(int a=b;a>=(int)c;--a)
#define cu(a,b,c) for(int a=b;a<(int)c;++a)
#define cd(a,b,c) for(int a=(b)-1;a>=(int)c;--a)
#define gcd(a,b) __gcd(a,b) 
#define pii pair<int,int>
#define pll pair<long long,long long>
#define all(a) a.begin(),a.end()
#define F first
#define S second
#define pb push_back
#define pf push_front
#define MOD 1000000007 
#define MAXN 52
#define MAXH 20
#define MAXM 52
#define INF 100000000
#define ll long long
#define ull unsigned long long
#define RNG rng mt19937(time(NULL))
#define udist(a,b) uniform_int_distribution<uint32_t> distribution(a,b)
#define max3(a,b,c) max(a, max(b, c))
#define min3(a,b,c) min(a, min(b, c))
#define gmax(a,b) a = max(a, b)
#define gmin(a,b) a = min(a, b)
#define whatis(x) cerr << #x << " is " << x << endl;
#define fast_io() ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define PI 3.1415926535897932384626433
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

int main(){
	ll r,d,x;
	cin >> r >> d >> x;
	fu(i,1,10){
		x = r * x - d;
		cout << x << '\n';
	}
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N,Q;
  string S;
  cin >> N >> Q >> S;
  
  vector<int> l(Q);
  vector<int> r(Q);
  for(int i=0; i<Q; i++) cin >> l[i] >> r[i];
  
  //Sの１文字目からi文字目までの数　t
  vector<int> t(N);
  for(int i=1; i<N; i++) {
    t[i] = t[i-1];
    if(S[i-1]=='A' && S[i]=='C') t[i]+=1;
  }
  
  //出力
  for(int i=0; i<Q; i++) cout << t[r[i]-1] - t[l[i]-1] << endl;
}

Measured memory_bytes: 2176
n = int(input())
cnt = [0]*4
out = ["AC","WA","TLE","RE"]
for i in range(n):
  inp = input()
  if inp == out[0]:
    cnt[0] += 1
  if inp == out[1]:
    cnt[1] += 1
  if inp == out[2]:
    cnt[2] += 1
  if inp == out[3]:
    cnt[3] += 1
for i in range(4):
  print(out[i]+ " x " + str(cnt[i]))

Measured memory_bytes: 9080
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#define rep(i, n) for(int i = 0; i < (n); i++)
using namespace std;
using ll = long long;

ll c[51][51];

void comb_table(int n){
    for(int i = 0; i <= n; i++){
        for(int j = 0; j <= i; j++){
            if(i == j || j == 0) c[i][j] = 1LL;
            else c[i][j] = c[i-1][j-1] + c[i-1][j];
        }
    }
    return;
}

int main(){
    int n, a, b;
    cin >> n >> a >> b;
    ll v[n];
    map<ll, int> mp;
    rep(i, n){
        cin >> v[i];
        mp[v[i]]++;
    }
    sort(v, v + n);
    reverse(v, v + n);

    comb_table(n);

    double max_av = 0.0;
    int cnt = 0;
    rep(i, a){
        max_av += v[i];
        if(v[i] == v[a-1]) cnt++;
    }
    max_av /= a;

    ll pat = 0LL;
    if(cnt == a){
        for(int i = a; i <= min(b, mp[v[a-1]]); i++){
            pat += c[mp[v[a-1]]][i];
        }
    } else {
        pat += c[mp[v[a-1]]][cnt];
    }

    cout.precision(20);
    cout << fixed << max_av << endl;
    cout << pat << endl;
    return 0;
}

Measured memory_bytes: 256
//C - X: Yet Another Die Game: 
//Assunto: 
#include<bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define loop(i, a, b) for(int i = a; i < b; i++)
#define loopBack(i, a, b) for(int i = a; i >= b; i--)
#define INF INT_MAX
#define LINF LLONG_MAX
#define DINF DBL_MAX
#define MAX 100050
#define MOD 1000000007
using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;

int main() {
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    //freopen("in.txt", "r", stdin);
    //freopen("out.txt", "w", stdout);
    ll x, ans, aux;
    cin >> x;
    if(x <= 6) ans = 1;
    else if(x <= 11) ans = 2;
    else {
        //x *= 10;
        aux = x % 11;
        ans = (x / 11) * 2;
        if(aux != 0) {
            ans++;
            if(aux > 6) ans++;
        }
    }
    cout << ans << '\n';
}

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

using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define MIN(a, b) ((a) > (b) ? (b) : (a))
#define MAX(a, b) ((a) < (b) ? (b) : (a))

const long long INF = 1LL << 60;
typedef unsigned long long ll;
const long long MOD = 1000000000 + 7;

int main()
{
    int h, w;
    cin >> h >> w;
    vector<bool> sw(h, true), ww(w, true);
    string s[h];
    rep(i, h) cin >> s[i];
    rep(i, h)
    {
        rep(j, w)
        {
            if (s[i][j] == '#')
            {
                sw[i] = false;
                ww[j] = false;
            }
        }
    }
    rep(i, h)
    {
        bool bunish = true;
        rep(j, w)
        {
            if (sw[i] == true || ww[j] == true)
                continue;
            cout << s[i][j];
            bunish = false;
        }
        if (!bunish)
            cout << endl;
    }
    return 0;
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
using namespace std;
 
int main() {
	
    int N, R;
    cin >> N >> R;
    int rate;
    if (N<10){
        rate=R+100*(10-N);
    } else {
        rate=R;
    }
    cout << rate << endl;
    
    
}

Measured memory_bytes: 256
#include <iostream>
#include <stdio.h>
#include <bits/stdc++.h>
#include <vector>
#include <cmath>
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long ll;
using namespace std;

const ll MAX = 1000000;
const ll MOD = 1000000007;

ll fac[MAX];

// テーブルを作る前処理
/*
void COMinit() {
    fac[0] = fac[1] = 1;
    for (int i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
    }
}
*/

ll pow_kai(ll a,ll n){//aのn乗を計算します。
  ll x = 1;
  while(n > 0){//全てのbitが捨てられるまで。
    if(n&1){//1番右のbitが1のとき。
      x = x*a%MOD;
    }
    a = a*a%MOD;
    n >>= 1;//bit全体を右に1つシフトして一番右を捨てる。
  }
  return x;
}

// 二項係数計算
ll COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    ll tmp=1;
    for(ll i=n;i>=n-k+1;i--) tmp = (tmp*i)%MOD;

    return (tmp * pow_kai(fac[k],MOD-2)) % MOD;
}




int main()
{
    ll N;

    cin >> N;

    ll kouhuku[N][3],dp[N][3];

    rep(i,N) cin >> kouhuku[i][0] >> kouhuku[i][1] >> kouhuku[i][2];

    rep(j,3) dp[0][j]=kouhuku[0][j];

    for(int i=1;i<N;i++){
        rep(j,3){
            dp[i][j]=-100;
            rep(k,3){
                if(j!=k){
                    dp[i][j] = max(dp[i][j],dp[i-1][k]+kouhuku[i][j]); 
                }
            }
            
        }
        
    }

    cout << max(dp[N-1][0],max(dp[N-1][1],dp[N-1][2])) << endl;



 
    return 0;

}

Measured memory_bytes: 4992
parseInt(x) = parse(Int, x)
parseMap(x::Array{SubString{String},1}) = map(parseInt, x)

function main()
	a,b = readline() |> split |> parseMap
	f = 0
	for i in 1:100000
		if div(i*8,100)==a&&div(i*10,100)==b
			f = 1
			println(i)
			break
		end
	end
	if f == 0
		println(-1)
	end
end

main()

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

int main() {
  int A, B, C, D;
  cin >> A >> B >> C >> D;
  
  if (A + B > C + D)
    cout << "Left" << endl;
  else if (A + B == C + D)
    cout << "Balanced" << endl;
  else 
    cout << "Right" << endl;
}

Measured memory_bytes: 3628
#include <stdio.h>
#include <stdlib.h>
#define VMAX 10000

int main(){

  int C[VMAX+1];
  int i,j,n;
  int *A,*B;
  
  scanf("%d",&n);
  A=malloc(sizeof(int)*n);
  B=malloc(sizeof(int)*n);
  
  for(i=0;i<=VMAX;i++) C[i]=0;

  for(i=0;i<n;i++){
    scanf("%d",&A[i+1]);
    C[A[i+1]]++;
  }

  for(i=1;i<=VMAX;i++) C[i]+=C[i-1];

  for(j=1;j<=n;j++){
    B[C[A[j]]]=A[j];
    C[A[j]]--;
  }

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

  return 0;
}

Measured memory_bytes: 16276
#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <deque>
#include <numeric>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

#define rep(i, N) for(int i = 0; i < N; ++i)

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL

#define IN(l, r, x) ((l) <= (x) && (x) < (r))

s64 gcd(s64 x, s64 y)
{
    if (y == 0) return x;
    return gcd(y, x % y);
}
s64 lcm(s64 x, s64 y)
{
    s64 g = gcd(x, y);
    return x / g * y;
}


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

    s64 n, m;
    cin >> n >> m;

    vs64 a(n);
    s64 x = 1;
    s64 g = 0;
    rep (i, n)
    {
        cin >> a[i];
        a[i] /= 2;
        g = gcd(g, a[i]);
        x = lcm(x, a[i]);
        if (x > m)
        {
            cout << "0\n";
            return 0;
        }
    }

    rep (i, n)
    {
        if (a[i] / g % 2 == 0)
        {
            cout << "0\n";
            return 0;
        }
    }

    cout << (m - x) / (2 * x) + 1 << "\n";

    return 0;
}



Measured memory_bytes: 1024
import java.util.Scanner;

/**
 * @author kawakami
 *
 */
class Main {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		Scanner as = new Scanner(System.in);
		
		int n = as.nextInt();
        int m = as.nextInt();
        int l = as.nextInt();
        int i,j,k;
        long sum;
        
        long A[][];
        long B[][];
        long C[][];
        A = new long[n][m];   //??????
        B = new long[m][l];
        C = new long[n][l];
        String str;
        
        for(i=0;i<n;i++){          
            for(j=0;j<m;j++){
                 
                A[i][j] = as.nextInt();     //?????????????´?
                 
            }
        }
        
        for(i=0;i<m;i++){          
            for(j=0;j<l;j++){
                 
                B[i][j] = as.nextInt();     //?????????????´?
                 
            }
        }
        
        for(i=0;i<n;i++){          
            for(j=0;j<l;j++){
            	
            	sum = 0;
            	
            	for(k=0;k<m;k++){
            	
            		sum = sum + A[i][k]*B[k][j];    //?????????????´?
            		
            	}
            	
            	C[i][j] = sum;
            	
            }
        }
        
        /*if(n >= 100 && m >= 100 && l >= 100){
        	
        	str = "Too Large";
            System.out.print(str);
        	
        }*/
        //else{
     	for(i=0;i<n;i++){
            for(j=0;j<l;j++){
                 
                if(j != l-1){
                	
                	str = String.valueOf(C[i][j]) + " ";
                    System.out.print(str);
                	
                }
                else{
                	
                	str = String.valueOf(C[i][j]);
                    System.out.print(str);
                	
                }
                 
            }
            
            System.out.println();
            
        }
        //}
        
	}

}

Measured memory_bytes: 54172
#include <bits/stdc++.h>
#define FOR(i, m, n) for (int i = m; i < (n); i++)
#define RFOR(i, m, n) for (int i = (m - 1); i >= 0; i--)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) RFOR(i, n, 0)
#define ALL(v) v.begin(), v.end()
#define RALL(v) v.rbegin(), v.rend()
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;

ll gcd(ll x, ll y) { return y ? gcd(y, x % y) : x; }

int main() {
  ll w, h, x, y;
  cin >> w >> h >> x >> y;

  double anser = (double)w * h / 2;
  int number = (x * 2 == w && y * 2 == h) ? 1 : 0;

  printf("%.10f %d\n", anser, number);
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>

int main(void){
    int count[100]={0};
    char raw[200];
    int i,k,n,p,l;
    unsigned long len;
    char tmp[1000];
    char end[]="-";
    
    while(1){
        scanf("%s",raw);
        if(strcmp(&*end,raw)==0)
            break;
        len=strlen(raw);
        scanf("%d",&n);
        for(i=0;i<n;i++){
            scanf("%d",&count[i]);
            for(k=0;k<count[i];k++){
                tmp[k]=raw[k];
            }
            for(l=0;l<len-count[i];l++){
                raw[l]=raw[count[i]+l];
            }
            for(p=0;p<count[i];p++){
                raw[len-count[i]+p]=tmp[p];
            }
        }printf("%s\n",raw);
    }
    return 0;
}

Measured memory_bytes: 592
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

int main() {
    int A, B, C, D, E, F; cin >> A >> B >> C >> D >> E >> F;
    int satoumizu = 100*A;
    int satou = 0;
    double noudo = 0;
    for (int a = 0; a*A*100 <= F; a++){
        for (int b = 0; b*B*100 <= F; b++){
            if(a*A*100 + b*B*100 > F)break;
            int water = a*A*100 + b*B*100;
            for (int c = 0; c < 100; c++){
                for (int d = 0; d < 100; d++){
                    int sugar = C*c + D*d;
                    if(water + sugar > F)break;
                    int tokeru = (water/100) * E;
                    if(sugar > tokeru)break;
                    double noudonow = (100.0*sugar) / (water + sugar);
                    if(noudonow > noudo){
                        noudo = noudonow;
                        satoumizu = water + sugar;
                        satou = sugar;
                    }
                }
            }
        }
    }

    cout << satoumizu << " " << satou << endl;

    return 0;
}

Measured memory_bytes: 3584
#![allow(non_snake_case)]
fn main(){
   let dataset  = readln();
   for d in 0..dataset{
       let mut v:Vec<f64> = readln();
       let res=center_of_circle(v);
       println!("{:.3} {:.3} {:.3}",res.0,res.1,res.2);
    }
}

//(x1,y1,x2,y2,x3,y3)->(x0,y0,R)
fn center_of_circle(v: Vec<f64>) -> (f64,f64,f64){
    let x1=v[0];let x2=v[2];let x3=v[4];let y1=v[1];let y2=v[3];let y3=v[5];
    let mut x0 = (x1*x1+y1*y1)*(y2-y3)+(x2*x2+y2*y2)*(y3-y1)+(x3*x3+y3*y3)*(y1-y2);
    x0=0.5*x0/(x1*(y2-y3)+x2*(y3-y1)+x3*(y1-y2));
    
    let mut y0 = (x1*x1+y1*y1)*(x2-x3)+(x2*x2+y2*y2)*(x3-x1)+(x3*x3+y3*y3)*(x1-x2);
    y0=0.5*y0/(y1*(x2-x3)+y2*(x3-x1)+y3*(x1-x2));


    let mut R=(( (x1-x2)*(x1-x2) + (y1-y2)*(y1-y2) )*( (x2-x3)*(x2-x3) + (y2-y3)*(y2-y3) )*( (x3-x1)*(x3-x1) + (y3-y1)*(y3-y1) )).sqrt();
    R=R*0.5/(x1*(y2-y3) + x2*(y3-y1) + x3*(y1-y2)).abs();
    return (x0,y0,R);


}


// --- template ---
#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
 
pub trait FromLn {
    fn fromln(s: &str) -> Self;
}
pub fn readln<T: FromLn>() -> T {
    let mut buf = String::new();
    let _ = ::std::io::stdin().read_line(&mut buf).unwrap();
    T::fromln(buf.trim())
}
pub fn readlns<T: FromLn>(n: usize) -> Vec<T> {
    let mut vs = vec![];
    for _ in 0..n {
        vs.push(readln());
    }
    vs
}
macro_rules! fromln_primitives {
    ($($t:ty),*) => { $(
        impl FromLn for $t {
            fn fromln(s: &str) -> $t {
                s.parse().unwrap()
            }
        }
    )* }
}
fromln_primitives!(
    String,
    bool,
    f32,
    f64,
    isize,
    i8,
    i16,
    i32,
    i64,
    usize,
    u8,
    u16,
    u32,
    u64
);
impl<T> FromLn for Vec<T>
where
    T: FromLn,
{
    fn fromln(s: &str) -> Vec<T> {
        s.split_whitespace().map(T::fromln).collect()
    }
}
impl FromLn for Vec<char> {
    fn fromln(s: &str) -> Vec<char> {
        s.chars().collect()
    }
}
macro_rules! fromln_tuple {
    ($($t:ident),*) => {
        impl<$($t),*> FromLn for ($($t),*) where $($t: FromLn),* {
            fn fromln(s: &str) -> ($($t),*) {
                let mut it = s.split_whitespace();
                let t = ($($t::fromln(it.next().unwrap())),*);
                assert_eq!(it.next(), None);
                t
            }
        }
    }
}
fromln_tuple!(A, B);
fromln_tuple!(A, B, C);
fromln_tuple!(A, B, C, D);
fromln_tuple!(A, B, C, D, E);
fromln_tuple!(A, B, C, D, E, F);



Measured memory_bytes: 5088
#include<stdio.h>
int main()
{
	int x,a,b;
	scanf("%d %d %d",&x,&a,&b);
	if(a>=b){
		printf("delicious\n");
	}
	else{
		if(b-a<=x){
			printf("safe\n");
		}
		else{
			printf("dangerous\n");
		}
	}
	return 0;
}

Measured memory_bytes: 1628
#include<bits/stdc++.h>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/pb_ds/assoc_container.hpp>
using namespace std;
using namespace __gnu_pbds;
#define ll long long
#define inf 2000000000
#define infLL 2000000000000000000
#define MAX 500005
#define mx 10004
#define sf(a) scanf("%d", &a)
#define sfl(a) scanf("%lld", &a)
#define pf(a) printf("%d ", a)
#define pfl(a) printf("%lld\n", a)
#define Case(t) printf("Case %d: ", t)
#define pii pair<int, int>
#define MOD 1000000007
#define mod 1000000009
#define PI acos(-1.0)
#define eps 1e-9
#define mem(a, b) memset(a, b, sizeof(a))
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);

#define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }

inline int Set(int N, int pos){return N=N | (1<<pos);}
inline int Reset(int N, int pos){return N=N & ~(1<<pos);}
inline bool Check(int N, int pos){return (bool)(N & (1<<pos));}

inline void normal(ll &a) { a %= mod; (a < 0) && (a += mod); }
inline ll modMul(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a * b) % mod; }
inline ll modAdd(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); return (a + b) % mod; }
inline ll modSub(ll a, ll b) { a %= mod, b %= mod; normal(a), normal(b); a -= b; normal(a); return a; }
inline ll modPow(ll b, ll p) { ll r = 1; while (p) { if (p & 1LL) r = modMul(r, b); b = modMul(b, b); p >>= 1LL; } return r; }
inline ll modInverse(ll a) { return modPow(a, mod - 2); }
inline ll modDiv(ll a, ll b) { return modMul(a, modInverse(b)); }

ll fast_exp(ll x, ll n, ll m)
{
    ll res = 1;
    while(n>0)
    {
        if(n%2==1)
            res = (res * x) % m;
        x = (x * x) % m;
        n/=2;
    }
    return res%m;
}

void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
    cerr << *it << " = " << a << endl;
    err(++it, args...);
}

clock_t t_Start;
void Start()
{
    t_Start = clock();
}
void End()
{
    double Time = (double)(clock()-t_Start)/CLOCKS_PER_SEC;
    error(Time);
}

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>orderedSet;
typedef tree<int,null_type,greater<int>,rb_tree_tag,tree_order_statistics_node_update>orderedSet1;

int Tree[MAX][26], a[MAX];

int query(int idx, int p)
{
    int sum = 0;
    while(idx>0)
    {
        sum+=Tree[idx][p];
        idx-=idx&(-idx);
    }
    return sum;
}

void update(int idx, int p, int x, int n)
{
    while(idx<=n)
    {
        Tree[idx][p]+=x;
        idx+=idx&(-idx);
    }
}

int main()
{
    //freopen("in.txt","r",stdin);
    //freopen("out.txt","w",stdout);
    //Start();

    int n;
    cin>>n;
    cout<<(n+1)/2<<endl;

    //End();
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<vector>
using namespace std;
#define lp(i, n)        for(int i=0; i<(int)(n); ++i)
int main() {
  int a,b,c,d;
  cin>>a>>b;
  c=b+b+1;
  d=a/c;
  if(d*c==a)cout<<d;
  else cout<<d+1;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define lc "\n"
#define fast_io ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(0)
#define mp make_pair
#define pb push_back
#define fi first
#define se second
#define int long long
#define c(a,n) for(size_t i = 0; i < n; i++) cin >> a[i];
#define ffor(n) for(size_t i = 0; i < n; i++)
#define asort(a) sort(a.begin(), a.end())
#define rsort(a) sort(a.begin(), a.end(), greater<int>())
 
typedef vector<int> vi;
typedef vector<float> vf;
typedef vector<vi> vii;
typedef vector<string> vs;
typedef vector<long long> vll;
typedef map<string,int> msi;
typedef map<int,int> mii;
typedef unordered_map<string,int> umsi;
 
 
int32_t main()
{
    fast_io;
    string s, t;
    cin >> s >> t;
    int same = 0, m = 0;
    for(int i = 0; i < s.length(); i++)
    {
        int m = 0;
        int k = i;
        for(int j = 0; j < t.length() && i+(t.length()-1) < s.length(); j++, k++)
        {
            if(s[k] == t[j])
                m++;
        }
        if(m > same)
            same = m;
    }
    cout << t.length()-same;
    return 0;
}

Measured memory_bytes: 3644
#include<stdio.h>
#include<stdlib.h>
#include<stdarg.h>
#include<string.h>
#include<math.h>
#include<limits.h>
#define max(x,y) (x)>(y)?(x):(y)
#define min(x,y) (x)<(y)?(x):(y)
#define rep(i,n) for((i)=0;(i)<(n);(i)++)
#define reps(i,n,k) for((i)=0;(i)<(n);(i)+=(k))
#define MOD ((int)1e9+7)
#define INF INFINITY
typedef long long ll;
typedef unsigned long long ull;
typedef struct pair_{int x,y;}pair_t;
void swap(int *x, int *y){int t=*x;*x=*y;*y=t;}
void debug(char *f, ...){va_list a;va_start(a,f);vfprintf(stderr,f,a);va_end(a);}
int asc_cmp(const void *x, const void *y){int X=*((int*)x),Y=*((int*)y);if(X<Y)return -1;else if(X>Y)return 1;else return 0;}
int desc_cmp(const void *x, const void *y){int X=*((int*)x),Y=*((int*)y);if(X<Y)return 1;else if(X>Y)return -1;else return 0;}

int main(){
    double r;scanf("%lf",&r);
    printf("%lf\n",2*r*3.1415);
}


Measured memory_bytes: 1740
icase=0
if icase==0:
    n=int(input())
    v=list(map(int,input().split()))
    c=list(map(int,input().split()))
    tmax=0
    for i in range(n):
        total = 0
        for j in range(n):
            total = total+max(0,v[j]-c[j])   
        tmax=max(tmax,total)
    print(tmax)

Measured memory_bytes: 38256
import java.util.Scanner;
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int x = sc.nextInt();
        List<Integer> a = new ArrayList<>();
        for (int i = 0; i < n; i++) {
            a.add(sc.nextInt());
        }
        Collections.sort(a);
        int cnt = 0;
        for (int i = 0; i < n - 1; i++) {
            if (x < a.get(i)) {
                break;
            }
            x -= a.get(i);
            cnt++;
        }
        if(x == a.get(n-1)){
            cnt++;
        }
        System.out.println(cnt);
    }
}


Measured memory_bytes: 21844
#include <algorithm>
#include <cctype>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <string>
#include <vector>

using namespace std;

#define reps(i,f,n) for(int i=f; i<int(n); ++i)
#define rep(i,n) reps(i,0,n)

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pii;

const int INF = 1001001001;
const ll FINAL = 0x0ba9876543210ll;

struct Data
{
	ll s;
	int d;
	bool f;
	Data(ll s, int d, bool f) : s(s), d(d), f(f) {}
};

int bfs(ll init)
{
	if(init == FINAL)
		return 0;
	
	const int move[13][5] = {
		{2, -1},
		{2, 5, -1},
		{0, 1, 3, 6, -1},
		{2, 7, -1},
		{5, -1},
		{1, 4, 6, 9, -1},
		{2, 5, 7, 10, -1},
		{3, 6, 8, 11, -1},
		{7, -1},
		{5, 10, -1},
		{6, 9, 11, 12, -1},
		{7, 10, -1},
		{10, -1}
	};
	
	set<ll> visited[2];
	queue<Data> Q;
	Q.push(Data(init, 0, false));
	Q.push(Data(FINAL, 0, true));
	visited[0].insert(init);
	visited[1].insert(FINAL);
	int now[2] = {0};
	
	while(!Q.empty()){
		Data data = Q.front();
		Q.pop();
		now[data.f] = data.d + 1;

		for(int i=0, cnt=2; cnt; ++i){
			if(((data.s>>(i*4)) & 0xfll) == 0){
				for(int j=0; move[i][j]!=-1; ++j){
					ll next = data.s;
					next &= ~((0xfll << (i*4)) | (0xfll << (move[i][j]*4)));
					next |= ((data.s >> (move[i][j]*4)) & 0xfll) << (i*4);
					
					if(visited[!data.f].find(next) != visited[!data.f].end())
						return now[0] + now[1];

					if(visited[data.f].find(next) == visited[data.f].end()){
						visited[data.f].insert(next);
						if(data.d < 10)
							Q.push(Data(next, data.d+1, data.f));
					}
				}
				--cnt;
			}
		}
	}
	return -1;
}

int main()
{
	for(;;){
		int input[13];
		rep(i, 13){
			scanf("%d", &input[i]);
			if(input[i] == -1)
				return 0;
		}

		ll init = 0;
		rep(i, 13)
			init = (init << 4) | input[12-i];

		int ans = bfs(init);
		if(ans == -1 || ans > 20)
			puts("NA");
		else
			printf("%d\n", ans);
	}
}

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

using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef long double ld;
typedef vector<ld> vd;
typedef bool bl;
typedef vector<bl> vb;
typedef vector<vl> mt;
typedef unordered_map<ll,unordered_map<ll,ll>> graph;
typedef pair<ll,ll> pl;
typedef pair<ld,ld> pd;
typedef vector<string> vs;
typedef vector<vs> table;
typedef vector<vl> v2;
typedef vector<v2> v3;
typedef vector<v3> v4;


const ll e5 = 1 << 20;
const ll mods[] = {998244353, 1000000007, 1000000009};
const ll bases[] = {997, 1009, 1013};
const ll mod = 1000000007;
const ll e3 = 1 << 13;
const ll INF = 1ll << 50;

vl hash1;
vl pow1;
vl hash2;
vl pow2;

ll get(ll l,ll r){
  ll ret1 = ((hash1[r]-(hash1[l]*pow1[r-l])%mods[1]+mods[1])%mods[1]);
  ll ret2 = ((hash2[r]-(hash2[l]*pow2[r-l])%mods[2]+mods[2])%mods[2]);
  return ret1*ret2;
}

ll n;
string s;
ll ans;

int main(){
  cin >> n;
  cin >> s;
  hash1 = vl(n+1, 0);
  hash2 = vl(n+1, 0);

  pow1 = vl(n+1, 1);
  pow2 = vl(n+1, 1);
  for(ll i = 0;i < n;i++){
    hash1[i+1] = ((hash1[i]+s[i])*bases[1])%mods[1];
    pow1[i+1] = (pow1[i]*bases[1])%mods[1];
    hash2[i+1] = ((hash2[i]+s[i])*bases[2])%mods[2];
    pow2[i+1] = (pow2[i]*bases[2])%mods[2];
  }
  for(ll i = 1;i <= n;i++){
    unordered_map<ll,ll> m;
    for(ll j = 0;j+i <= n;j++){
      if(m.find(get(j,j+i)) != m.end()){
        if(j-m[get(j,j+i)] >= i){
          ans = i;
          break;
        }
      }else{
        m[get(j,j+i)] = j;
      }
    }
  }

  cout << ans << endl;
}


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

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	int n, m, cnt[100010];
	cin >> n >> m;
	for (int i = 1; i <= n; ++i)
		cnt[i] = 0;
	for (int i = 0; i < m; ++i)
	{
		int a, b;
		cin >> a >> b;
		++cnt[a];
		++cnt[b];
	}
	for (int i = 1; i <= n; ++i)
	{
		if (cnt[i] % 2 == 1)
		{
			cout << "NO\n";
			return 0;
		}
	}
	cout << "YES\n";
	return 0;
}

Measured memory_bytes: 640
s = list(input())
a = {'1': '0', '0': '1'}
if len(s) == 1:
    print(0)
else:
    r = 0
    for i in range(len(s) - 1):
        if s[i] == s[i+1]:
            r += 1
            s[i+1] = a[s[i]]
    print(r)

    

Measured memory_bytes: 3956
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
//#include <atcoder/all>
//using namespace atcoder;
using namespace std;
#define all(v) v.begin(), v.end()
using in = int64_t;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define YES cout<<"YES"<<endl
#define NO cout<<"NO"<<endl
const double PI=3.14159265358979323846;
const in MOD = 1000000007;
const in INF=1e18+7;
const int inf=1e9+7;
using P=pair<int,int>;
vector<int> dx={0,1,-1,0};
vector<int> dy={1,0,0,-1};


int main(){
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cout << fixed << setprecision(10);
    in a,b,c,d;
    cin>>a>>b>>c>>d;
    in a1=a*c, a2=a*d, a3=b*c, a4=b*d;
    cout<<max(a1,max(a2,max(a3,a4)))<<endl;
}/*
./problem.exe
*/

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pii pair<int,int>
inline int read()
{
	int x=0;
	bool pos=1;
	char ch=getchar();
	for(;!isdigit(ch);ch=getchar())
		if(ch=='-')
			pos=0;
	for(;isdigit(ch);ch=getchar())
		x=x*10+ch-'0';
	return pos?x:-x;
}
int main()
{
	int a=read(),b=read();
	if(b%a==0)
		cout<<b+a<<endl;
	else
		cout<<b-a<<endl;
	return 0;
}


Measured memory_bytes: 256
/* Alohomora */
        #include<bits/stdc++.h>
        #define ll         long long
        #define fl(i,n)    for(i=0;i<n;i++)
        #define fld(i,a,b) for(i=a;i>b;i--)
        #define fli(i,a,n) for(i=a;i<n;i++)
        #define inp(i,a,n) for(i=0;i<n;i++) {cin>>a[i];}
        #define op(i,a,n)  for(i=0;i<n;i++) {cout<<a[i]<<" ";}
        #define pb         push_back
        #define mp         make_pair
        #define mod        1000000007 
        #define all(x) 	   x.begin(),x.end()	
        #define speedup    ios_base::sync_with_stdio(false),cin.tie(0)
        #define bada 1000000000000000005
        using namespace std;
        ll fact(ll n){ if(n==0){return 1;}return (n*fact(n-1))%mod;}
        ll power(ll x, ll y){ll out = 1;while (y > 0){if (y & 1) out=(out*x)%mod;y = y>>1;x = (x*x)%mod;}return out%mod;}
        ll inverse(ll a){return power(a,mod-2);}
        ll gcd(ll a,ll b){if(b==0){return a;}gcd(b,a%b);}
        ll a[2000000];
        void sieve(){ll i,j;fli(i,2,1000001){if(a[i]==0){for(j=i*i;j<1000001;j+=i){a[j]=i;}}}}
        bool compar(const pair<ll,ll> &a, const pair<ll,ll> &b) 
        { 
            return (a.second < b.second);
        }
        void comp()
        {
        	ll i,j,k,a,b;
        	ll n,p;
        	cin>>n;
        	vector<ll>v1;
        	fl(i,n)
        	{
        		cin>>j;
        		v1.pb(j);
        	}
        	ll dp[n+1];
        	dp[0]=0;
        	dp[1]=abs(v1[1]-v1[0]);
        	fli(i,2,n)
        	{
        		dp[i]=min((dp[i-1]+abs(v1[i]-v1[i-1])),dp[i-2]+abs(v1[i-2]-v1[i]));
        	}
        	cout<<dp[n-1];
        }
        int main()
        {
        	speedup;
        	ll i=0,t;
        	//cin>>t;
        	t=1;
        	while(t--)
        	{
        	 comp();
        	}
        }

Measured memory_bytes: 1908
#include <iostream>
#include <algorithm>
#include <string>
using namespace std;

int main() {
	int A,B,C;
	cin >> A >> B >>C;
	
	for(int i=1; i<=B; i++){
		if(i*A%B==C){
			cout <<"YES"<<endl;
			return 0;
		}
	}
	
	cout << "NO" << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <ctime>
using namespace std;

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

#define all(c) (c).begin(), (c).end()
#define pb push_back
#define mp make_pair
#define EXIST(v,i) (find(all(v), i) != (v).end())
#define ERASE(v,i) (v).erase(remove(all(v), i), (v).end())
#define INDEX(v,i) (find(all(v), i) - (v).begin())
#define rep(i,n) for(int i = 0; i < (int)n; ++i)
#define debug(x) cerr << #x << " = " << (x) << endl;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

const int INF = 100000000;
const double PI = 3.14159265358979323846;
const double EPS = 1e-10;

int main() {
	string line;
	getline(cin, line);
	for(int i = 0, n = line.length(); i < n; i++) {
		if('a' <= line[i] && line[i] <= 'z') {
			line[i] += 'A' - 'a';
		}
	}
	cout << line << endl;
	return 0;
}

Measured memory_bytes: 0
<?php

while (($line = trim(fgets(STDIN))) !== '') {
    sscanf($line, '%d %d %d', $a, $b, $n);
    $s = 0;
    $tmp = $a % $b;
    for ($i = 0; $i < $n; $i++) {
        $s += (int)($tmp * 10 / $b);
        $tmp = $tmp * 10 % $b;
    }
    echo $s, PHP_EOL;
}

Measured memory_bytes: 6596
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<set>
#include <initializer_list>
#include<unordered_set>
#include<map>
#include<cmath>
#include <iterator>
#include<stack>
#include<queue>
#include <iomanip>
#include<math.h>
#include <limits.h>
#include <numeric>
#include <functional>
#include<fstream>

    using namespace std;

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



Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <cctype>
#include <complex>
#include <string>
#include <sstream>
#include <fstream>
#include <cassert>
using namespace std;

//common
typedef long long i64,ll;

#define BR "\n"
#define ALL(c) (c).begin(),(c).end()
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define FOR(i,l,r) for(int i=(l);i<(int)(r);++i)
#define EACH(it,o) for(auto it = (o).begin(); it != (o).end(); ++it)
#define IN(l,v,r) ((l)<=(v) && (v)<(r))

//debug
#ifdef NDEBUG
#define DUMP(x)
#define DUMPLN(x)
#define DEBUG(x)
#define DEBUGLN(x)
#define LINE()
#define LINELN()
#define CHECK(exp,act)
#define STOP(e)
#else
#define DUMP(x)  cerr << #x << " = " << (x)
#define DUMPLN(x)  DUMP(x) <<endl
#define DEBUG(x) DUMP(x) << LINE() << " " << __FILE__
#define DEBUGLN(x) DEBUG(x)<<endl
#define LINE()    cerr<< " (L" << __LINE__ << ")"
#define LINELN()    LINE()<<endl
#define CHECK(exp,act)  if(exp!=act){DUMPLN(exp);DEBUGLN(act);}
#define STOP(e)  CHECK(e,true);if(!(e)) exit(1);
#endif

template<class T> inline string toString(const vector<T>& x) {
	stringstream ss;
	REP(i,x.size()){
		if(i!=0)ss<<" ";
		ss<< x[i];
	}
	return ss.str();
}

template<class T> inline string toString(const vector<vector<T> >& map) {
	stringstream ss;
	REP(i,map.size()){
		if(i!=0)ss<<BR;
		ss<< toString(map[i]);
	}
	return ss.str();
}
template<class K,class V>  string toString(map<K,V>& x) {
	string res;stringstream ss;
	for(auto& p:x)ss<< p.first<<":" << p.second<<" ";
	return ss.str();
}

string BITtoString(int bit){
    stringstream ss;
    while(bit!=0){ss<<(bit%2);bit/=2;}
    string res=ss.str();reverse(ALL(res));
    return res;
}

template<typename T,typename V> inline T pmod(T v,V MOD){
	return (v%MOD+MOD)%MOD;
}

class Main{
public:
	
	void run(){
		while(true){
			int N;cin >> N;if(N==0)break;
			vector<int> hs(N+1);REP(i,N+1) cin >> hs[i];

			for(int e=0;e<N+1;e++){
				vector<int> ts(N);
				int j=0;
				for(int i=0;i<N+1;i++)if(i!=e)ts[j++]=hs[i];

				bool ok=true;
				int d=ts[1]-ts[0];
				for(int i=1;i<N;i++)if(d!=ts[i]-ts[i-1])ok=false;
				if(ok){
					cout << hs[e]<<endl;break;
				}
			}
		}
	}
};

 int main(){
	//ios::sync_with_stdio(false);
 	Main().run();
 	return 0;
 }

Measured memory_bytes: 1204
#include <cctype>
#include <cerrno>
#include <cfloat>
#include <ciso646>
#include <climits>
#include <clocale>
#include <cmath>
#include <csetjmp>
#include <csignal>
#include <cstdarg>
#include <cstddef>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>

#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <regex>
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,j,n) for(int i = j; i < n; i++)
#define RFOR(i,j,n) for(int i = j-1; i >= n; i--)
#define PREC(n) fixed << setprecision(n)
#define print_array(v) REP(__k, v.size()) { cout << v[__k]; if(__k != v.size()-1) cout << " "; else cout << endl; }
#define YesorNo(a) printf(a?"Yes\n":"No\n")
#define _LIBCPP_DEBUG 0
using namespace std;
int64_t MOD = 1000000007;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a, b;
  cin >> a >> b;
  cout << (a == b ? "Yes" : "No") << endl;
  return 0;
}
//templete by private_yusuke

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

#define fastio 			ios::sync_with_stdio(0);	cin.tie(0); cout.tie(0);  cout<<fixed;  cout<<setprecision(12);
#define randomINT 		mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
#define	newl 			cout<<"\n"
#define DISP(as)		for(auto it : as) cout<<it<<" ";newl;
#define all(x)         	(x).begin(),(x).end()
#define mset(x,val)    	memset(x,val,sizeof(x))
#define newl           	cout<<"\n"
#define pb             	push_back
#define mp             	make_pair
#define f 				first
#define s 				second
#define dline          cerr<<"///REACHED///\n";
#define deb1(x)        cerr<<#x<<" = "<<x<<'\n';
#define deb2(x,y)      cerr<<'['<<#x<<','<<#y<<"] = "<<'['<<x<<','<<y<<']'<<'\n';
#define deb3(x,y,z)    cerr<<'['<<#x<<','<<#y<<','<<#z<<"] = "<<'['<<x<<','<<y<<','<<z<<']'<<'\n';

typedef long long 				ll;
typedef long double 			ld;
typedef vector<ll> 				vll;
typedef pair<ll , ll> 			pll;
typedef pair<ld, ld> 			pld;
typedef unordered_map<ll, ll> 	um;
typedef vector<pll> 			vpll;

const ll 	MAX5 	= 	1e+5 + 7;
const ll 	MAX7 	= 	1e+7 + 7;
const ll 	MAXN 	= 	MAX7;
const ll   	INF   	=  	0x7f7f7f7f7f7f7f7f;
const int  	INFi 	=  	0x7f7f7f7f;
const ll 	MOD		=  	1e+9 + 7;

int dx4[] = {0, 1, 0, -1}, dy4[] = {1, 0, -1, 0};

// <------------- Declare Variables Here ------------> //

ll T = 1;
ll n, m, x, y, q, k;
string s, t;

// <------------- Implement Functions Here ----------> //

vll cnt(12,0);

// <------------- Start of main() -------------------> //

void MAIN() {
	cin>>n>>k;
	if(n >= 13) cout<<k;
	else if(n <= 5) cout<<0;
	else cout<<k/2;
}

int main() {
	fastio; randomINT;
	//cin >> T;
	while (T--) {
		MAIN();
	}
	return 0;
}


Measured memory_bytes: 3584