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

#define M_PI       3.14159265358979323846

using namespace std;

//conversion
//------------------------------------------
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(); }
inline int readInt() { int x; scanf("%d", &x); return x; }

//typedef
//------------------------------------------
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef pair<int, PII> TIII;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<LL> VLL;
typedef vector<VLL> VVLL;


//container util

//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SQ(a) ((a)*(a))
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//repetition
//------------------------------------------
#define FOR(i,s,n) for(int i=s;i<(int)n;++i)
#define REP(i,n) FOR(i,0,n)
#define MOD 1000000007

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) x.begin(), x.end()
#define sz(x) (int)(x).size()

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

#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)


struct Edge {
    int to, from;
    ll cost;
    Edge(int from, int to, ll cost): from(from), to(to), cost(cost) {}
};

typedef vector<vector<Edge>> AdjList;
AdjList graph;

typedef vector<ll> vec;
typedef vector<vec> mat;

mat mul(mat &A, mat &B) {
    mat C(A.size(), vec((int)B[0].size()));
    for(int i=0; i<A.size(); ++i){
        for(int k=0; k<B.size(); ++k){
            for(int j=0; j<B[0].size(); ++j){
                C[i][j] = (C[i][j] + A[i][k] * B[k][j] %MOD) % MOD;
            }
        }
    }
    return C;
}
mat mat_pow(mat A, ll n) {
    mat B(A.size(), vec((int)A.size()));

    for(int i=0; i<A.size(); ++i){
        B[i][i] = 1;
    }

    while(n > 0) {
        if(n & 1) B = mul(B, A);
        A = mul(A, A);
        n >>= 1;
    }
    return B;
}

int arr[110];
int main() {
    //cin.tie(0);
    //ios::sync_with_stdio(false);
    //cout << fixed << setprecision(10);
    
    int N, K;cin >> N >> K;

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


    int ans = 0;
    for(int i=0; i<N; ++i){
        ans += min(abs(arr[i]-K), arr[i])*2;
    }
    cout << ans << endl;
    return 0;

}

Measured memory_bytes: 256
function main(input = "") {
    let arr = input.split(" ").map((v)=>(Number(v)));
    let N = arr[0], X  = arr[1], T = arr[2];

    let cnt = 0 | N / X
    if(N % X !== 0)
        cnt += 1;
        
    return cnt * T;
}

//******************************
exports.main = main;

function Main(input) {
    console.log(main(input.trim()));
}

if (process.argv[2] !== "test") {
    Main(require("fs").readFileSync("/dev/stdin", "utf8"));
}


Measured memory_bytes: 29708
v = gets.chomp.split.map(&:to_i)
a = v[0]
b = v[1]
c = v[2]

d = 1
while d <= 10 do
  if d == 1
    answer = a * c - b
    e = answer
    puts answer
    d = d + 1
  end
  if d >= 2
    answer = a * e - b
    e = answer
    puts answer
    d = d + 1
  end
end


Measured memory_bytes: 1788
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
using ll = long long;

const ll INFTY = 1e9;
const int MAX = 210;

int main(){
    int N,M,R;
    cin >> N >> M >> R;
    ll dist[MAX][MAX];
    for(int i=0;i<N;i++){
        for(int j=0;j<N;j++){
            if(i == j) dist[i][j] = 0;
            else       dist[i][j] = INFTY;
        }
    }
    vector<int> rs;
    for(int i=0;i<R;i++){
        int r;
        cin >> r;
        rs.push_back(r-1);
    }
    sort(rs.begin(), rs.end());

    vector<int> A(M), B(M), C(M);
    for(int i=0;i<M;i++){
        int a,b,c;
        cin >> a >> b >> c;
        a--; b--;
        A[i] = a; B[i] = b; C[i] = c;
    }

    for(int i=0;i<M;i++){
        dist[A[i]][B[i]] = dist[B[i]][A[i]] = C[i];
    }

    for(int k=0;k<N;k++){
        for(int j=0;j<N;j++){
            for(int i=0;i<N;i++){
                dist[i][j] = min(dist[i][k]+dist[k][j], dist[i][j]);
            }
        }
    }

    ll ans = INFTY;
    do{
        ll tmp = 0;
        for(int i=0;i<R-1;i++){
            tmp += dist[rs[i]][rs[i+1]];
        }
        ans = min(ans, tmp);
    } while(next_permutation(rs.begin(), rs.end()));

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

Measured memory_bytes: 768
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace AtCoder2 {
	class Program {
		static void Main(string[] args) {


			var inputArray = retreiveLongArray();
			var inputCount = 2;

			// 不正な入力は処理しない
			if (inputArray.Length != inputCount) {
				Console.WriteLine("invalid input");
				return;
			}
			var a = inputArray[0];
			var b = inputArray[1];

			//X>=Yとしておく
			var X = Math.Max(a, b);
			var Y = Math.Min(a, b);

			//X方向に何回、Y方向に何回とぶのか調べる

			long xCount = 0;
			long yCount = 0;

			while (Y*2 > X) {
				yCount++;
				Y = Y - 2;
				X = X - 1;
			}

			if(Y*2 != X) {
				Console.WriteLine(0);
				return;
			}
			xCount = Y;

			//(xCount+yCount)Combination(yCount)が答えになる

			long divide = 1000000000 + 7;
			var sum = xCount + yCount;
			var c = yCount;

			var result = BigMod.Combination(sum, c);

			//答えの出力
			Console.WriteLine(result);

		}

		/// <summary>
		/// スペースで区切られた文字列配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static string[] retreiveStringArray() {
			var inputArray = Console.ReadLine().Split(' ');
			return inputArray;
		}

		/// <summary>
		/// スペースで区切られた整数配列の入力を受け取る
		/// </summary>
		/// <returns></returns>
		private static long[] retreiveLongArray() {
			var inputArray = Console.ReadLine().Split(' ');
			var longArray = inputArray.Select(s => long.Parse(s));
			return longArray.ToArray();
		}
	}

	public static class BigMod {

		private static long _mod = 1000000000 + 7;

		/// <summary>
		/// x^n のmod　を繰り返し二乗法で求める
		/// </summary>
		/// <param name="x"></param>
		/// <param name="n"></param>
		/// <returns></returns>
		private static long repeatPow(long x,long n) {
			if (n == 0) {
				return 1;
			}
			if (n == 1) {
				return x;
			}

			if (n % 2 == 1) {
				var a = repeatPow(x, n / 2);
				var b = a*x % _mod;
				return (a * b) % _mod;
			}
			else {
				var a = repeatPow(x, n / 2);
				return (a * a) % _mod;
			}
		}

		/// <summary>
		/// nこからrこを選ぶ組み合わせの数
		/// </summary>
		/// <param name="n"></param>
		/// <param name="r"></param>
		/// <returns></returns>
		public static long Combination(long n,long r) {

			long bunshi = 1;
			for (int i = 1; i <= r; i++) {
				bunshi =  bunshi *(n - r + i) % _mod;
			}

			long bunbo = 1;
			for (int i = 1; i <= r; i++) {
				bunbo = bunbo * (i) % _mod;
			}
			//逆元を使って、組み合わせの数を求める	
			return (bunshi * repeatPow(bunbo, _mod - 2)) % _mod;

		}

	}

}



