akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
#define rep(i,s,e) for(int (i) = (s);(i) <= (e);(i)++)
#define all(x) x.begin(),x.end()
#define let auto const

template<typename F>
static inline constexpr decltype(auto) fix(F&& f) noexcept {
  return [f = std::forward<F>(f)](auto&&... args) {
    return f(f, std::forward<decltype(args)>(args)...);
  };
}
template<typename T>
static inline T fin() { T t; cin >> t; return std::move(t); }

i64 cnt[101010][2];

int main() {
  string s;
  cin >> s;
  i64 n = s.size();
  {
    for(int i = 0;i < 101010;i++) {
      cnt[i][0] = 1;
    }
    for(int i = 1;i <= n;i++) {
      if(s[i - 1] == 'R') {
        cnt[i + 1][1] += cnt[i][0];
        cnt[i + 1][0] += cnt[i][1];
        cnt[i][0] = 0;
        cnt[i][1] = 0;
      }
    }
    for(int i = n;i >= 1;i--) {
      if(s[i - 1] == 'L') {
        cnt[i - 1][1] += cnt[i][0];
        cnt[i - 1][0] += cnt[i][1];
        cnt[i][0] = 0;
        cnt[i][1] = 0;
      }
    }
  }
  vector<i64> ans(n + 1);
  for(int i = 1;i <= n;i++) {
    if(s[i - 2] == 'R' && s[i - 1] == 'L') {
      ans[i - 1] = cnt[i - 1][0] + cnt[i][1];
      ans[i] = cnt[i - 1][1] + cnt[i][0];
    }
  }
  for(int i = 1;i <= n;i++) {
    cout << ans[i] << " \n"[i == n];
  }
}


Measured memory_bytes: 3072
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
using ll = long long;
using namespace std;
int main() {
    ll k,a,b;
    cin >> k;
    a = k / 50;
    b = k % 50;
    cout << 50 << endl;
    rep(i,50)cout << 49+a-b + (i<b)*50 << " ";//逆操作を考える
    cout << endl;
}


Measured memory_bytes: 3652
//#pragma comment(linker, "/STACK:102400000,102400000")
//#include <initializer_list>
#include <fstream>
#include <iostream>
#include <functional>
#include <algorithm>
#include <sstream>
#include <cstring>
#include <vector>
#include <string>
#include <cstdio>
#include <cmath>
#include <queue>
#include <stack>
#include <deque>
#include <ctime>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <cassert>
//#include <unordered_map>
//#include <unordered_set>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
#define eps 1e-8
#define LL_INF 0x3fffffffffffffff
#define INF 0x3f3f3f3f
#define mem(a, b) memset(a, b, sizeof(a))
#define pper(i,n,m) for(int i = n;i >= m; i--)
#define repp(i, n, m) for (int i = n; i <= m; i++)
#define rep(i, n, m) for (int i = n; i < m; i++)
#define sa(n) scanf("%d", &(n))
#define slla(n) scanf("%lld", &(n))
#define mp make_pair
#define ff first
#define ss second
#define pb push_back
#define DE(val) cout<<#val<<": "<<val<<endl;
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); repp(i,1,___T)

const int dx44[5] = { 0,-1,-1,1,1 };
const int dy44[5] = { 0,-1,1,-1,1 };

const int dx4[5] = { 0,-1,0,1,0 };
const int dy4[5] = { 0,0,1,0,-1 };
const int dx8[9] = { 0,-1,0,1,0,1,1,-1,-1 };
const int dy8[9] = { 0,0,1,0,-1,1,-1,1,-1 };
const int maxn = 2e5 + 50;
const double PI = acos(-1.0);
const ll mod = 1e9 + 7;
ll po(ll a, ll b, ll mod) { ll res = 1; a %= mod; for (; b; b >>= 1) { if (b & 1)res = res*a%mod; a = a*a%mod; }return res; }
ll gcd(ll a, ll b) { if (a == 0) { return b; } else { return gcd(b%a, a); } }
void YES() { puts("YES"); exit(0); }
void Yes() { puts("Yes");}// exit(0); }
void NO() { puts("NO"); exit(0); }
void No() { puts("No");}// exit(0); }
void one() { puts("-1"); exit(0); }

ll n, m;
void solve()
{
	cin >> n >> m;
	ll ans = n*m;
	int f = 0;
	if (m >= 2)
	{
		f++;
		ans -= 2 * n;
	}
	if (n >= 2)
	{
		f++;
		ans -= 2 * m;
	}
	if(f==2)ans += 4;
	cout << ans << endl;
}

int main()
{

	solve();
    // system("pause");
    return 0;
}

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