Measured memory_bytes: 13396
N,Y = map(int, input().split())
for i in range(N+1):
    for j in range(N+1-i):
        k = N-i-j
        if 10000*i+5000*j+1000*k==Y:
            print(i, j, k)
            break
    else:
        continue
    break
else:
    print(-1,-1,-1)

Measured memory_bytes: 9180
def menagerie(N: int, s: str) -> str:
    # Sheep: True, Wolf: False

    # 0 番目と 1 番目の道具ぶつの組み合わせだけ全探索。
    # その 2 頭が決まればあとは一意に決まる。
    is_sheeps = [[None] * N for _ in range(4)]

    # SS
    is_sheeps[0][:2] = True, True
    # SW
    is_sheeps[1][:2] = True, False
    # WS
    is_sheeps[2][:2] = False, True
    # WW
    is_sheeps[3][:2] = False, False

    for n in range(1, N):
        for is_sheep in is_sheeps:
            if (s[n] == 'o') == is_sheep[n]:
                # n 番目の動物が羊で発言が 'o'、あるいは
                # 狼で発言が 'x' なら n 番目の両隣は同じ動物
                is_sheep[(n + 1) % N] = is_sheep[n - 1]
            else:
                # n 番目の動物が羊で発言が 'x'、あるいは
                # 狼で発言が 'o' なら n 番目の両隣は違う動物
                is_sheep[(n + 1) % N] = not is_sheep[n - 1]

    for i, is_sheep in enumerate(is_sheeps):
        if is_sheep[0] == (i // 2 == 0) and ((s[0] == 'o') == is_sheep[0]) == (is_sheep[1] == is_sheep[-1]):
            return ''.join('S' if b else 'W' for b in is_sheep)

    return '-1'


if __name__ == "__main__":
    N = int(input())
    s = input()
    ans = menagerie(N, s)
    print(ans)


Measured memory_bytes: 7156
#include<iostream>
#include<vector>
#include<map>
#include<list>

using namespace std;

int main() {
  int a,b;
  cin >> a >> b;
  for(int i=1;i<1010;i++){
    if(int(i*0.08)==a && int(i*0.1)==b){
      cout << i << endl;
      return 0;
    }
  }
  cout << -1 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w

#define int long long
//using ll = long long;
using P = pair<int,int>;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
const int INF=1e+9;
const double EPS=1e-9;
const int MOD=1000000007;

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

signed main(){
	int n;
	vector<int> b,ans;
	cin >> n;
	for(int i = 0;i < n;i++){
		int a;
		cin >> a; a--;
		b.push_back(a);
	}
	for(int i = 0;i < n;i++){
		int ma = -1;
		for(int j = 0;j < n - i;j++){
			if(b[j] == j) chmax(ma,j);
		}
		if(ma == -1){
			cout << -1 << endl;
			return 0;
		}
		ans.push_back(ma);
		b.erase(b.begin() + ma);
	}
	for(int i = n - 1;i >= 0;i--) cout << ans[i] + 1 << endl;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main{
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);

        int a = scanner.nextInt();
        int b= scanner.nextInt();
        if ((a+b)%2==0){
            System.out.println((a+b)/2);
        }else{
            System.out.println("IMPOSSIBLE");
        }
    }
}

Measured memory_bytes: 21716
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define ll long long
#define watch(x) cout << (#x) << " is " << (x) << endl

typedef vector<int> vi;
typedef vector< vi > vvi;
typedef pair< int,int > ii;
typedef pair< double,double> dd;
#define pb push_back
#define eb emplace_back
#define sz(a) int((a).size))
#define all(c) c.begin(),c.end()
#define FOR(i,a,b) for(i=a; i<b; i++)
#define FORR(i,a,b) for(i=a;i>=b;i--)
#define REP(i,n) FOR(i,0,n)
#define x first
#define y second
#define mp make_pair

const int INF = 1000000007;
const long long INFLL = (ll)INF * (ll)INF;
 
int32_t main()
{
	IOS;
	int n;
	scanf("%d",&n);
	if(n&1)
	{
		printf("%d",(n+1)/2);
	}
	else
	{
		printf("%d",n/2);
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main(){
    for(int i=0;i<1000000;i++){
        int a,b;
        char op;
        cin >> a >> op >> b;
        if(op=='+'){
            cout << a+b << endl;
        }
        else if(op=='-'){
            cout << a-b << endl;
        }
        else if(op=='*'){
            cout << a*b << endl;
        }
        else if(op=='/'){
            cout << a/b << endl;
        }
        else{
            break;
        }
    }
}


Measured memory_bytes: 3080
#include<bits/stdc++.h>
#include <iostream>
#include <string>
#include <cmath>
using namespace std;
#define ll long long
#define rep(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i,a,b) for(ll i=(a);i<(b);i++)
#define FORR(i,a,b)for(ll i=(a);i<=(b);i++)
#define repR(i,n) for(ll i=n;i>=0;i--)
#define all(v)(v).begin(),(v).end()
#define rall(v)(v).rbegin(),(v).rend()
#define F first
#define S second
#define pb push_back
#define pu push
#define COUT(x) cout<<(x)<<endl
#define PQ priority_queue<ll>
#define PQR priority_queue<ll,vector<ll>,greater<ll>>
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define mp make_pair
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define sz(x) (int)(x).size()
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll MOD = 1000000007LL;
const ll INF = 1LL << 60;
using vll = vector<ll>;
using vb = vector<bool>;
using vvb = vector<vb>;
using vvll = vector<vll>;
using vstr = vector<string>;
using pll = pair<ll, ll>;
ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}
int main(){
  ll n;
  cin>>n;
  vll a(n);
  rep(i,n) cin>>a[i];
  ll ans=0;
  rep(i,n){
    if(a[i]%2==0){
      while(a[i]%2==0){
        a[i]/=2;
        ans++;
      }
    }
  }
  COUT(ans);
}

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

using namespace std;
using ll=long long;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, a, n) for(int i = (n); i < (a); i++)
#define repr(i, n) for(int i = (n); i >= 0; i--)
#define repr2(i, a, n) for(int i = (n); i >= (a); i--)

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  int n,mp_max=1;cin>>n;
  string a;
  map<string,int> mp;
  rep(i,n){
    cin>>a;
    auto itr = mp.find(a);
    if(itr!=mp.end()){
      mp[a]++;
      if(mp_max<mp[a])mp_max=mp[a];
    } else {
      mp[a]=1;
    }
  }

  //for(auto itr = mp.begin(); itr != mp.end(); ++itr)cout<<"key="<<itr->first<<",val="<<itr->second<<"\n";
  //cout<<mp_max<<endl;
  vector<string> vec;
  for(auto itr = mp.begin(); itr != mp.end(); ++itr) {
    if(itr->second==mp_max)vec.push_back(itr->first);
  }
  sort(vec.begin(),vec.end());
  
  for (auto itr = vec.begin(); itr != vec.end(); ++itr) cout<<*itr<<"\n";
}

Measured memory_bytes: 25584
#include <iostream> 
#include <algorithm> 
#include <cstring> 
#include <cstdio>
#include <vector> 
#include <queue> 
#include <cstdlib> 
#include <iomanip>
#include <cmath>
#include <cassert>
#include <ctime> 
#include <map> 
#include <set> 
using namespace std; 
#define lowbit(x) (x&(-x)) 
#define max(x,y) (x>y?x:y) 
#define min(x,y) (x<y?x:y) 
#define MAX 100000000000000000 
#define MOD 1000000007
#define pi acos(-1.0) 
#define ei exp(1) 
#define PI 3.141592653589793238462
#define ios() ios::sync_with_stdio(false)
#define INF 1044266558
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
const int maxn=1e6+7;
int x,a,b;
int main()
{
	while(scanf("%d%d%d",&x,&a,&b)!=EOF)
	{
		puts(abs(a-x)<=abs(b-x)?"A":"B");
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main() {
	string s; cin >> s;
	if(s == "SUN") cout << "7" << endl;
	else if(s == "MON") cout << "6" << endl;
	else if(s == "TUE") cout << "5" << endl;
	else if(s == "WED") cout << "4" << endl;
	else if(s == "THU") cout << "3" << endl;
	else if(s == "FRI") cout << "2" << endl;
	else cout << "1" << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(int)n;i++)
using Graph = vector<vector<int> >;
using GraphC = vector<vector<char> >;
typedef pair<int, int> P;
const int MAX_N = 1000000000;
const int MAX_L = 100000000;
const int MAX_SQRT_B = 10000;
const int INF = 1000000000;
typedef int64_t ll;
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; }

string S;
ll K;

int main() {
	cin >> S >> K;

	ll cnt = 0;
	for (int i = 0; i < S.size(); i++)
	{
		int tmp = S.at(i) - '0';

		if (tmp == 1) {
			cnt++;
		}
		else {
			if (K > cnt) {
				cout << tmp << endl;
				return 0;
			}
			else {
				cout << 1 << endl;
				return 0;
			}
		}

	}
	cout << 1 << endl;
	return 0;	
}

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

using namespace std;

int main() {
    int h,w,k,ans=0;
    cin>>h>>w>>k;
    char a[h][w];
    for(int i=0;i<h;i++)
    {
        for(int j=0;j<w;j++)
        {
            cin>>a[i][j];
        }
    }
    for(int mR=0;mR <(1<<h);mR++)
    {
        for(int mC=0;mC < (1<<w);mC++)
        {
            int b=0;
            for(int i=0;i<h;i++)
            {
                for(int j=0;j<w;j++)
                {
                    if(((1<<i)&mR)==0 && ((1<<j)&mC)==0 && a[i][j]=='#')
                    {
                        b++;
                    }
                }
            }
            ans+=(b==k);
        }
    }
    
    cout<<ans<<"\n";
    return 0;
}

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

int main() {
    int A, B, C;
    cin >> A >> B >> C;
    
    int ans = 0;
    if (C<=A+B+1) {
        ans = B + C;
    }
    else{
        ans = (2*B) + A + 1;
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i,n) for( ll i = 0;i < (ll)n;++i)
vector<ll> dx = {1,0};
vector<ll> dy = {0,1};

ll h,w;
vector<string> a;
vector<vector<ll>> m;

void dfs( ll y, ll x ){
  m.at(y).at(x) = 2;
  if( y+1 <= h-1 && x+1 <= w-1 ){
    if( a.at(y+1).at(x) == '#' && a.at(y).at(x+1) == '#' ){
      return;
    }
  }
  rep(i,2){
    ll ny = y + dy.at(i);
    ll nx = x + dx.at(i);
    if( ny >= 0 && ny <= h-1  && nx >= 0 && nx <= w-1 &&
        a.at(ny).at(nx) == '#' && m.at(ny).at(nx) != 2 ){
      //cout << ny << " " << nx << endl;
      dfs(ny,nx);
    }
  }
}

int main(){
  
  cin >> h >> w;
  a.resize(h);
  rep(i,h) cin >> a.at(i);
  m.resize(h);
  rep(i,h) m.at(i).resize(w);

  rep(i,h){
    rep(j,w){
      if( a.at(i).at(j) == '#' ) m.at(i).at(j) = 1;
    }
  }
  dfs(0,0);
  rep(i,h){
    rep(j,w){
      if( m.at(i).at(j) == 1  ){
       // cout << i << " " << j << endl;
        cout << "Impossible" << endl;
        return 0;
      }
    }
  }
  cout << "Possible" << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
int main (void){
    int N, M, C;
    cin >> N >> M >> C;
    vector<int> B(M);
    rep(i, M) cin >> B.at(i);
    int ans = 0;
    rep(i, N) {
        int sum = 0;
        rep(j, M) {
            int a;
            cin >> a;
            sum += a * B.at(j);
        }
        if (sum + C > 0) ans++;
    }
    cout << ans << endl;;
}


Measured memory_bytes: 256
//36
#include<iostream>

using namespace std;

int main(){
  static bool cmp[1000000]={true};
  static int npr[1000000];
  for(int i=2;i<1000000;i++){
    if(!cmp[i]){
      for(int j=2;j*i<1000000;j++){
	cmp[i*j]=true;
      }
    }
    npr[i]=npr[i-1]+!cmp[i];
  }
  for(int n;cin>>n;n++){
    cout<<npr[n]<<endl;
  }
  return 0;
}

Measured memory_bytes: 0
use std::io::prelude::*;

fn input<T: std::str::FromStr>() -> T {
    let stdin = std::io::stdin();
    let token: String = stdin
        .lock()
        .bytes()
        .map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().unwrap()
}

#[allow(dead_code)]
fn with_stdout_lock<F: FnOnce(std::io::BufWriter<std::io::StdoutLock>)>(f: F) {
    let out = std::io::stdout();
    let w = std::io::BufWriter::new(out.lock());
    f(w);
}

#[allow(unused_macros)]
macro_rules! debug {
    ($var:expr) => {
        match &$var { v => eprintln!(concat!(stringify!($var), "={:?}"), v) }
    };
    ($var:expr, $($vars:expr),*) => {
        match &$var { v => eprint!(concat!(stringify!($var), "={:?} "), v) }
        debug!($($vars),*);
    };
}

fn main() {
    let a: i32 = input();
    let s: String = input();

    println!("{}", if a >= 3200 { s } else { "red".to_string() });
}


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

int main() {
  int a,b;
  cin >> a >> b;
  int num;
  bool t=false;
  if(b<10) num=10*a+b;
  else if(b<100) num=100*a+b;
  else num=1000*a+b;

  for(int i=0;i<1000;i++) {
    if(i*i==num) t=true;
  }
  if(t) cout << "Yes" << endl;
  else cout << "No" << endl;
}


Measured memory_bytes: 384
#include <iostream>
#define ll long long
#define intm INT_MAX
#define llm LLONG_MAX

using namespace std;
int MOD = 998244353;

int main(){
	ios_base::sync_with_stdio(false); cin.tie(0);
    int N;
    cin >> N;
    ll ans = 0;
    //int c = 0;
    for(int i=1; i <= N; i++){
        if( i%3 != 0 && i%5!=0 ) ans +=i;
    }
    cout << ans;




}


Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
#define ll         long long
#define mod        1000000007
#define setbits(x) __builtin_popcountll(x)
#define zrobits(x) __builtin_ctzll(x)
#define inf        1e18
#define ps(x,y)    fixed<<setprecision(y)<<x

int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif

	ll a, b, c, k;
	cin >> a >> b >> c >> k;


	if (k <= a)
	{
		cout << k;
		return 0;
	}
	else if (k <= a + b)
	{
		cout << a;
		return 0;
	}
	else
	{
		k = k - a - b;
		k = a - k;
		cout << k;
		return 0;
	}

}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
using namespace std;
using LL = long long;
#define REP(i, n) for (LL i = 0; i < (LL)(n); i++)
#define REP2(i, n) for (LL i = 1; i <= (LL)(n); i++)
#define FOR(i, m, n) for (LL i = m; i < n; i++)
#define SORT(x) sort(x.begin(), x.end())
#define REVE(x) reverse(x.begin(), x.end())
#define ALL(x) (x).begin(), (x).end()
#define SUM(x) accumulate(x.begin(), x.end(),0)
#define vLL(v,n) vector<LL> v(n); REP(i,n)cin>>v[i];
#define vstr(v,n) vector<string> v(n); REP(i,n)REP(i,n)cin>>v[i];
LL INF = 1e9 + 1;
LL MOD = 1e9+7;
  LL a,b,c,d,e,n,m,l,k,r,x,y,z,t,ans=INF,ans2=0;
string s,S;
int main() {
ios_base::sync_with_stdio(false);
  cin >> n>>t;
  REP(i,n){
      cin >> c >>  x;
      if(x<=t)ans=min(c,ans);
  }
  if(ans!=INF)
  cout << ans;
  else cout <<"TLE";
  }

Measured memory_bytes: 3592
# 入力
S = input()

a = int(S[:2])
b = int(S[2:])

ans = (
    'YYMM' if not 1 <= a <= 12 and 1 <= b <= 12 else
    'MMYY' if 1 <= a <= 12 and not 1 <= b <= 12 else
    'AMBIGUOUS' if 1 <= a <= 12 and 1 <= b <= 12 else
    'NA'
)

# 出力
print(ans)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define REPS(i,x) for(int i=1;i<=(int)(x);i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RREPS(i,x) for(int i=((int)(x));i>0;i--)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) (container).begin(), (container).end()
#define RALL(container) (container).rbegin(), (container).rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define pb push_back
#define eb emplace_back
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define __builtin_popcount __builtin_popcountll

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
    os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
    os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}
template<class S, class T> pair<S,T> operator+(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first+t.first, s.second+t.second);}
template<class S, class T> pair<S,T> operator-(const pair<S,T> &s, const pair<S,T> &t){ return pair<S,T>(s.first-t.first, s.second-t.second);}