int main(){
  int A[6], k;
  for ( int i = 0; i < 6; i++ ){
    if ( i < 5 ) cin >> A[i];
    if ( i == 5 ) cin >> k;
  }

  if ( A[4] - A[0] > k ) cout << ":(" << endl;
  else cout << "Yay!" << endl;

  return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long int ll;
const int MOD = (int)1e9 + 7;
#define FOR(i, a, b) for (long long int i = (a); i < (b); ++i)
#define REP(i, n) for (long long int i = 0; i < (n); ++i)
#define ALL(obj) (obj).begin(), (obj).end()

int main(int argc, char const *argv[]) {
  int D;
  ll G;
  cin >> D >> G;
  vector<int> p(D);
  vector<int> c(D);

  REP(i, D) { cin >> p[i] >> c[i]; }
  ll inf_limit = (ll)pow(2, D);
  ll ans = (ll)1e18;
  FOR(i, 0, inf_limit) {
    vector<bool> is_used(D, false);
    ll temp_num = 0;

    ll point = 0;

    REP(j, D) {
      if (i >> j & 1) {
        temp_num += p[j];
        point += p[j] * (j + 1) * 100 + c[j];
        is_used[j] = true;
      }
    }
    if (point >= G) {
      if (ans > temp_num) {
        ans = temp_num;
      }
      continue;
    }
    FOR(k, 0, D) {
      if (!is_used[k]) {
        ll num = 0;
        num = (G - point) / 100;
        num = (ll)ceil((double)num / (double)(k + 1));
        if (num <= p[k] && num > 0) {
          if (ans > temp_num + num) {
            ans = temp_num + num;
          }
        }
      }
    }
    // cerr << "= " << temp_num << endl;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
int main()
{
  int n,t,point;
  while(3==scanf("%d%d%d",&n,&t,&point))
  {
    int a[n],ok=0,i;
    double b[n],min;
    for(i=0;i<n;i++)
      scanf("%d",&a[i]);
    for(i=0;i<n;i++)
      b[i]=t-a[i]*0.006;
    min=fabs(point-b[0]);
    for(i=1;i<n;i++)
      if(fabs(point-b[i])<min)
	{
        min=fabs(point-b[i]);ok=i;
	}
    printf("%d",ok+1);
  }
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define INF 1LL<<62
#define inf 1000000007

const int MAX = 510000;
const int MOD = 1000000007;

long long fac[MAX], finv[MAX], inv[MAX];

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

// 二項係数計算
long long COM(int n, int k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

int main() {
	ll n,k;
	cin>>n>>k;
	k--;
    COMinit();	
	vector<ll>ch;
	for(ll i=0;i<n;i++){
		ll now;
		cin>>now;
		ch.push_back(now);
	}
	sort(ch.begin(),ch.end());
	ll sum1=0;
	for(ll i=0;i<n;i++){
		ll now=ch[i];
		if(n-(i+1)<k){
			continue;
		}
		ll cn=COM(n-(i+1),k);
		cn*=now;
		cn%=inf;
		if(cn<0){
			cn+=inf;
		}
		sum1+=cn;
		sum1%=inf;
		if(sum1<0){
			cn+=inf;
		}
	}
	reverse(ch.begin(),ch.end());
	ll sum2=0;
	for(ll i=0;i<n;i++){
		ll now=ch[i];
		if(n-(i+1)<k){
			continue;
		}
		ll cn=COM(n-(i+1),k);
		cn*=now;
		cn%=inf;
		if(cn<0){
			cn+=inf;
		}
		sum2+=cn;
		sum2%=inf;
		if(sum2<0){
			sum2+=inf;
		}
	}
	if(sum2-sum1<0){
		cout << sum2-sum1+inf;
		return 0;
	}
	cout << sum2-sum1;
	// your code goes here
	return 0;
}

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

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

    int w, h, x, y;
    cin >> w >> h >> x >> y;
    double res1 = (double)w * h / 2;
    int res2;
    if (w == x*2 && h == y*2) res2 = 1;
    else res2 = 0;
    printf("%.10f %d\n", res1, res2);
}



Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rep(i, n) for (int i = 0; i < (n); i++)
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()

int main () {
    long double a, b;
    cin >> a >> b;
    ll ans = a*b;
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3788
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <cstdio>
#define ll long long int

using namespace std;

int n;

int main()
{
    ///freopen("INA.txt","r",stdin);
    ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);

    cin>> n;
    ll cnt=0;
    for(int a=1;a<=n-1;a++){
        cnt+=(n/a);
        if(n%a==0){
            cnt--;
        }
    }
    cout<< cnt << endl;
    return 0;
}



Measured memory_bytes: 3648
sub f{$p[$a=pop]-$a?f($p[$a]):$a}$n=<>;print~~grep{@p=0..$n;/ /,$p[f$']=f$`for@a[$j--..$#a+$j];%h=();1<grep!$h{f$_}++,1..$n}@a=<>

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

int main() {
  int M, D;
  cin >> M >> D;
  int ans = 0;
  for (int m = 1; m <= M; m++) {
    for (int d = 1; d <= D; d++) {
      if (d >= 10) {
        int d1 = d % 10;
        int d10 = d / 10;
        if (d1 >= 2 && d10 >= 2 && d1 * d10 == m) ans++;
      }
    }
  }
  cout << ans << endl;
}

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

using namespace std;
typedef long long ll;

#define REP(i, n) for (ll i = 0; i < (n); i++)
#define REPR(i, n) for (ll i = (n); i >= 0; i--)
#define FOR(i, m, n) for (ll i = (m); i < (n); i++)
#define FORR(i, m, n) for (ll i = (m); i >= (n); i--)
#define INF 1e9
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) ((ll)(x).size())
#define SORT(x) sort((x).begin(), (x).end())
#define dump(x) cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" \
                      << " " << __FILE__ << endl

int main(int argc, char const *argv[])
{
    ll n;
    cin >> n;
    vector<ll> h(n);
    REP(i, n)
    {
        cin >> h[i];
    }
    ll res = 0;
    ll cnt = 0;
    REP(i, n - 1)
    {
        if (h[i] >= h[i + 1])
        {
            cnt++;
        }
        else
        {
            if (cnt > res)
            {
                res = cnt;
            }
            cnt = 0;
        }
    }
    if (cnt > res)
    {
        res = cnt;
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define ll long long int
#define dll long double
#define fli(j,n) for(int i=j;i<n;i++)
#define flj(i,n) for(int j=i;j<n;j++)
#define pb push_back
using namespace std;

auto fast_io =[]()
{
    std::ios::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cout.precision(10);
    return nullptr;
}();
long long int n;
vector<long long int> h;
long long int has[100001];
long long int rec(long long int curr){
	if(curr==n)return 0;
	if(curr>n)return INT_MAX;
	if(has[curr]!=-1)return has[curr];
	return has[curr]=min(abs(h[curr]-h[curr+1])+rec(curr+1),abs(h[curr]-h[curr+2])+rec(curr+2));
}

int main() {
	cin>>n;
	memset(has,-1,sizeof(has));
	for(long long int i=0;i<n;i++){
		long long int o;cin>>o;
		h.push_back(o);
	}
	n--;
	cout<<rec(0);
	return 0;
}

Measured memory_bytes: 4340
using System;
 
    class Program
    {
        static void Main(string[] args)
        {
            // get a int A, B, T
            string[] z = Console.ReadLine().Split(' ');
            int a = Convert.ToInt16(z[0]);
            int b = Convert.ToInt16(z[1]);
            int t = Convert.ToInt16(z[2]);
            int biscuits = 0;
            for (int i = a; i <= t; i += a)
            {
                biscuits += b;
            }

            Console.Write(biscuits);
        }
    }

Measured memory_bytes: 13268
N = int(input())
P = []
for i in range(N):
	ta,tb = map(int ,input().split())
	if i == N-1:
		P.append(ta)
		P.append(tb)
	else:
		P.append(ta)
inf = float('inf')
dp = [[inf] * N for _ in range(N)]
for i in range(N):
	if i == N-1:
		dp[i][i] = 0
	else:
		dp[i][i] = 0
		dp[i][i+1] = P[i]*P[i+1]*P[i+2]

for right in range(2,N):
	for i in range(N):
		j = i + right
		if j > N-1:
			break

		for k in range(i,j):
			dp[i][j] = min(dp[i][j], dp[i][k]+dp[k+1][j]+P[i]*P[k+1]*P[j+1])

		

print(dp[0][N-1])


Measured memory_bytes: 5684
#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>;
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; }

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string s;
    cin >> s;
    int ans = 0, cnt = 0;
    rep(i,s.size()){
    	if(s[i] == 'A' || s[i] == 'C' || s[i] == 'G' || s[i] == 'T'){
    		cnt++;
    	}
    	else{
    		chmax(ans, cnt);
    		cnt = 0;
    	}
    }
    chmax(ans, cnt);
    cout << ans << endl;
    return 0;
}

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

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] inputData = Console.ReadLine().Split(' ');
            List<int> dataList = new List<int>();
            int maxNum = 0;
            foreach (string data in Console.ReadLine().Split(' ')) {
                dataList.Add(int.Parse(data));
                maxNum += dataList.Last();
            }
            int picupCnt = int.Parse(inputData[1]);
            double stdNum = maxNum / ((double)4 * picupCnt);

            dataList.Sort();
            dataList.Reverse();
            for (int loop = 0; loop < picupCnt; loop++) { 
                if(dataList[loop] < stdNum)
                {
                    Console.WriteLine("No");
                    return;
                }
            }
            Console.WriteLine("Yes");
            Console.ReadLine();
        }
    }
}


Measured memory_bytes: 11220
#include <iostream>
#include <vector>
#include <iomanip>
#include <set>
#include <map>
#include <algorithm>
#include <utility>
#include <cmath>
#include <deque>

using namespace std;

long long mod = 1e5 + 7;
long long p = 31;
long long st;

pair<long long, deque<char> > next_(pair<long long, deque<char> > x) {
    long long h = x.first;
    deque<char> cur = x.second;
    long long l = (long long) cur.front();
    h -= (l * st) % mod;
    if (h < 0) {
        h += mod;
        h %= mod;
    }
    h *= p;
    h %= mod;
    h += l;
    h %= mod;
    cur.push_back(cur.front());
    cur.pop_front();
    return {h, cur};
}

long long mxd(long long x) {
    long long y = x;
    long long mx = 0;
    while (y > 0) {
        mx = max(mx, y % 10);
        y /= 10;
    }
    return mx;
}

long long mnd(long long x) {
    long long y = x;
    long long mx = 11;
    while (y > 0) {
        mx = min(mx, y % 10);
        y /= 10;
    }
    return mx;
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    int a;
    cin >> a;
    a %= 10;
    if (a == 2 || a == 4 || a == 5 || a == 7 || a == 9) {
        cout << "hon\n";
    } else {
        if (a == 0 || a == 1 || a == 6 || a == 8) {
            cout << "pon\n";
        } else {
            cout << "bon\n";
        }
    }
    return 0;
}


Measured memory_bytes: 3112
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)