const int INF = 1<<28;
const double EPS = 1e-8;
const int MOD = 1000000007;


int T, n, m;

int main(int argc, char *argv[]){
    ios::sync_with_stdio(false);
    ll x, y;
    cin >> x >> y;
    ll z = x * y - x;
    if (z % y == 0) {
        cout << -1 << endl;
    } else {
        cout << z << endl;
    }
    return 0;
}


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

using namespace std;

int a[11] = {0}, b[11] = {0};
int K;

int solve(int idx, int k, int brw)
{
  if(k < 0) return -(1 << 25);
  if(idx == 0) return 0;
  int sa = a[idx] - b[idx];
  int ret = -(1 << 25);
  if(brw == 1) sa--;
  if(sa < 0){
    if(k > 0) ret = solve(idx-1, k-1, 0) + (sa+10) * pow(10, 10-idx);
    ret = max(ret, solve(idx-1, k, 1) + (sa+10) * (int)pow(10, 10-idx));
  } else {
    ret = solve(idx-1, k, 0) + sa * pow(10, 10-idx);
  }
  return ret;
}

int main()
{
  string A, B;

  cin >> A >> B >> K;
  for(int i = A.size() - 1, j = 10; i >= 0; i--, j--){
    a[j] = A[i] - '0';
  }
  for(int i = B.size() - 1, j = 10; i >= 0; i--, j--){
    b[j] = B[i] - '0';
  }
  cout << solve(10, K, 0) << endl;
  return 0;
}

Measured memory_bytes: 1244
object Main extends App {
  var a = readInt
  var b : Array[Int] = Array.tabulate(a)(i => (readInt))
  var max = b.max
  var p = 0
  for(i <- 0 until a ) {
    if(b(i)==max && p!=1) {
      p = 1
      b(i) = 0
      println(b.max)
    } else {
     println(max) 
    }
  }
}


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

#define eb emplace_back
#define INF 1LL<<62
#define FLT_INF pow(10.0, 16)

using ll = long long;
using vll = vector<ll>;
using ull = unsigned long long;
using int2 = pair<int, int>;

template <typename A> string to_string(const A& v);
string to_string(const string& s) { return '"'+ s + '"'; }
string to_string(const char *s) { return to_string((string)s); }
string to_string(bool b) { return (b ? "true" : "false"); }

template <typename A, typename B> string to_string(const pair<A, B>& p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}

template <typename A> string to_string(const A& v) {
  bool first = true;
  string res = "{";
  for (const auto &x : v) {
    if (!first) {
      res += ", ";
    }
    first = false;
    res += to_string(x);
  }
  res += "}";
  return res;
}

template <typename T>
void sort(vector<T>& val) {
  sort(val.begin(), val.end());
}

template <typename T>
void sort_b(vector<T>& val) {
  sort(val.begin(), val.end(), greater<T>());
}

void debug_out() { cerr << endl; }

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

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

#define COMMON_MOD pow(10, 9) + 7
#define PI 3.14159265

// sort(a.begin(), a.end(), less<ll>()); greater<ll>()
// cout<<fixed<<setprecision(20)<<(s/kl)*2;

int main() {

  ios::sync_with_stdio(false);
  cin.tie(0);

  ll n, k;
  cin >> n >> k;

  double res = 0;

  for (int i = 1; i <= n; i++) {
    double prob = 1.0 / n;

    if ((k - i) > 0) {
      ll x = ceil(log2((double)k / i));
      prob = prob * pow(0.5, x);
      //debug(prob, x);
    }
    res += prob;

  }

  cout<<fixed<<setprecision(12)<<res;

  cout << endl;
  return 0;
}


Measured memory_bytes: 256
n = int(input())
b = list(map(int,input().split()))[::-1]
a = []
while b:
    for i,v in enumerate(b):
        if v == len(b)-i:
            a.append(v)
            b.pop(i)
            break
    else:
        print(-1)
        exit()

for ans in a[::-1]:
    print(ans)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long lol;

//マクロ
//forループ関係
//引数は、(ループ内変数,動く範囲)か(ループ内変数,始めの数,終わりの数)、のどちらか
//Dがついてないものはループ変数は1ずつインクリメントされ、Dがついてるものはループ変数は1ずつデクリメントされる
#define REP(i,n) for(lol i=0;i<lol(n);i++)
#define REPD(i,n) for(lol i=n-1;i>=0;i--)
#define FOR(i,a,b) for(lol i=a;i<=lol(b);i++)
#define FORD(i,a,b) for(lol i=a;i>=lol(b);i--)
#define VL vector<lol>
//xにはvectorなどのコンテナ
#define ALL(x) x.begin(),x.end() //sortなどの引数を省略したい
#define SIZE(x) lol(x.size()) //sizeをsize_tからllに直しておく
//定数
#define PI 3.1415926535897932385 //pi
#define INF 1000000000000 //10^12:極めて大きい値,∞
#define MOD 1000000007 //10^9+7:合同式の法
#define MAXR 100000 //10^5:配列の最大のrange(素数列挙などで使用)
//最大値最小値
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main()
{
    lol result{0};
    lol n; cin >> n;
    lol k; cin >> k;
    lol i{0};
    while(pow(k, i) <= n)
    {
        i++;
    }
    result = i;

    cout << result << endl;
    return 0;
}

Measured memory_bytes: 4032
#include <iostream>
#include <string>
#include <map>
#include <queue>
#include <algorithm>
#include <vector>
#include <math.h>
#include <bitset>
#include <cmath>
#include <set>

#define rep(i,s,n)for(int i = s;i<n;i++)
#define repe(i,s,n)for(int i = s;i<=n;i++)
#define rep_r(i,s,n)for(int i = n-1;i>=0;i--)
#define rep_re(i,s,n)for(int i = n;i>=0;i--)
using namespace std;
typedef long long ll;
static const ll MOD = 1e9 + 7;
static const ll INF = 1e25;
static const ll MAX_M = 100001;

double v[51];
int main() {
	ll n; cin >> n;
	rep(i, 0, n) cin >> v[i];

	sort(v, v + n);
	double ans = 0;
	rep(i, 1, n) {
		v[i] = (v[i] + v[i - 1]) / 2;
	}
	printf("%7f", v[n - 1]);

	return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize ("O3")
#pragma GCC target ("tune=native")
#pragma GCC target ("avx")

#include <bits/stdc++.h>

// 汎用マクロ
#define ALL_OF(x) (x).begin(), (x).end()
#define REP(i,n) for (unsigned long long i=0, i##_len=(n); i<i##_len; i++)
#define RANGE(i,is,ie) for (unsigned long long i=(is), i##_end=(ie); i<=i##_end; i++)
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end())
template<class T> bool chmax(T &a, const T &b) {if (a < b) {a = b; return 1;} return 0; }
template<class T> bool chmin(T &a, const T &b) {if (a > b) {a = b; return 1;} return 0; }
#define INF 0x7FFFFFFF
#define LINF 0x7FFFFFFFFFFFFFFFLL
#define Yes(q) (q ? "Yes" : "No")
#define YES(q) (q ? "YES" : "NO")
#define DUMP(q) cerr << "[DEBUG] " #q ": " << (q) << " at " __FILE__ ":" << __LINE__ << endl
#define DUMPALL(q) cerr << "[DEBUG] " #q ": ["; REP(dumpall_i, (q).size()) { cerr << q[dumpall_i] << (dumpall_i == (q).size() - 1 ? "" : ", "); } cerr << "] at " __FILE__ ":" << __LINE__ << endl