typedef int long long ll;
using namespace std;
typedef pair<int,int> P;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const ll MOD=1e9+7;
static const int MAX = 100;
static const int INF = (1<<23);
template<class T> T gcd(T a, T b){return b? gcd(b,a%b) : a;}
template<class T> T lcm(T a,T b){return a / gcd(a,b)*b;}

int main(){


    ll n,m,k;
    cin>>n>>m>>k;
    vector<ll> a(n);
    vector<ll> b(m);
    rep(i,n){
        cin>>a[i];
    }

    rep(i,m){
        cin>>b[i];
    }

    ll sum = 0;
    vector<pair<ll,int>> ar;
    vector<pair<ll,int>> br;
    ar.push_back({0,0});
    br.push_back({0,0});

    rep(i,n){
        if(sum+a[i]<=k){
            sum+=a[i];
            ar.push_back({sum,i+1});
        }else{
            break;
        }
    }
    sum=0;
    rep(i,m){
        if(sum+b[i]<=k){
            sum+=b[i];
            br.push_back({sum,i+1});
        }else{
            break;
    }
    }

    sort(br.begin(),br.end());
    ll ans = 0;

    for(int i=0;i<ar.size();i++){
        ll kk = k-ar[i].first;
        ll ss = ar[i].second;
        //cout<<kk<<" "<<ss<<endl;

        auto bk = upper_bound(br.begin(),br.end(),make_pair(kk,200010));


        if(bk!=br.begin()){
            bk --;
        }else{
            continue;
        }

        //cout<<bk->first<<endl;
        if(bk->first<=kk){
        ss+=bk->second;
        ans=max(ans,ss);
        }


    }
    cout<<ans<<endl;








return 0;
}