// gcc拡張マクロ
#define gcd __gcd
#define popcount __builtin_popcount
#define popcountll __builtin_popcountll

// エイリアス
using  ll = long long;
using ull = unsigned long long;
using  ld = long double;
using namespace std;

// モジュール


// 処理内容
int main() {
    
    int n, k;
    cin >> n >> k;
    string s;
    cin >> s;

    deque<int> q; // [1s, 0s, 1s, ..., 1s]
    int v = 0;
    if (s.front() == '0') q.push_back(0);
    REP(i, n) {
        v++;
        if (i == n-1 || s[i] != s[i+1]) {
            q.push_back(v);
            v = 0;
        }
    }
    if (s.back() == '0') q.push_back(0);

    int m = q.size();

    vector<int> imos(m+1, 0);
    REP(i, m) imos[i+1] = imos[i] + q[i];

    int ans = 0;
    for (int i = 0; i < m; i += 2) {
        int j = min(m-1, i + 2 * k);
        int cand = imos[j + 1] - imos[i];
        chmax(ans, cand);
    }

    cout << ans << endl;
    
}

Measured memory_bytes: 1152
#include <cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <iostream>
#include <bitset>
#include <deque>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <iterator>
#include <string>
#include <chrono>
#include <random>
#include <tuple>
#include <utility>
#include <fstream>

const int INF = 1000000009;
const long LINF = 1123456789012345678;

long a, b;

int main(){
	scanf("%ld %ld", &a, &b);
	long ans = 0;
	for(long x = ((a-1)/4)*4; x <= a-1; x++){
		ans ^= x;
	}
	for(long y = b/4*4; y <= b; y++){
		ans ^= y;
	}
	printf("%ld\n", ans);
	return 0;
}


Measured memory_bytes: 256
# coding: utf-8
import sys

sr = lambda: sys.stdin.readline().rstrip()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

N = ir()
A = lr()
sorted_A = sorted(A)
mid = N // 2 - 1
left = sorted_A[mid]
right = sorted_A[mid+1]
answer = [left if a > left else right for a in A]
print('\n'.join(map(str, answer)))


Measured memory_bytes: 31764
use proconio::{fastout, input};
use proconio::marker::Chars;

#[fastout]
fn main() {
    input! {
        n: usize,
        k: usize,
        s: String,
    }

    let mut ans = String::default();
    let k = k-1;

    for (i,c) in s.chars().enumerate(){
        if i==k {
            ans.push(c.to_lowercase().nth(0).unwrap());
        }
        else {
            ans.push(c);
        }
    }

    println!("{}",ans);
}


Measured memory_bytes: 2140
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <cmath>
#include <numeric>
#include <iostream>
#include <sstream>
#include <string>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <stack>
#include <deque>
#include <list>
#include <unordered_map>
#include <tuple>
#include <complex>


#define FOR(i, a, b)		for(int i = (int)(a); i < (int)(b); ++i)
#define FORE(i, a, b)		for(int i = (int)(a); i <= (int)(b); ++i)
#define REP(i, n)			FOR(i, 0, n)
#define REPE(i, n)			FORE(i, 0, n)
#define ALL(x)				(x).begin(),(x).end()
#define DEBUG_DC(x)			cout << #x << ": " << x << endl
#define VEC_TYPE			int
#define INF					1e9+1

using namespace std;
typedef long long ll;
typedef vector<VEC_TYPE> vdef;
typedef vector<vdef> vvdef;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmaxE(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; }
template<class T> inline bool chminE(T& a, T b) { if (a >= b) { a = b; return 1; } return 0; }
template<typename T> inline T mygcd(T a, T b) { return b ? mygcd(b, a%b) : a; }
template<typename T> inline T mylcm(T a, T b) { return a * b / mygcd(a, b); }

int main()
{
	int ans = 0;
	string s, t;
	cin >> s >> t;

	for (int i = 0; i < 3; ++i)
	{
		if (s[i] == t[i])
			++ans;
	}


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

Measured memory_bytes: 764
//#include <bits/stdc++.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
#define fast_io()                \
    ios::sync_with_stdio(false); \
    std::cin.tie(0);
#define mod 998244353
typedef long long ll;
typedef long double ld;
using namespace std;

int main()
{
    fast_io();
    int n, x, t;
    cin >> n >> x >> t;
    if (n % x)
        cout << t * (n / x) + t;
    else
        cout << t * (n / x);
    return 0;
}


Measured memory_bytes: 3224
#include<cstdio>
#include<cstring>
#include<cmath>
#include<cstdlib>
#include<ctime>
#include<algorithm>
#include<vector>
#include<queue>
#define ll long long
ll read()
{
	ll tmp=0;char c=getchar(),f=1;
	while(c<'0'||'9'<c){if(c=='-')f=-1;c=getchar();}
	while('0'<=c&&c<='9'){tmp=tmp*10+c-48;c=getchar();}
	return tmp*f;
}
using namespace std;
ll a[310][310];
int use[310][310];
int n;
ll ans=0;
int main()
{
	int i,j,k;
	n=read();
	for(i=1;i<=n;i++)
		for(j=1;j<=n;j++)
			a[i][j]=read(),ans+=a[i][j],use[i][j]=1;
	for(k=1;k<=n;k++)
		for(i=1;i<=n;i++)
			for(j=1;j<=n;j++){
				if(i==j||j==k||i==k)continue;
				if(use[i][j]&&(a[i][j]==a[i][k]+a[k][j]))ans-=a[i][j],use[i][j]=0;
				else if(a[i][j]>a[i][k]+a[k][j]){
					printf("-1\n"); return 0;
				}
			}
	printf("%lld\n",ans>>1);
	return 0;
}

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

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

  if((b-1)%(a-1)==0)cout << (b-1)/(a-1) << endl;
  else cout << (b-1)/(a-1)+1 << endl;

  return 0;
}

Measured memory_bytes: 3604
#include<iostream>
#include<sstream>
#include<ios>
#include<iomanip>
#include<algorithm>
#include<vector>
#include<list>
#include<queue>
#include<cstdlib>
#include<cmath>
#include<queue>
#include<deque>
#include<map>
#include<string>
#include<numeric>
#include<set>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rep2(i, m, n) for(int i = (int)(m); i < (int)(n); i++)
#define rep_inv(i, n, m) for(int i = (int)(n); i > (int)(m); i--)
using namespace std;
using vi = vector<int>;
using vl = vector<long>;
using vc = vector<char>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<long>>;
using vvc = vector<vector<char>>;
using pii = pair<int, int>;
using pll = pair<long, long>;
using vpii = vector<pii>;
using vpll = vector<pll>;