Measured memory_bytes: 15572
#include<bits/stdc++.h>
    #define ll long long
    #define pb push_back
    #define fi first
    #define se second
    ll sieve[1000001]={0},i,j;
    ll m=1e9+7;
    ll lev=0;
    ll n,k;
    ll power(ll p, ll k)
    {
    ll a=1;
    while(k)
    {
    if(k&1)
    a=(a*p)%m;
    p=(p*p)%m;
    k>>=1;
    }
    return a;
    }
    using namespace std;
    vector<ll> v[1000000+1];
    ll vis[1000000+1]={0};
    void dfs(ll u,ll p,ll lev)
    {
        vis[u]=lev;
    for(auto x: v[u])
    {
    if(x!=p)
    {
    dfs(x,u,lev+1);
    }
    }
    }
    int main()
    {
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
     int tc=1;
    //cin>>tc;
    ll cas=1;
     while(tc--)
     {
      
     ll n,m;
     cin>>n>>m;
     ll a[m];
     ll ans=n;
     for(i=0;i<m;i++)
     {
     cin>>a[i];
     ans-=a[i];
      }
      if(ans>=0)
      cout<<ans;
      else
      cout<<-1;
         cout<<"\n"; 
     } 
    }

Measured memory_bytes: 27132
class Array
  def imos
    n = size

    ret = map(&:dup)

    0.upto(n - 1) do |i|
      0.upto(n - 1) do |j|
        ret[i][j] += ret[i][j - 1]
      end
    end

    0.upto(n - 1) do |i|
      0.upto(n - 1) do |j|
        ret[i][j] += ret[i - 1][j]
      end
    end

    ret
  end
end

N, M, Q = gets.split.map(&:to_i)

csum = Array.new(N + 1) { Array.new(N + 1, 0) }

M.times do
  l, r = gets.split.map(&:to_i)

  csum[l][r] += 1
end

csum = csum.imos

Q.times do
  from, to = gets.split.map(&:to_i)

  puts csum[to][to] + csum[from - 1][from - 1] - csum[from - 1][to] - csum[to][from - 1]
end


Measured memory_bytes: 6652
#include <bits/stdc++.h>
using namespace std;
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

int main() {FIN
        int n, m;
            cin >> n >> m;
            cout << (n == m ? "Yes" : "No") << "\n";
  	return 0;
        }

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <map>
#include <vector>
#include <set>
#include <iomanip>
#include <fstream>
#include <stdint.h>
#include <cmath>
#include <algorithm>
#include <utility>
#include <numeric>
#include <stack>
using namespace std;

constexpr int INF       = 1000000000;/* 1e+9a */
constexpr int MODULO    = 1000000007;

constexpr int evx[4] = { 1, 0, -1, 0 };
constexpr int evy[4] = { 0, 1, 0, -1 };

//----------------------------------
//----------------------------------

signed main()
{
    ios::sync_with_stdio(false);
        int n;
        cin >> n;
        vector<int> a;
        for(int i = 0; i < n; i++)
        {
                int tmp;
                cin >> tmp;
                a.push_back(tmp);
        }

        stack<pair<int,int>> mins;
        int now_min = INF * 2;
        int point = -1;
        for(int i = 0; i < n; ++i)
        {
                if(now_min > a[i])
                {
                        now_min = a[i];
                        point = i;
                        mins.push({now_min, point});
                }
        }
        int max_dif = -INF;
        mins.pop();
        for(int i = n-1; i >= 1; --i)
        {
                if(point >= i)
                {
                        now_min = mins.top().first;
                        point = mins.top().second;
                        mins.pop();
                }

                int dif = a[i] - now_min;

                max_dif = max_dif < dif ? dif : max_dif;
        }
        cout << max_dif << '\n';
}

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

using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
#define a first
#define b second
#define sz size()
#define pb(x) push_back(x) 
#define bg begin()
#define ed end()
#define rep(i,n) for(ll i=0;i<n;i++)
#define rep1(i,n) for(ll i=1;i<=n;i++)
#define mp(x,y) make_pair(x,y)
const ll MOD=1000000007;

vector<ll> time6(21,1);
vector<ll> time9(19,1);

ll maxx(ll x,ll y,ll z){
	return max(max(x,y),z);
}
ll minn(ll x,ll y,ll z){
	return min(min(x,y),z);
}
ll gcd(ll x,ll y){
	if(x%y==0) return y;
    else return gcd(y,x%y);
}
ll lcm(ll x,ll y){
	return x*(y/gcd(x,y));
}
ll myceil(ll x,ll y){//yがいくつ集まったらx以上になるか
	if(x<=y) return 1;
	else if(x%y==0) return x/y;
	else return x/y+1;
}

//a,b x
int main(){
	rep1(i,20) time6[i]=6*time6[i-1];
	rep1(i,18) time9[i]=9*time9[i-1];
	
	ll N; cin>>N;

	ll ans=10000000;
	rep(M,N+1){
		ll cnt=0,i=0;
		while(time6[i]<=M){
			cnt+=M/time6[i++]%6;
		}
		//N-Mを9の倍数で払う
		i=0;
		while(time9[i]<=N-M){
			cnt+=(N-M)/time9[i++]%9;
		}
		ans=min(ans,cnt);
	}
	cout<<ans;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
template <typename T> void read(T &t) {
	t=0; char ch=getchar(); int f=1;
	while ('0'>ch||ch>'9') { if (ch=='-') f=-1; ch=getchar(); }
	do {(t*=10)+=ch-'0';ch=getchar();} while ('0'<=ch&&ch<='9'); t*=f;
}
int n=4;
int d[5][5],a[5];
int main() {
	//freopen("1.txt","r",stdin);
	for (int i=1;i<4;i++) {
		int x,y; read(x); read(y);
		d[x][y]=d[y][x]=1;
	}
	for (int i=1;i<=n;i++)
		a[i]=i;
	do {
		int flag=1;
		for (int i=1;i<n;i++)
			if (!d[a[i]][a[i+1]]) {
				flag=0; break;
			}
		if (flag) { printf("YES\n"); return 0; }
	} while (next_permutation(a+1,a+n+1));
	printf("NO\n");
	return 0;
}

Measured memory_bytes: 256
input = readlines()

l1 = input.shift.chomp.split("\s").map{|x| x.to_i}
l2 = input.shift.chomp.split("\s").map{|x| x.to_i}
l3 = input.shift.chomp.split("\s").map{|x| x.to_i}

num = input.shift.chomp.to_i

opened = []
input.each do |n|
  n = n.chomp.to_i
  opened.push(n)
end

done = false

done = true if l1.all?{|x| opened.include?(x)}
done = true if l2.all?{|x| opened.include?(x)}
done = true if l3.all?{|x| opened.include?(x)}
done = true if [l1[0], l2[0], l3[0]].all?{|x| opened.include?(x)}
done = true if [l1[1], l2[1], l3[1]].all?{|x| opened.include?(x)}
done = true if [l1[2], l2[2], l3[2]].all?{|x| opened.include?(x)}
done = true if [l1[0], l2[1], l3[2]].all?{|x| opened.include?(x)}
done = true if [l1[2], l2[1], l3[0]].all?{|x| opened.include?(x)}

puts done ? 'Yes' : 'No'


Measured memory_bytes: 14244
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    int n;

    public static void main(String args[]) {
        new Main().run();
    }

    void run() {
        FastReader sc = new FastReader();
        n = sc.nextInt();
        solve();
    }

    void solve() {
        System.out.println(n / 3);
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine() {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}


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

int W_Length(char *str){
	int length = 0;
	while(*str++ != '\0')
		length++;
	return length;
}

double deg(double theta){//deg to theta
return theta*(2*3.14159265359)/360;
}

int cmp( const void *p, const void *q ) {
    return -*(int*)p + *(int*)q;
}//大きい順
//qsort(a,n,sizeof(int),cmp);
//char s[n][11]

int cmp_s(const void * left, const void * right)
{
	char *left_char = (char *)left;
  char *right_char = (char *)right;
  return strcmp(left_char, right_char);
}
//qsort(s,n,sizeof(s[0]),cmp_s);


int main (void)
{
	int a[10];
	scanf("%d%d%d%d%d",&a[1],&a[2],&a[3],&a[4],&a[5]);
for(int i=1;i<=5;i++){
	if(a[i]==0){
printf("%d\n",i);
	}
}


	
	return 0;
}


Measured memory_bytes: 1684
n,m,l=map(int,input().split(' '))
a=[]
b=[]
for i in range(n):
  a.append(list(map(int,input().split(' '))))
for i in range(m):
  b.append(list(map(int,input().split(' '))))


for i in range(n):
  c=''
  for j in range(l):
    cij=0
    for k in range(m):
      cij+=a[i][k]*b[k][j]
    if j==l-1:
      c+=str(cij)
    else:
      c+=str(cij)+' '
  print(c)


Measured memory_bytes: 6316
#include <cstdio>
#include <algorithm>
using namespace std;

int main()
{
    int n;
    scanf("%d", &n);
    vector<int> A(2 * n);
    for (int i = 0; i < 2 * n; i++) {
        scanf("%d", &A[i]);
    }
    sort(A.begin(), A.end());
    int ans = 0;
    for (int i = 0; i < n; i++)
        ans += A[2 * i];
    printf("%d\n", ans);
}


Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
int main(){
    int a,b,ans=-100000000;
    scanf("%d%d",&a,&b);
    ans=max(ans,a+b);
    ans=max(ans,a-b);
    ans=max(ans,a*b);
    printf("%d\n",ans);
}

Measured memory_bytes: 888
using System;
using System.Linq;
using System.Collections.Generic;
class P
{
    static int[] s = { 2, 5, 5, 4, 5, 6, 3, 7, 6 };
    static void Main()
    {
        var inputs = Console.ReadLine().Split().Select(int.Parse).ToArray();
        int n = inputs[0], m = inputs[1];
        var a = Console.ReadLine().Split().Select(int.Parse).ToArray();
        bool[] e = new bool[9];
        foreach (var i in a)
            e[i - 1] = true;
        HashSet<int> hs = new HashSet<int>();
        for (int i = 1; i <= 9; i++)
            if (a.Contains(i))
                hs.Add(s[i - 1]);
        var dp = new int[n + 1];
        for (int i = 1; i <= n; i++)
            dp[i] = -int.MaxValue;
        for (int i = 1; i <= n; i++)
        {
            for (int j = 0; j < 9; j++)
            {
                if (!e[j])
                    continue;
                try
                {
                    dp[i] = Math.Max(dp[i], dp[i - s[j]] + 1);
                }
                catch { }
            }
        }
        List<int> ans = new List<int>();
        for (int i = 8; i >= 0; i--)
        {
            if (!e[i])
                continue;
            while (true)
            {
                    if (n >= s[i] && dp[n - s[i]] + 1 == dp[n])
                    {
                        ans.Add(i + 1);
                        n -= s[i];
                    }
                    else
                    {
                        break;
                    }
            }
            if (n == 0)
                break;
        }
        foreach (var i in ans)
            Console.Write(i);
        Console.WriteLine();
    }
}

Measured memory_bytes: 13412
w,h,x,y,r=map(int,raw_input().split())

f=0
if x+r>w:
    f=1
if y+r>h:
    f=1
if r>x:
    f=1
if r>y:
    f=1
if f==0:
    print "Yes"
else:
    print "No"

Measured memory_bytes: 6436
n, k, d = map(int,input().split())
if abs(n) - k * d < 0:
    j = abs(n)//d
    z = k - j
    if z % 2 == 0:
        print(abs(n)-j*d)
    else:
        print(d-(abs(n)-j*d))
else:
    print(abs(n) - k * d)

Measured memory_bytes: 9132
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
# define mod 1000000007
# define INF (1 << 29)
# define MAX_N 1000010
/* ACはうれCすぎてうれD */

int main(void){ 
    int h,w,k;
    cin >> h >> w >> k;
    vector<string> s;
    for(int i=0; i<h; i++){
        string tmp_s;
        cin >> tmp_s;
        s.push_back(tmp_s); // 忘れてたのなぜ
    }

    int kosuu[h];
    for(int i=0; i<h; i++){
        kosuu[i] = 0;
    }

    // 各行の個数
    for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
            if(s[i][j] == '#'){
                kosuu[i] += 1;
            }
        }
    }

    int r_kosu[h+1];
    r_kosu[0] = 0;
    for(int i=0; i<h; i++){
        r_kosu[i+1] = r_kosu[i] + kosuu[i];
    }

    
    int a[h][w];
    for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
            a[i][j] = 0;
        }
    }

    for(int i=0; i<h; i++){
        int num = kosuu[i] + r_kosu[i];
        if(kosuu[i] == 0){
            num = -1;
        }
        int flag = 0;
        for(int j=0; j<w; j++){
            if(s[i][j] == '#' && flag!=0){
                num -= 1;
            }
            else if(s[i][j] == '#' && flag == 0){
                flag = 1;
            }
            a[i][j] = num;
        }
    }

    // 空行対策
    for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
            if(a[i][j] == -1 && i!=0){
                a[i][j] = a[i-1][j];
            }
        }
    }
    for(int i=h-1; i>=0; i--){
        for(int j=0; j<w; j++){
            if(a[i][j] == -1 && i!=h-1){
                a[i][j] = a[i+1][j];
            }
        }
    }

    // output
    for(int i=0; i<h; i++){
        for(int j=0; j<w; j++){
            cout << a[i][j] << " ";
        }
        cout << "\n";
    }

    return 0;
}