int main(){
  string S, T;
  cin >> S >> T;

  cout << T << S << endl;
  
  return 0;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

int main(){
  int A, B, K;
  cin >> A >> B >> K;
  
  int k = K;
  int ans;
  for(int i = min(A, B); 1 <= i; --i){
    if(A % i == 0 && B % i == 0){
      --k;
    }
    if(k == 0){
      ans = i;
      break;
    }
  }
  
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << endl
#define COUTF(x) cout << setprecision(15) << (x) << endl
#define ENDL cout << endl
#define DF(x) x.erase(x.begin())  // 先頭文字削除
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define REVERSE(x) reverse(ALL(x))
#define init() \
  cin.tie(0);  \
  ios::sync_with_stdio(false)
#define debug(x) cerr << "[debug] " << #x << ": " << x << endl;
#define debugV(v)                       \
  cerr << "[debugV] " << #v << ":";     \
  rep(i, v.size()) cerr << " " << v[i]; \
  cerr << endl;
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using P = pair<ll, ll>;
constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr ld PI = 3.141592653589793238462643383279;
ll get_digit(ll x) {
  return to_string(x).size();
}

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

ll lcm(ll a, ll b) {
  return a / gcd(a, b) * b;
}

vector<P> factorize(ll n) {
  vector<P> result;
  for (ll i = 2; i * i <= n; ++i) {
    if (n % i == 0) {
      result.pb({i, 0});
      while (n % i == 0) {
        n /= i;
        result.back().second++;
      }
    }
  }
  if (n != 1) {
    result.pb({n, 1});
  }
  return result;
}

vll divisor(ll n) {
  vll ret;
  for (ll i = 1; i * i <= n; i++) {
    if (n % i == 0) {
      ret.push_back(i);
      if (i * i != n) ret.push_back(n / i);
    }
  }
  SORT(ret);
  return (ret);
}

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;
}

signed main() {
  init();
  ll A, B;
  cin >> A >> B;
  COUT(A * B - A - B + 1);
  return 0;
}

Measured memory_bytes: 3596
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int A = sc.nextInt();
        int B = sc.nextInt();

        if (A >= 13) {
            System.out.println(B);
        } else if (A >= 6) {
            System.out.println(B / 2);
        } else {
            System.out.println(0);
        }
    }
}


Measured memory_bytes: 21204
#define LOCAL
#include <bits/stdc++.h>
#define rep(i, n) for(int i=0; i<(n); ++i)
#define rrep(i, n) for(int i=(n-1); i>=0; --i)
#define rep2(i, s, n) for(int i=s; i<(n); ++i)
#define ALL(v) (v).begin(), (v).end()
#define memr(dp, val) memset(dp, val, sizeof(dp))
using namespace std;
typedef long long ll;
static const int INTINF = (INT_MAX >> 1); // 10^9 + 10^7
static const ll LLINF = (LLONG_MAX >> 1);
static const int MAX = 1e5+1;
static const ll MOD = 1e9+7;
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; }
string to_string(string s) { return '"' + s + '"'; }
string to_string(bool b) { return b ? "true" : "false"; }
template <size_t N> string to_string(bitset<N> bs) {
  string res;
  for (size_t i = 0; i < N; ++i) res += '0' + bs[i];
  return res;
}
string to_string(vector<bool> v) {
  string res = "{";
  for (bool e : v) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p);
template <class C> string to_string(C c) {
  string res = "{";
  for (auto e : c) res += to_string(e) + ", ";
  return res += "}";
}
template <class T, class U> string to_string(pair<T, U> p) {
  return "(" + to_string(p.first) + ", " + to_string(p.second) + ")";
}
void debug() { cerr << '\n'; }
template <class Head, class... Tail> void debug(Head head, Tail... tail) {
  cerr << '\t' << to_string(head), debug(tail...);
}
#ifdef LOCAL
#define print(...) cerr << "[" << #__VA_ARGS__ << "]:", debug(__VA_ARGS__)
#else
#define print(...)
#endif

int main(int argc, const char * argv[]) {
	std::cout << std::fixed << std::setprecision(15);

	ll N; cin >> N;
	map<ll, ll> mp;
	vector<ll> A(N);
	ll cnt = 0;
	ll ans = 0;
	rep(i, N){
		ll x; cin >> x;
		A[i] = x;
		mp[1 - x - cnt]++;
		ans += mp[1 + x - cnt];
		cnt++;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 27392
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))
 
a,b=[0],[0]
for i in range(N):
  a.append(a[i] + A[i])
  
  
for i in range(M):
  b.append(b[i] + B[i])
count = 0
j = M
for i in range(N + 1): 
  if a[i]>K:
    break
  while b[j]+a[i]> K :
    j -= 1
  count = max(count, i+j)
print(count)

Measured memory_bytes: 47444
#include <algorithm>
#include <string>
#include <iostream>
#include <cstdlib>

#define REP(i,n) for(long long i = 0;i < n;i++)
typedef long long ll;

using namespace std;

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

    ll N = 0;
    cin >> N;
    ll A[N];
    REP(i,N){
        cin >> A[i];
    }
    ll co_large[N];
    //start by large
    if(N % 2 == 0) {
        ll num2 = (N - 2) / 2;
        REP(i,num2)
            co_large[i] = -2;
        co_large[num2] = -1;
        co_large[num2 + 1] = 1;
        for(int i = num2 + 2;i < N;i++)
            co_large[i] = 2;
    }else {
        ll num2 = (N - 2) / 2 + 1;
        REP(i,num2)
            co_large[i] = -2;
        co_large[num2] = 1;
        co_large[num2 + 1] = 1;
        for(int i = num2 + 2;i < N;i++)
            co_large[i] = 2;
    }
    //start by small
    ll co_small[N] = {};
    if(N %2 !=0){ //偶数個の時は大きいのから始めても小さいのから始めても同じ
        ll num2 = (N - 2) / 2;
        REP(i,num2)
            co_small[i] = -2;
        co_small[num2] = -1;
        co_small[num2 + 1] = -1;
        for(int i = num2 + 2;i < N;i++)
            co_small[i] = 2;
    }
    sort(A,A + N);
    ll diff_large = 0;
    REP(i,N){
        diff_large += A[i] * co_large[i];
    }
    ll diff_small = 0;
    REP(i,N){
        diff_small += A[i] * co_small[i];
    }
    ll diff = max(diff_small,diff_large);

    cout << diff << endl;



    return 0;
}