Measured memory_bytes: 1280
// Author : Mohamed Sameh
#include <bits/stdc++.h>
typedef long long ll ;
#define pb push_back
#define f first
#define s second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define SZ(a) (int)a.size()
#define Flush fflush(stdout);
using namespace std ;
int main()
{
    int a, b , c ;
    scanf ("%d%d%d" , &a ,&b ,&c );
    if (a + b >= c )
    {
        printf ("Yes\n");
    }else
    printf ("No\n");
}


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

int main(){
  int n;
  std::cin >> n;
  vector<int> fib(1e6 + 10, 1);
  for (int i = 0; i < 1e6; i++) {
    fib[i + 1] += fib[i] + i;
  }
  for (int i = 0; i < 1e6; i++) {
    if(n < fib[i]){
      std::cout << i << std::endl;
      break;
    }else if(n == fib[i]){
      std::cout << i + 1 << std::endl;
      break;
    }
  }
  return 0;
}


Measured memory_bytes: 4096
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author silviase
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        CAlternatingPath solver = new CAlternatingPath();
        solver.solve(1, in, out);
        out.close();
    }

    static class CAlternatingPath {
        int h;
        int w;
        char[][] c;
        boolean[][] used;
        long ans = 0;
        int[] dx = {-1, 0, 0, 1};
        int[] dy = {0, -1, 1, 0};

        public void solve(int testNumber, Scanner in, PrintWriter out) {

            h = in.nextInt();
            w = in.nextInt();
            c = new char[h][w];
            used = new boolean[h][w];
            for (int i = 0; i < h; i++) {
                c[i] = in.next().toCharArray();
                Arrays.fill(used[i], false);
            }

            for (int i = 0; i < h; i++) {
                for (int j = 0; j < w; j++) {
                    Pair p = new Pair(0, 0);
                    dfs(i, j, p);
                    ans += p.x * p.y;
                }
            }
            out.println(ans);
        }

        void dfs(int x, int y, Pair p) {
            if (used[x][y]) {
                return;
            }

            used[x][y] = true;

            if (c[x][y] == '.') {
                p.y++;
            } else {
                p.x++;
            }

            for (int i = 0; i < 4; i++) {
                int nx = x + dx[i];
                int ny = y + dy[i];
                if (0 <= nx && nx < h && 0 <= ny && ny < w) {
                    if (c[x][y] != c[nx][ny] && !used[nx][ny]) {
                        dfs(nx, ny, p);
                    }
                }
            }
        }

    }

    static class Pair {
        public long x;
        public long y;

        public Pair(long x, long y) {
            this.x = x;
            this.y = y;
        }

        public String toString() {
            return "Pair{" +
                    "x=" + x +
                    ", y=" + y +
                    '}';
        }

    }
}



Measured memory_bytes: 51132
#include <iostream>
#include <vector>
#include <utility>
#include <map>
#include <algorithm>
#include <queue>
#include <cmath>

using namespace std;

int main()
{
	int p, q, r;
	int ans = 999;
	cin >> p >> q >> r;

	ans = min(ans, p + q);
	ans = min(ans, q + r);
	ans = min(ans, r + p);

	cout << ans << endl;
}


Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;

namespace MyProgram
{
    public class Program
    {	
        public static void Main(string[] args)
        {
            int n = int.Parse(Console.ReadLine());
            int[] houses = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();
            
            int min = 999999999;
            int max = 0;
            
            for(int i = 0 ; i < n ; i++)
            {
                min = Math.Min(min, houses[i]);
                max = Math.Max(max, houses[i]);
            }
            
            Console.WriteLine(max-min);
        }
        
    }
}

Measured memory_bytes: 13268
use proconio::{input, fastout};
use proconio::marker::{Chars};
use proconio::marker::Usize1;
use std::cmp::*;

macro_rules! debug {
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

#[fastout]
fn main() {
    input!{
        s: Chars,
    }

    for i in 0..s.len() {
        if i==s.len()-1 {
            if s[s.len()-1]=='s' {
                print!("{}", s[i]);
                println!("es");
            } else {
                print!("{}", s[i]);
                println!("s");
            }
        } else {
            print!("{}", s[i]);
        }
    }

}


Measured memory_bytes: 2136
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
	"strings"
)

type bufReader struct {
	r   *bufio.Reader
	buf []byte
	i   int
}

var reader = &bufReader{
	bufio.NewReader(os.Stdin),
	make([]byte, 0),
	0,
}

func (r *bufReader) readLine() {
	if r.i < len(r.buf) {
		return
	}
	r.buf = make([]byte, 0)
	r.i = 0
	for {
		line, isPrefix, err := r.r.ReadLine()
		if err != nil {
			panic(err)
		}
		r.buf = append(r.buf, line...)
		if !isPrefix {
			break
		}
	}
}

func (r *bufReader) next() string {
	r.readLine()
	from := r.i
	for ; r.i < len(r.buf); r.i++ {
		if r.buf[r.i] == ' ' {
			break
		}
	}
	s := string(r.buf[from:r.i])
	r.i++
	return s
}

func (r *bufReader) nextLine() string {
	r.readLine()
	s := string(r.buf[r.i:])
	r.i = len(r.buf)
	return s
}

var writer = bufio.NewWriter(os.Stdout)

func next() string {
	return reader.next()
}

func nextInt64() int64 {
	i, err := strconv.ParseInt(reader.next(), 10, 64)
	if err != nil {
		panic(err)
	}
	return i
}

func nextInt() int {
	return int(nextInt64())
}

func nextLine() string {
	return reader.nextLine()
}

func out(a ...interface{}) {
	fmt.Fprintln(writer, a...)
}

func max64(x, y int64) int64 {
	if x > y {
		return x
	}
	return y
}

func max(x, y int) int {
	return int(max64(int64(x), int64(y)))
}

func min64(x, y int64) int64 {
	if x < y {
		return x
	}
	return y
}

func min(x, y int) int {
	return int(min64(int64(x), int64(y)))
}

func abs64(x int64) int64 {
	if x < 0 {
		return -x
	}
	return x
}

func abs(x int) int {
	return int(abs64(int64(x)))
}

func joinInt64s(a []int64, sep string) string {
	b := make([]string, len(a))
	for i, v := range a {
		b[i] = strconv.FormatInt(v, 10)
	}
	return strings.Join(b, sep)
}

func joinInts(a []int, sep string) string {
	b := make([]string, len(a))
	for i, v := range a {
		b[i] = strconv.Itoa(v)
	}
	return strings.Join(b, sep)
}

func divUp64(x, y int64) int64 {
	return (x + y - 1) / y
}

func divUp(x, y int) int {
	return int(divUp64(int64(x), int64(y)))
}

func gcd64(x, y int64) int64 {
	if x < y {
		x, y = y, x
	}
	for y != 0 {
		x, y = y, x%y
	}
	return x
}

func gcd(x, y int) int {
	return int(gcd64(int64(x), int64(y)))
}

func lcm64(x, y int64) int64 {
	return x * y / gcd64(x, y)
}

func lcm(x, y int) int {
	return int(lcm64(int64(x), int64(y)))
}

func pow64(x, y int64) int64 {
	return int64(math.Pow(float64(x), float64(y)))
}

func pow(x, y int) int {
	return int(pow64(int64(x), int64(y)))
}

func main() {
	solve()
	writer.Flush()
}

func solve() {
	out(max(nextInt()*nextInt(), nextInt()*nextInt()))
}


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

int top,S[1000];

void push(int x){
  S[++top] = x;
}

int pop(){
  top--;
  return S[top+1];
}

int main(){
  int a,b;
  top = 0;

  char s[100];

  while( scanf("%s",s) != EOF){
    if (s[0] == '+'){
      a = pop();
      b = pop();
      push(a + b);
    }else if (s[0]=='-'){
      b = pop();
      a = pop();
      push(a - b);
    }else if (s[0]=='*'){
      a = pop();
      b = pop();
      push(a * b);
    }else {
      push(atoi(s));
    }
  }

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

  return 0;
}



Measured memory_bytes: 2108
#include <bits/stdc++.h>
#include <numeric>
#define ll long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)

#define pr pair<int, int>

using namespace std;

const ll mod = 1000000007;
const ll INF = (ll)1000000007 * 1000000007;


//#define DEBUG

#ifdef DEBUG
#define PRINT(A) std::cout << (#A) << ":" << (A) << std::endl;
#else
#define PRINT(A)
#endif

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


int a[10010][10010], b[1000];
int dp[10010][3];
 

int main()
{

    int L; cin >> L;

    double l = L/3.0;
    cout << fixed << l*l*l << endl;
    

    return 0;
}


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

int dp[100001];

int solve(int* arr, int i, int n) {
	if(i==n) return 0;
  
    if(dp[i] != -1) return dp[i];

  	int op1 =10e8;
  	int op2 =10e8;
  
  	if(i+1 <= n) op1 = abs(arr[i] - arr[i+1]) + solve(arr, i+1, n);
	
  	if(i+2 <= n) op2 = abs(arr[i] - arr[i+2]) + solve(arr, i+2, n);
  
  	return dp[i] = min(op1, op2);

}
 
int main() {
  	int n;
  	cin>>n;
  	
  	int* arr = new int[n];
  	for(int i=0; i<n; i++) cin>>arr[i];
    memset(dp, -1, sizeof(dp));
  	cout<<solve(arr, 0, n-1);
  	
	return 0;
}

Measured memory_bytes: 10612
n = int(input())
w = list(input() for _ in range(n))
p = w[0][0]

if len(w) != len(set(w)):
    ans = 'No'
else:
    for i in w:
        if i[0] != p:
            ans = 'No'
            break
        else:
            p = i[-1]
    else:
        ans = 'Yes'

print(ans)