Measured memory_bytes: 2560
#include <bits/stdc++.h>
using namespace std;
  
int main() {
  int N;
  cin >> N;
  int countAB = 0;
  int count_A = 0;
  int countB_ = 0;
  int countB_A = 0;
  for (int i = 0; i < N; i++) {
    string s;
    cin >> s;
    int M = s.size();
    if (s.at(0) == 'B' && s.at(M-1) == 'A'){
      countB_A++;
    }
    else if (s.at(M-1) == 'A'){
      count_A++;
    }
    else if (s.at(0) == 'B'){
      countB_++;
    }
    for (int j = 0; j < M-1; j++) {
      if (s.at(j) == 'A' && s.at(j+1) == 'B'){
        countAB++;
      }
    }
  }
  
  if (count_A == 0 && countB_ == 0){
    cout << countAB + max(countB_A-1,0) << endl;
  }
  else {
    cout << countAB + countB_A + min(countB_,count_A) << endl;
  }
}
    
    
  

Measured memory_bytes: 3588
// :)
// "Khodaya, be man "Tagwaye setiz" biamooz ta
//  dar anbuh masuliat nalaghzam ..." -Shariati
#include <bits/stdc++.h>

using namespace std;
typedef long long int64;
typedef pair<int,int> pii;
typedef pair<int64,int> pii32;
typedef pair<int64,int64> pii64;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()

const int maxn = 1e5+10;
const int64 MO = 1e9+7;
const int64 IN = 1e9;

char f;

bool check (int64 x) {
	cout << "? " << x << "\n";
	cout.flush();
	cin >> f;
	return (f == 'Y');
}

void getAns (int l) {
	int64 cur = 0;
	for (int i = 0; i < l - 1; i++) {
		int l, r, mid;
		l = 0;
		r = 10;
		while (r - l > 1) {
			mid = (l + r) >> 1;
			if (check(cur * 10 + mid))
				l = mid;
			else
				r = mid;
		}
		cur = cur * 10 + l;
	}
	for (int i = 0; i < 10; i++)
		if (cur * 100 + i * 11 > 0 && check(cur * 100 + i * 11)) {
			cur = cur * 10 + i;
			break;
		}
	cout << "! " << max(1LL, cur) << "\n";
	cout.flush();
}

int main () {
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int64 X = 1;
	int len = 13;
	for (int i = 0; i < 12; i++)
		X *= 10;
	for (int i = 0; i < 13; i++) {
		if (!check(X)) {
			X /= 10;
			len--;
			continue;		
		}
		if (i == 0) {
			X = 9;
			len = 1;
			while (1) {
				if (!check(X)) {
					X *= 10;
					len++;
					continue;
				}
				getAns(len);
				break;
			}
			break;
		}
		getAns(len);
		break;
	}
}


Measured memory_bytes: 596
// ===================================
//   author: M_sea
//   website: http://m-sea-blog.com/
// ===================================
#include <algorithm>
#include <iostream>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#define re register
using namespace std;

inline int read() {
    int X=0,w=1; char c=getchar();
    while (c<'0'||c>'9') { if (c=='-') w=-1; c=getchar(); }
    while (c>='0'&&c<='9') X=X*10+c-'0',c=getchar();
    return X*w;
}

const int mod=1e9+7;
inline int qpow(int a,int b) { int c=1;
    for (;b;b>>=1,a=1ll*a*a%mod) if (b&1) c=1ll*c*a%mod;
    return c;
}

const int N=200000+10,SIZE=2001,L=(SIZE<<2)+10;

int fac[L],ifac[L];
inline void init(int n) {
    fac[0]=1;
    for (re int i=1;i<=n;++i) fac[i]=1ll*fac[i-1]*i%mod;
    ifac[n]=qpow(fac[n],mod-2);
    for (re int i=n;i;--i) ifac[i-1]=1ll*ifac[i]*i%mod;
}
inline int C(int n,int m) {
    return 1ll*fac[n]*ifac[m]%mod*ifac[n-m]%mod;
}

int n,a[N],b[N],dp[L][L];

int main() { init(SIZE<<2);
    n=read();
    for (re int i=1;i<=n;++i) {
        a[i]=read(),b[i]=read();
        ++dp[SIZE-a[i]][SIZE-b[i]];
    }
    for (re int i=1;i<=SIZE<<1;++i)
        for (re int j=1;j<=SIZE<<1;++j)
            dp[i][j]=(dp[i][j]+dp[i-1][j]+dp[i][j-1])%mod;
    int ans=0;
    for (re int i=1;i<=n;++i) {
        ans=(ans+dp[SIZE+a[i]][SIZE+b[i]])%mod;
        ans=(ans-C(a[i]+a[i]+b[i]+b[i],a[i]+a[i])+mod)%mod;
    }
    printf("%lld\n",1ll*ans*qpow(2,mod-2)%mod);
    return 0;
}


Measured memory_bytes: 129152
#include <bits/stdc++.h>
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define debug(var) std::cout << #var << " : " << var << std::endl;
using ll = long long;
using ull = unsigned long long;
ll mod = 1e9 + 7;

int main(){


	char c; std::cin >> c;
	if(c == 'a' || c == 'i' || c == 'u' || c == 'e' || c == 'o')std::cout << "vowel";
	else std::cout << "consonant";

	
	return 0;
}

Measured memory_bytes: 256
import sys
readline = sys.stdin.readline
sys.setrecursionlimit(10**8)
mod = 10**9+7
#mod = 998244353
INF = 10**9
eps = 10**-7

N,A,B = map(int,readline().split())

h = [int(readline()) for i in range(N)]

C = A-B
ng = 0 #条件を常に満たさない
ok = INF #条件を常に満たす

def judge(mid):
    ans = 0
    for hi in h:
        ans += max(0,(hi-mid*B+C-1)//C)
    if ans <= mid:
        return True
    return False

while ok - ng > 1:
    mid = (ok + ng) // 2
    if judge(mid):
        ok = mid
    else:
        ng = mid
    #okが答えとなる
print(ok)



Measured memory_bytes: 13276