Measured memory_bytes: 9136
def solve(n, ga, sa, ba, gb, sb, bb):
    ans = n
    for g in range(1 if ga >= gb else n // ga + 1):
        n2 = n - g * ga
        tmp1 = g * gb
        if ba >= bb:
            s = n2 // sa
            ans = max(ans, n2 + tmp1, n2 - s * sa + tmp1 + s * sb)
        elif sa >= sb:
            b = n2 // ba
            ans = max(ans, n2 + tmp1, n2 - b * ba + tmp1 + b * bb)
        else:
            for s in range(n2 // sa + 1):
                b = (n2 - s * sa) // ba
                ans = max(ans, n2 - s * sa - b * ba + tmp1 + s * sb + b * bb)
    return ans


n = int(input())
ga, sa, ba = list(map(int, input().split()))
gb, sb, bb = list(map(int, input().split()))
n2 = solve(n, ga, sa, ba, gb, sb, bb)
n3 = solve(n2, gb, sb, bb, ga, sa, ba)
print(n3)


Measured memory_bytes: 39792
#define _GLIBCXX_DEBUG
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>
#include <map>
#include <list>
#include <cmath>
using namespace std;
typedef long long ll;
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define mp make_pair
#define pb push_back
const int INF = 1e9;
const ll LINF = 1e18;
const int MOD = 1e9+7;

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n;
	ll ans = 1e12;
	cin >> n;
	for (ll i = 1; i*i <= n; i++) {
		ll j;
		if (n % i == 0) {
			j = n / i; 
			ans = min(ans, i+j-2);
		}
	}

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


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		long x = 0;
		for(int i=1; i<n+1; i++) {
			if(i%3 != 0 && i%5 != 0) {
				x += i;
			}
		}
		System.out.println(x);
	}

}


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

int main() {
  int n;
  cin >> n;
  bool flag = false;
  for(int i=1;i<10;i++){
    for(int j=1;j<10;j++){
      if(i*j==n&&flag==false){
        cout << "Yes" << endl;
        flag = true;
      }
    }
  }
  if(flag==0) cout << "No" << endl;
}


Measured memory_bytes: 256
object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val S, T = sc.next
  var A, B = sc.nextInt
  val U = sc.next
  
  if (U == S) {
    A -= 1 
  } else {
    B -= 1
  }

  printf(A + " " + B)
}


Measured memory_bytes: 55352
#include <iostream>
#include <cstdio>
#include <string>
#include <cmath>
#include <cctype>
#include <cstdlib>
#include <stack>
#include <queue>
#include <vector>
#include <algorithm>
#include <list>
using namespace std;

int main() {
    int a, b;
    cin >> a >> b;
    int m = max({ a + b, a - b,a * b });
    cout << m << endl;
}




    


Measured memory_bytes: 256
import java.util.ArrayDeque;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Deque;
import java.util.List;
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int h = Integer.parseInt(sc.next());
        int w = Integer.parseInt(sc.next());
        List<Integer> xL = new ArrayList<>();
        List<Integer> yL = new ArrayList<>();
        char[][] map = new char[h][w];
        int cnt = 0;
        for (int i = 0; i < h; i++) {
            map[i] = sc.next().toCharArray();
            for (int j = 0; j < w; j++) {
                if (map[i][j] == '.') {
                    xL.add(j);
                    yL.add(i);
                } else {
                    cnt++;
                }
            }
        }
        int ans = 0;
        for (int i = 0; i < xL.size(); i++) {
            Point start = new Point(xL.get(i), yL.get(i));
            ans = Math.max(ans, bfs(start, map.clone(), h, w));
        }
        System.out.println(ans);
    }

    private static int bfs(Point start, char[][] baseMap, int h, int w) {
        int[] dx = {1, 0, -1, 0};
        int[] dy = {0, 1, 0, -1};
        Deque<Point> dq = new ArrayDeque<>();
        dq.add(start);
        char[][] map = deepCopy(baseMap);
        int[][] moves = new int[h][w];
        map[start.getY()][start.getX()] = '#';
        while (dq.size() > 0) {
            Point p = dq.removeFirst();
            for (int i = 0; i < 4; i++) {
                int x = p.getX() + dx[i];
                int y = p.getY() + dy[i];
                if (x < 0 || x > w - 1 || y < 0 || y > h - 1) {
                    continue;
                }
                if (map[y][x] == '.') {
                    dq.addLast(new Point(x, y));
                    map[y][x] = '#';
                    moves[y][x] = moves[p.getY()][p.getX()] + 1;
                }
            }
        }
        int ans = 0;
        for (int i = 0; i < h; i++) {
            for (int j = 0; j < w; j++) {
                ans = Math.max(ans, moves[i][j]);
            }
        }
        return ans;
    }

    private static char[][] deepCopy(char[][] org) {
        if (org == null) {
            return null;
        }

        final char[][] result = new char[org.length][];
        for (int i = 0; i < org.length; i++) {
            result[i] = Arrays.copyOf(org[i], org[i].length);
        }
        return result;
    }
}

class Point {

    private int x;
    private int y;

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

    public int getX() {
        return x;
    }

    public void setX(int x) {
        this.x = x;
    }

    public int getY() {
        return y;
    }

    public void setY(int y) {
        this.y = y;
    }
}

Measured memory_bytes: 25788
N,M,C = map(int,input().split())
B = list(map(int,input().split()))
ans = 0
for i in range(N):
    A = list(map(int,input().split()))
    sum = 0
    for j in range(M):
        sum += A[j]*B[j]
    sum += C
    if sum > 0:
        ans += 1
print(ans)

Measured memory_bytes: 3060
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {
    int x;

    public static void main(String args[]) {
        new Main().run();
    }

    void run() {
        FastReader sc = new FastReader();
        x = sc.nextInt();
        solve();
    }

    void solve() {
        System.out.println(x < 1200 ? "ABC" : "ARC");
    }

    static class FastReader {
        BufferedReader br;
        StringTokenizer st;

        public FastReader() {
            br = new BufferedReader(new
                    InputStreamReader(System.in));
        }

        String next() {
            while (st == null || !st.hasMoreElements())
            {
                try
                {
                    st = new StringTokenizer(br.readLine());
                }
                catch (IOException e)
                {
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }

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

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

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

        String nextLine() {
            String str = "";
            try
            {
                str = br.readLine();
            }
            catch (IOException e)
            {
                e.printStackTrace();
            }
            return str;
        }
    }
}


Measured memory_bytes: 21204