akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repR(i, n) for(int i = n; i >= 0; ++i)
#define FDS(i, n) for(ll i = 0; i < n; ++i)
#define FDSR(i, n) for(int i = n; i >= 0; ++i)
#define FOR(i, m, n) for(int i = m; i < n; ++i)
#define FORR(i, m, n) for(int i = m;i >= n;--i)
#define VSORT(v) sort(v.begin(), v.end());
#define INF 999999999
#define itn int
#define ednl endl
using namespace std;
typedef long long ll;
int main(){
  vector <int> vec(3);
  FDS(i,3) cin>>vec[i];
  VSORT(vec);
  if(vec[0]==5&&vec[1]==5&&vec[2]==7){
    cout<<"YES"<<endl;
  }
  else cout<<"NO"<<endl;
}

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

using namespace std;

typedef long long int lli;

int main() {
    int a, b, q;

    cin >> a >> b >> q;

    vector<lli> s(a+2), t(b+2);
    s[0] = t[0] = -10e+11;
    s[a+1] = t[b+1] = 10e+11;
    for (int i=1; i<=a; i++) scanf("%lld", &s[i]);
    for (int i=1; i<=b; i++) scanf("%lld", &t[i]);

    /*
    for (int i=1; i<=a; i++) cout << s[i] << " ";
    cout << endl << endl;
    */

    lli x;
    for (int i=0; i<q; i++) {
        scanf("%lld", &x);
        
        lli ans = 10e+11, tmp;
        // s -> t
        auto itr_s = upper_bound(s.begin(), s.end(), x);
        auto itr_t = lower_bound(t.begin(), t.end(), *itr_s);

        tmp = (*itr_s-x) + min(*itr_t-*itr_s, *itr_s-*(itr_t-1));
        ans = min(ans, tmp);
        // cout << ans << " ";
        // cout << *itr_s << " " << x << " ";

        if (itr_s != s.begin()) itr_s--;
        itr_t = upper_bound(t.begin(), t.end(), *itr_s);
        tmp = (x-*itr_s) + min(*itr_t-*itr_s, *itr_s-*(itr_t-1));
        ans = min(ans, tmp);
        // cout << ans << " ";
        // cout << *itr_s << " " << x << " ";

        // t -> s
        itr_t = upper_bound(t.begin(), t.end(), x);
        itr_s = lower_bound(s.begin(), s.end(), *itr_t);
        tmp = (*itr_t-x) + min(*itr_s-*itr_t, *itr_t-*(itr_s-1));
        ans = min(ans, tmp);
        // cout << ans << " ";
        // cout << *itr_s << " " << *itr_t << " " << x << " ";

        if (itr_t != t.begin()) itr_t--;
        itr_s = upper_bound(s.begin(), s.end(), *itr_t);
        tmp = (x-*itr_t) + min(*itr_s-*itr_t, *itr_t-*(itr_s-1));
        ans = min(ans, tmp);
        // cout << ans << " ";
        // cout << *itr_s << " " << *itr_t << " " << x << " ";

        cout << ans << endl;
    }

    return 0;
}


Measured memory_bytes: 2944
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1000000007;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const ll MAX_N = ll(2e5 + 5);
const double EPS = 1e-10;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i,n) for (int i = n; i >=0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define ALL(v) (v).begin(), (v).end()

//ll n, Q, a, cum[MAX_N]{};

int main(){
    int n, m, d, table[105][105]{}, ans = 0;
    string s[105];
    cin >> n >> m >> d;
    REP(i,n){
        cin >> s[i];
    }
    REP(i,n)REP(j,m) table[i+1][j+1] += table[i+1][j] + (s[i][j]=='#'?1:0);
    REP(j,m)REP(i,n) table[i+1][j+1] += table[i][j+1];
    
    REP(i,n){
        REP(j,m-d+1){
            if(s[i][j]=='#')continue;
            if(table[i+1][j+d]-table[i][j+d]-table[i+1][j]+table[i][j]==0)
                ans++;
        }
    }
    REP(j,m){
        REP(i,n-d+1){
            if(s[i][j]=='#')continue;
            if(table[i+d][j+1]-table[i+d][j]-table[i][j+1]+table[i][j]==0)
                ans++;
        }
    }
    cout << ans << endl;
    return 0;
}



Measured memory_bytes: 3272
import Control.Monad

main = print =<< (pure (ans . (\[_, b] -> b))) <*> (replicateM 2 getLine)

getInts :: IO [Int]
getInts = (pure ((map read) . words)) <*> getLine

ans :: String -> Int
ans [] = 0
ans [_] = 0
ans [_, _] = 0
ans ('A':'B':'C':xs) = 1 + (ans xs)
ans (_:xs) = ans xs


Measured memory_bytes: 380
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main{

	public static void main(String[] args) throws IOException {
		// TODO Auto-generated method stub
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		int a = Integer.parseInt(br.readLine());
		String b = br.readLine();
		String[] bArray = b.split(" ");
		String out = "" ;
		for(int i = 0 ; i < a ; i++) {
			out += bArray[0].substring(i, i+1);
			out += bArray[1].substring(i, i+1);
		}
		System.out.println(out);
	}

}


Measured memory_bytes: 22228
#include <bits/stdc++.h>
using namespace std::literals::string_literals;
using i64 = long long;
using std::cout;
using std::endl;
using std::cin;

template<typename T>
std::vector<T> make_v(size_t a){return std::vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return std::vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

int main() {
	int a, b, c; scanf("%d%d%d", &a, &b, &c);
	
	if((a < c and c < b) or (b < c and c < a)) printf("Yes\n");
	else printf("No\n");
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
const string ln = "\n";
constexpr int INF = 1001001001;
constexpr int MOD = 1000000007;

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

  int a, b;
  cin >> a >> b;

  int ans = -1;
  for (int i = 0; i <= 1000000; i++) {
    if (floor(i * 0.08) == a && floor(i * 0.1) == b) {
      ans = i;
      break;
    }
  }

  cout << ans << ln;

  return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;
using System.Numerics;
using static System.Console;

class Solver {
    Scanner sc = new Scanner();

    public void Solve() {
        var S = ReadLine();

        var ans = 0;
        var bef = S[0];
        for (int i = 1; i < S.Length; i++) {
            if (bef != S[i]) ans++;
            bef = S[i];
        }
        WriteLine(ans);
    }
}



class Scanner {
    string[] s;
    int i;

    char[] cs = new char[] { ' ' };

    public Scanner() {
        s = new string[0];
        i = 0;
    }

    public string next() {
        if (i < s.Length) return s[i++];
        string st = Console.ReadLine();
        while (st == "") st = Console.ReadLine();
        s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
        if (s.Length == 0) return next();
        i = 0;
        return s[i++];
    }

    public int nextInt() {


        return int.Parse(next());
    }
    public int[] ArrayInt(int N, int add = 0) {
        int[] Array = new int[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextInt() + add;
        }
        return Array;
    }

    public long nextLong() {
        return long.Parse(next());
    }

    public long[] ArrayLong(int N, long add = 0) {
        long[] Array = new long[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextLong() + add;
        }
        return Array;
    }

    public double nextDouble() {
        return double.Parse(next());
    }

    public double[] ArrayDouble(int N, double add = 0) {
        double[] Array = new double[N];
        for (int i = 0; i < N; i++) {
            Array[i] = nextDouble() + add;
        }
        return Array;
    }
}

class Program {
    static void Main(string[] args) {
        Solver s = new Solver();
        s.Solve();
    }
}

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

int main() {
    int x, y;
    cin >> x >> y;
    
    bool conb = false;
    rep(i,x) {
        rep(j,x) {
            int sum = 2*i+4*j;
            if ((i+j==x) && (sum==y)) conb = true;
        }
    }

    if (conb) cout << "Yes" <<endl;
    else cout << "No" << endl;
    return 0;
}

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

void solve() {
    ll N;
    ll K;
    cin >> N >> K;

    ll fl = floor((double)N/(double)K);

    ll d = abs(N - K * fl);
    while (K - d < d) {
        d = abs(K - d);
    }
    cout << d << endl;
}

int main() {
    solve();
    return 0;
}


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


int main()
{
  int a, b, c, k;
  cin >> a >> b >> c >> k;
  
  if(a > c)
  {
    a ^= c ^= a ^= c;
  }
  
  if(b > c)
  {
    b ^= c ^= b ^= c;
  }
  
  if(a > b)
  {
    b ^= a ^= b ^= a;
  }
  
  c <<= k;
  
  cout << (a + b + c) << endl;
  return 0;
}

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

class Cards
{
  public:
    Cards(int n);
    void Shuffle(int k);
    void Show();

  private:
    void Cat(int k);
    void RiffleShuffle();
    
  private:
    vector<int> m_cards;
    int m_n;
};

Cards::Cards(int n) :
  m_cards(2 * n), m_n(n)
{
  for (int i = 0; i < 2 * n; ++i)
  {
    m_cards[i] = i + 1;
  }
}

void Cards::Shuffle(int k)
{
  if (k == 0)
  {
    RiffleShuffle();
  }
  else
  {
    Cat(k);
  }
}

void Cards::Cat(int k)
{
  vector<int> new_cards;
  
  for (int i = k; i < 2 * m_n; ++i)
  {
    new_cards.push_back(m_cards[i]);
  }
  for (int i = 0; i < k; ++i)
  {
    new_cards.push_back(m_cards[i]);
  }
  m_cards.swap(new_cards);
}

void Cards::RiffleShuffle()
{
  vector<int> even_cards;
  vector<int> odd_cards;
  for (int i = 0; i < m_n; ++i)
  {
    even_cards.push_back(m_cards[i]);
  }
  for (int i = m_n; i < 2 * m_n; ++i)
  {
    odd_cards.push_back(m_cards[i]);
  }

  vector<int> new_cards;
  for (int i = 0; i < m_n; ++i)
  {
    new_cards.push_back(even_cards[i]);
    new_cards.push_back(odd_cards[i]);
  }
  m_cards.swap(new_cards);
}

void Cards::Show()
{
  for (int card : m_cards)
  {
    cout << card << endl;
  }
}

int main(void)
{
  int n;
  cin >> n;
  Cards cards(n);
  int m;
  cin >> m;
  for (int i = 0; i < m; ++i)
  {
    int k;
    cin >> k;
    cards.Shuffle(k);
  }
  cards.Show();
  return 0;
}

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

using namespace std;

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;

ll x;

bool f(ll m) {
  ll y = x;
  for (int i = m; i > 0; i--) {
    if ((y -= i) <= 0) return true;
  }
  return false;
}

int main() {
  cin.tie(nullptr);
  ios::sync_with_stdio(false);
  ll l = 0, r = 1000000;
  cin >> x;
  while (r - l > 1) {
    ll m = (l + r) / 2;
    if (f(m)) {
      r = m;
    } else {
      l = m;
    }
  }
  cout << r << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#define  boost ios_base::sync_with_stdio(false);cin.tie(NULL);
#define ull unsigned long long
#define d1(x) cout<<#x<<" "<<x<<endl;
#define d2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define d2i(x,y,i) cout<<#x<<i<<" "<<x<<" "<<#y<<i<<" "<<y<<endl;

#define fr(i,l,r) for(ll i=l;i<r;i++)
#define mems(a,x) memset(a,x,sizeof(a))
#define mod 1000000007
#define ff first
#define ss second
#define pb(x) push_back(x)
#define vll vector<ll>
#define pbp(x,y) push_back(make_pair(x,y))
#define  mat vector<vector<ll>>
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void solve(){
ll x,y,a,b,c;
cin>>x>>y>>a>>b>>c;
vll aa(a),bb(b),cc(c);

fr(i,0,a)cin>>aa[i];
for(auto &x:bb)
cin>>x;
for(auto &x:cc)
cin>>x;
sort(aa.begin(),aa.end());
sort(bb.begin(),bb.end());
sort(cc.begin(),cc.end());
ll ans=0;
for(int i=a-x;i<a;i++){
  //  d1(aa[i])
    ans+=aa[i];
    
}
for(int i=b-y;i<b;i++)
ans+=bb[i];
ll sa=a-x;
ll sb=b-y;
//d1(ans)

for(int i=c-1;i>=0;i--){
   // d1(cc[i])
    if(sa<a  && sb<b){
      if(aa[sa]<bb[sb]){
          ans+=max((ll)0,cc[i]-aa[sa]);
          sa++;
      }
      else ans+=max((ll)0,cc[i]-bb[sb]),sb++;
    }
    else if(sa<a){
          ans+=max((ll)0,cc[i]-aa[sa]);
          sa++;
    }
    else if(sb<b){
        ans+=max((ll)0,cc[i]-bb[sb]),sb++;
        

    }
}

cout<<ans;




}

int main(){
    ll t=1;
  /// cin>>t;
    while(t--){
        solve();
        cout<<endl;
    }
    return 0;
}


Measured memory_bytes: 2560
#include <iostream>
#include <vector>
using namespace std;
struct UnionFind {
private:
    vector<int> _par;
    vector<int> _sizes;
public:
    UnionFind(int n) : _par(n), _sizes(n, 1) { for (int i = 0; i < n; i++) _par[i] = i; }
    int find(int x) { return x == _par[x] ? x : (_par[x] = find(_par[x])); }
    void unite(int x, int y) {
        x = find(x);
        y = find(y);
        if (x == y) return;
        if (_sizes[x] < _sizes[y]) swap(x, y);
        _par[y] = x;
        _sizes[x] += _sizes[y];
    }
    bool same(int x, int y) { return find(x) == find(y); }
    int size(int x) { return _sizes[find(x)]; }
};
int main() {
    int N, M;
    cin >> N >> M;
    UnionFind uf(N);
    vector<int> p(N);
    for (auto& i : p) cin >> i;
    for (int i = 0, x, y; i < M; i++) {
        cin >> x >> y;
        uf.unite(x - 1, y - 1);
    }
    int cnt = 0;
    for (int i = 0; i < N; i++) if (uf.same(i, p[i] - 1)) cnt++;
    cout << cnt << endl;
}

Measured memory_bytes: 1408
// g++ -std=c++11 a.cpp
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<unordered_map>
#include<utility>
#include<cmath>
#include<random>
#include<cstring>
#include<queue>
#include<stack>
#include<bitset>
#include<cstdio>
#include<sstream>
#include<iomanip>
#include<assert.h>
#include<typeinfo>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define FOR(i,a) for(auto i:a)
#define pb push_back
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
#define show1d(v) rep(_,v.size())cout<<" "<<v[_];cout<<endl;
#define show2d(v) rep(_,v.size()){rep(__,v[_].size())cout<<" "<<v[_][__];cout<<endl;}cout<<endl;
using namespace std;
//kaewasuretyuui
typedef long long ll;
//#define int ll
typedef ll Def;
typedef pair<Def,Def> pii;
typedef vector<Def> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<Def,pii> pip;
typedef vector<pip>vip;
// #define mt make_tuple
// typedef tuple<int,int,int> tp;
// typedef vector<tp> vt;
template<typename A,typename B>bool cmin(A &a,const B &b){return a>b?(a=b,true):false;}
template<typename A,typename B>bool cmax(A &a,const B &b){return a<b?(a=b,true):false;}
//template<class C>constexpr int size(const C &c){return (int)c.size();}
//template<class T,size_t N> constexpr int size(const T (&xs)[N])noexcept{return (int)N;}
const double PI=acos(-1);
const double EPS=1e-9;
Def inf = sizeof(Def) == sizeof(long long) ? 2e18 : 1e9+10;
int dx[]={0,1,0,-1,1,1,-1,-1};
int dy[]={1,0,-1,0,1,-1,1,-1};//RDLU
//nCr mod m
#define MOD 1000000007
#define M 1000000
vector<ll> fact;
bool h=false;
void init(){
	h=true;
	fact=vector<ll>(M);
	fact[0]=fact[1]=1;
	loop(i,2,M)fact[i]=fact[i-1]*i%MOD;
}
// a^b mod MOD
ll powmod(ll a,ll b,ll m=MOD){
	ll out=1;
	ll p=a%m;
	while(b){
		if(b&1)out=out*p%m;
		p=p*p%m;
		b>>=1;
	}
	return out;
}
int n;
vvi G;
vi used;
ll f(ll a){
	return fact[a]*powmod(powmod(2,a/2)*fact[a/2]%MOD,MOD-2,MOD)%MOD;
}
vvi dfs(int a){
	used[a]=true;
	vi dp(2);
	int co=1;
	dp[1]=1;
	rep(i,G[a].size()){
		int to=G[a][i];
		if(used[to])continue;
		vvi t=dfs(to);
		vi ndp(co+t[1][0]+1);
		rep(j,co+1)rep(k,t[1][0]+1)
			(ndp[j+k]+=dp[j]*t[0][k]%MOD)%=MOD;
		co+=t[1][0];
		dp=ndp;
	}
	loop(i,1,co+1)if(i%2==0)
		(dp[0]+=MOD-dp[i]*f(i)%MOD)%=MOD;
	vvi out={dp,{co}};
	return out;
}
int main(){
	init();
	cin>>n;
	G=vvi(n);
	rep(i,n-1){
		int a,b;
		cin>>a>>b;
		a--;b--;
		G[a].pb(b);
		G[b].pb(a);
	}
	used=vi(n);
	vvi out=dfs(0);
	cout<<MOD-out[0][0]<<endl;
}






Measured memory_bytes: 9344
import java.util.Scanner;
 
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt();
        int b = in.nextInt();
        if(a < b){
        System.out.println("a < b");
        }else if (b < a){
        System.out.println("a > b");
        }else{
        System.out.println("a == b");
        }
        
    }
}    
          

Measured memory_bytes: 26028
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, M;
    cin >> N >> M;
    int cnt[40] = {};
    rep(i, N) {
        int K; cin >> K;
        rep(j, K) {
            int A; cin >> A;
            A--;
            cnt[A]++;
        }
    }
    int ans = 0;
    rep(i, M) {
        if (cnt[i] == N) ans++;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 384
#include<stdio.h>
int main(void){
int a,b,d,r;
double f;
scanf("%d %d",&a,&b);
if(a>=1,b<=1E+9){
d=a/b;
r=a%b;
f=(double)a/b;
printf("%d %d %lf\n",d,r,f);
}
return 0;
}

Measured memory_bytes: 636
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define FOR(i, s, e) for (int i = (int)(s); i <= (int)(e); i++)
#define printYesNo(is_ok) puts(is_ok ? "Yes" : "No");
#define SORT(v) sort(v.begin(), v.end());
#define RSORT(v) sort(v.rbegin(), v.rend());
#define REVERSE(v) reverse(v.begin(), v.end());

template <typename T>
void printlnVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << endl;
  }
}

template <typename T>
void printVector(T v)
{
  rep(i, v.size())
  {
    cout << v[i] << " ";
  }
  cout << endl;
}

int main()
{
  int A, B;
  cin >> A >> B;
  int ans = A * B;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 3596
N = int(input())
H = [int(i) for i in input().split()]

flg = True
prv = 0
for h in H:
    if h-prv >= 1:
        h -= 1
    if prv > h:
        flg = False
    prv = h

if flg:
    print('Yes')
else:
    print('No')


Measured memory_bytes: 63984
#include <stdio.h>
#include <map>
#include <string>
#include <algorithm>

using namespace std;

struct smap {
    int number;
    double time;
};typedef struct smap Smap;

//プロトタイプ宣言
bool tfsort (const Smap &a, const Smap &b);

//main関数
int main(){
    int i, idx = 0;
//    double time;
    Smap rec[50];
//    map<int, double> data;
    
    //入力
    for(i = 0;i < 24; i++){
        scanf("%d %lf", &rec[i].number, &rec[i].time);
//        data[number] = time;
//        rec[i].time=time;
    }
    
    
//    //map-構造体変換
//    for(auto &p: data){
//        rec[cnt] = (Smap){p.first, p.second};
//        cnt++;
//    }
    
    //3組ごとのソート
    for(i = 0; i < 17; i += 8){
        sort(rec + i, rec + i + 8, tfsort);
    }
    //上位二組出力
    for(i = 0; i < 3; i++){
        printf("%d %0.2f\n", rec[idx].number, rec[idx].time);
        printf("%d %0.2f\n", rec[idx + 1].number, rec[idx + 1].time);
        rec[idx].time = 999999;
        rec[idx + 1].time = 999999;
        idx += 8;
    }
    
    //全てのチームをソート
    sort(rec, rec + 24, tfsort);
    
    //3位以下の上位二人を出力
    for(i = 0; i < 2; i++){
        printf("%d %0.2f\n", rec[i].number, rec[i].time);
    }
    
    return 0;
}

bool tfsort (const Smap &a, const Smap &b){
    if(a.time < b.time) return true;
    return false;
}

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

namespace Atcoder
{
    public class Program
    {
        static void Main(string[] args)
        {
            var r = Read();
            if (r == "ABC")
            {
                WriteRead("ARC");
                return;
            }
            else
            {
                WriteRead("ABC");
                return;
            }
        }
        
        public static string Read()
        {
            return Console.ReadLine();
        }

        public static string[] ReadSplit()
        {
            return Console.ReadLine().Split(' ');
        }

        public static void WriteRead(object str)
        {
            Console.WriteLine(str);
            Read();
        }

        public static void Write(object str)
        {
            Console.WriteLine(str);
        }

        private static bool ChangeMin<T>(ref T a, T b) where T : IComparable
        {
            if (a.CompareTo(b) > 0)
            {
                a = b;
                return true;
            }
            return false;
        }

        private static bool ChangekMax<T>(ref T a, T b) where T : IComparable
        {
            if (b.CompareTo(a) > 0)
            {
                a = b;
                return true;
            }
            return false;
        }
    }
}


public static class Extentions
{
    public static int Int(this object obj)
    {
        return int.Parse(obj.ToString());
    }

    public static long Long(this object obj)
    {
        return long.Parse(obj.ToString());
    }

    public static decimal Decimal(this object obj)
    {
        return decimal.Parse(obj.ToString());
    }

    public static double Double(this object obj)
    {
        return double.Parse(obj.ToString());
    }

    public static T2 GetValueZero<T1, T2>(this Dictionary<T1, T2> d, T1 key) where T2 : struct
    {
        T2 value;
        if (d.TryGetValue(key, out value))
        {
            return value;
        }
        return new T2();
    }
}



Measured memory_bytes: 17320
#include<stdio.h>

int main()
{
    int n,k,x,y,c;
    scanf("%d",&n);
    scanf("%d",&k);
    scanf("%d",&x);
    scanf("%d",&y);

    if(n<=k)
    {
        c=x*n;

        printf("%d\n",c);
    }
    else
    {
        n=n-k;
        c=x*k;
        c+=y*n;

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

    }
    return 0;
}


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

#define INF 1234567890
#define ll long long

int N;
ll K;
int p[63][200201];

int main()
{
	scanf("%d %lld", &N, &K);
	for(int i=1; i<=N; i++)
		scanf("%d", &p[0][i]);
	for(int i=1; i<63; i++)
	{
		for(int j=1; j<=N; j++)
		{
			p[i][j] = p[i-1][p[i-1][j]];
		}
	}
	int n = 1;
	for(int i=0; i<63; i++)
	{
		if (K & (1LL<<i))
		{
			n = p[i][n];
		}
	}
	printf("%d", n);
	return 0;
}

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

typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef map<int, int> mii;
typedef map<ll, ll> mll;
typedef set<ii> sii;
typedef set<int> si;
typedef priority_queue<int> pqi;
typedef priority_queue<ii> pqii;

const int INF = 1000000010;
const ll MOD = 1000000007;

int main() {FIN
    
	int m, n, c, d = 0;
	cin >> m >> n;
	if (n > 1) {
		c = m; d = 1;
		while (c < n) {
			c += (m-1);
			d++;
		}
	}
	cout << d << "\n";
	
    return 0;
}


Measured memory_bytes: 3600
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <string>
#include <queue>
#include <unordered_map>
#include <iterator>
#include <stack>
#include <unordered_set>
#include <iomanip>
#include <ctime>
#include <cstring>
#include <bitset>

#include <random>

#define all(x) (x).begin(), (x).end()
#define allp(x) (x)->begin(), (x)->end()

#define pb push_back


using namespace std;
void dout() { cerr << endl; }
typedef long long ll;
template <typename Head, typename... Tail>
void dout(Head H, Tail... T) {
    cerr << H << ' ';
    dout(T...);
}

#define debug(x) cout << #x " = " << (x) << endl


using ll = long long;
using pii = pair<ll, ll>;
using ld = long double;
using pll = pair<long long, long long>;

template <typename T>
void do_uniq(vector<T> vec){
    sort(all(vec));
    vec.resize(unique(all(vec)) - vec.begin());
}



//#define solvsh
//#define multi

#ifdef solvsh


#else

const int MAXN = 40;
const int MAXLOG = 20;


vector<int> v[10];

vector<int> t;
int n;

void init (int nn)
{
    n = nn;
    t.assign (n, 0);
}

int sum (int r)
{
    int result = 0;
    for (; r >= 0; r = (r & (r+1)) - 1)
        result += t[r];
    return result;
}

void inc (int i, int delta)
{
    for (; i < n; i = (i | (i+1)))
        t[i] += delta;
}

int sum (int l, int r)
{
    return sum (r) - sum (l-1);
}


void solve() {

    int n;
    cin >> n;


    vector<int> v;

    for (int i = 0; i < n; ++ i){
        int curr;
        cin >> curr;
        v.push_back(curr);
    }


    sort(all(v));
    reverse(all(v));
    ll sm = 0;

    int last = 0;
    int all = 1;
    while (all < n) {
        if (last == 0) {
            sm += v[last++];
            all++;
        }
        else {
            if (all ==  n - 1) {
                sm += v[last++];
                all++;
            } else {
                sm += 2 * v[last++];
                all++;
                all++;
            }
        }
    }

    cout << sm;

}

#endif

void multisolve() {

    int t;
    cin >> t;

    int i = 1;
    while (t--) {
//        cout << "Case #" << (i++) << ": ";
        solve();
//        cout << "\n";
    }
}


#define int int
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr), cout.tie(nullptr);
    cout << fixed << setprecision(20);

#ifdef multi
    multisolve();
#else
    solve();
//    gen();
#endif

}

Measured memory_bytes: 4284
#include <stdio.h>
int main(){
	int a,b,c;
	scanf("%d%d%d", &a,&b,&c);
	if(a==b&&b==c)
		printf("1");
	if(a==b&&a!=c||a==c&&a!=b||b==c&&a!=b)
		printf("2");
	if(a!=b&&a!=c&&b!=c)
		printf("3");
	return 0;
	
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pint pair<int, int>
#define plint pair<ll, ll>
#define ALL(x) (x).begin(), (x).end()
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i,n) for (int i = 0; i < (n); ++i)
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
int main(){
    double l;
    cin >> l;
    cout << setprecision(15) << (l/3)*(l/3)*(l/3) << endl;
    return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>

using ll = long long int;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

std::string ans="";

int main(void){
	ll n,m=26,t=1;
	std::cin >> n; --n;
	while(m<=n){
		n -= m;
		m *= 26;
		++t;
	}
	while(t--){
		ans.push_back('a'+n%26);
		n /= 26;
	}
	std::reverse(ans.begin(),ans.end());
	std::cout << ans << std::endl;
	return 0;
}


Measured memory_bytes: 3632
import math
a,b,c = map(float,input().split())
sin = math.sin(math.radians(c))
cos = math.cos(math.radians(c))
s = ((1/2)*a*b) * sin
print(s)
l = a+b+math.sqrt((a**2)+(b**2)-(2*a*b)*cos)
print(l)
temp = b*sin
# if c < 90:
#     temp = b*sin
# elif c == 90:
#     pass
# else:
#     pass
print(temp)


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

int main()
{
	int h,w;
	while(1){
		cin>>h>>w;
		if(h==0 && w== 0) break;
		for(int i=1;i<=h;i++){
			for(int j=1; j<=w; j++){
				if(i%2==1 && j%2==1) cout<<"#";
				else if(i%2==0 && j%2==0) cout<<"#";
				else cout<<".";
			}
			cout<<"\n";
		}
		cout<<"\n";
	}
	return 0;
}

Measured memory_bytes: 3012
n = gets.to_i

a = gets.split.map(&:to_i)

res = 0

rem = a[0] # - res

(n - 1).times do |i|
  rem = a[i + 1] - rem
  if (rem < 0)
    if i % 2 == 0
      res += -rem
      rem = 0
    else
      res -= -rem
      rem = 0
    end
  end
end

if rem != res
  res = (res + rem) / 2
end

output = [res * 2]

rem = a[0] - res

(n - 1).times do |i|
  output.push (rem * 2)
  rem = a[i + 1] - rem
end

puts output.join(" ")

Measured memory_bytes: 14084
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// テキスト入力
		Scanner sc = new Scanner(System.in);
		ArrayList<StringBuilder> list = new ArrayList<StringBuilder>();

		while (true) {

			StringBuilder out = new StringBuilder();
			int height = sc.nextInt();
			int width = sc.nextInt();

			if (height == 0 && width == 0) {
				break;
			}
			// #を出す処理
			// 行の数
			for (int h = 0; h < height; h++) {

				// ########の列
				if (h == 0 || h == height - 1) {
					for (int w = 0; w < width; w++) {
						out = out.append("#");
					}
					// #....#の列
				} else {
					for (int w = 0; w < width; w++) {
						if (w == 0 || w == width - 1) {
							out = out.append("#");
						} else {
							out = out.append(".");
						}
					}

				}
				out = out.append("\n");
			}
			list.add(out);
		}
		for (int index = 0; index < list.size(); index++)
			System.out.println(list.get(index));
	}
}

Measured memory_bytes: 20740
#include<bits/stdc++.h>
using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;

#define FOR(i,a,b) for (int i = a; i < b; ++i)
#define FORR(i,a,b) for (int i = b - 1; i >= a; --i)
#define REP(i,n) FOR(i,0,n)
#define REPR(i,n) FORR(i,0,n)

int main() {
	int N, X, T;
	cin >> N >> X >> T;
	cout << ((N + X - 1) / X) * T << endl;
	return 0;
}

Measured memory_bytes: 3616
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Comparator;
import java.util.HashMap;
import java.util.List;
import java.util.Scanner;
import java.util.regex.Matcher;
import java.util.regex.Pattern;


public class Main {
	static Scanner sc = new Scanner(System.in);

	public static void main (String [] args){
		List <Integer> list = new ArrayList<Integer>();
		HashMap <Integer, Integer>hm = new HashMap<Integer, Integer>();
		int v1 = Integer.parseInt(sc.next());
		int v2 = Integer.parseInt(sc.next());		
		int v3 = Integer.parseInt(sc.next());
		list.add(v1);
		list.add(v2);
		list.add(v3);
		
		Collections.sort(list);
		
		System.out.println(list.get(2)*10+list.get(1)+list.get(0));
		System.out.flush();
		sc.close();
	}
}

Measured memory_bytes: 21716
#include <cstdio>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

const int cm = 1 << 17;
char cn[cm], * ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	int pn = 1;
	if (ci - cn + 16 > cm) {
		if ((ct = getcha()) == '-') { pn = -1; ct = getcha(); }
		A = ct - '0';
		while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';;
		return pn * A;
	}
	else {
		if ((ct = *ci++) == '-') { pn = -1; ct = *ci++; }
		A = ct - '0';
		while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';;
		return pn * A;
	}
}

int main() {


	int N = getint(), M = getint();
	bool X[200010] = {};
	rep(i, M) X[getint() + 100000] = true;

	int mae = -1;
	int sa[200010] = {};
	rep(i, 200001) {
		if (X[i]) {
			if (mae != -1) {
				sa[i - mae]++;
			}
			mae = i;
		}
	}

	int kotae = 0;
	rep(i, 200001) {
		if (M <= N) break;
		int k = M - N >= sa[i] ? sa[i] : M - N;
		kotae += i * k;
		M -= k;
	}

	printf("%d", kotae);

	Would you please return 0;
}

Measured memory_bytes: 1280
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;

int n, k;
vi a;

bool Read() {
  cin >> n;
  if (cin.eof())
    return 0;
  a.resize(n);
  cin >> k;
  for (int i = 0; i < n; i++)
    cin >> a[i];

  return 1;
}

void Process() {
  sort(begin(a), end(a));
  ll sum = 0;
  for (int i = 0; i < k; i++)
    sum += a[i];
  cout << sum << "\n";
}

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

  while (Read())
    Process();

  return 0;
}

Measured memory_bytes: 3656
#include <bits/stdc++.h>
using namespace std;
using lint = long long;
template<class T = int> using V = vector<T>;
template<class T = int> using VV = V< V<T> >;

struct Edge { int to; double cost; };

template<class T, class Edge> V<T> dijkstra(const VV<Edge>& g, int s = 0) {
  V<T> dist(g.size(), numeric_limits<T>::max());
  using P = pair<T, int>;
  priority_queue< P, V<P>, greater<P> > pque;
  pque.emplace(dist[s] = 0, s);
  while (!pque.empty()) {
    T d; int v;
    tie(d, v) = pque.top(); pque.pop();
    if (d > dist[v]) continue;
    for (const auto& e : g[v]) if (dist[v] + e.cost < dist[e.to]) {
      pque.emplace(dist[e.to] = dist[v] + e.cost, e.to);
    } 
  }
  return dist;
}

int main() {
  cin.tie(nullptr); ios::sync_with_stdio(false);
  while (true) {
    int n, m, p, a, b; cin >> n >> m >> p >> a >> b, --a, --b;
    if (!n) break;
    V<> t(n); for (auto&& e : t) cin >> e;
    VV<Edge> g(m << n);
    while (p--) {
      int x, y, z; cin >> x >> y >> z, --x, --y;
      for (int bit = 1; bit < 1 << n; ++bit) {
        for (int i = 0; i < n; ++i) if (bit >> i & 1) {
          g[x << n | bit].emplace_back(Edge{y << n | bit ^ 1 << i, (double)z / t[i]});
          g[y << n | bit].emplace_back(Edge{x << n | bit ^ 1 << i, (double)z / t[i]});
        }
      }
    }
    auto d = dijkstra<double>(g, a << n | ~(~0 << n));
    double res = 1e10;
    for (int bit = 0; bit < 1 << n; ++bit) {
      res = min(res, d[b << n | bit]);
    }
    if (res == 1e10) cout << "Impossible" << '\n';
    else cout << fixed << setprecision(15) << res << '\n';
  }
}


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

int main()
{
    int n;
    cin>>n;
    int x=0;
    int ans=-1;
    for(int i=1; i<=n; i++)
    {
        x=(x*10+7)%n;
        if(!x)
        {
            ans=i;
            break;
        }
    }
    cout<<ans<<endl;
}


Measured memory_bytes: 3636
from collections import deque
H, W = map(int, input().split())
S = []
for _ in range(H):
    S.append(input())
yudlr = [-1, 1, 0, 0]
xudlr = [0, 0, -1, 1]
D = 0
for i in range(H):
    for j in range(W):
        if S[i][j] == '#':
            continue
        d = [[-1] * W for _ in range(H)]
        d[i][j] = 0
        Q = deque()
        Q.append([i, j])
        while len(Q) > 0:
            q = Q.popleft()
            y, x = q[0], q[1]
            for k in range(4):
                y1 = y + yudlr[k]
                x1 = x + xudlr[k]
                if y1 < 0 or y1 >= H or x1 < 0 or x1 >= W:
                    continue
                if S[y1][x1] == '#':
                    continue
                if d[y1][x1] != -1:
                    continue
                d[y1][x1] = d[y][x] + 1
                Q.append([y1, x1])
        Dij = max(list(map(lambda x: max(x), d)))
        D = max(D, Dij)
print(D)

Measured memory_bytes: 9436
N, M = map(int, input().split())

shi_map = []

for i in range(M):
    p, y = map(int, input().split())
    shi_map.append([i, p, y])

shi_map = sorted(shi_map, key=lambda x: (x[1], x[2]))

result = {}
shi_count = {}
for i, p, y in shi_map:

    if p in shi_count:
        c = shi_count[p]
        count = c + 1
        shi_count[p] = count
    else:
        shi_count[p] = 1
        count = 1
    result[i] = [p, count]
result = list(sorted(result.items(), key=lambda x: x[0]))

for i, p in result:

    p2 = str(p[0]).zfill(6)

    y = str(p[1]).zfill(6)
    r = p2+y
    print(r)

Measured memory_bytes: 52288
#include<iostream>
#include<bits/stdc++.h>
#include<iomanip>
#include<math.h>
#include<vector>
#include<cctype>
#include<string>
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
std::string line;

int main(){

    int n;
    cin >> n;

    bool flg = 0;
    for(int i=0;i<=25;i++){
        for(int j=0;j<=14;j++){
            if(n==4*i+7*j) flg = 1;
        }
    }
    if(flg) cout << "Yes" << endl;
    else cout << "No" << endl;
   return 0;
}

Measured memory_bytes: 256
package main

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

var sc = bufio.NewScanner(os.Stdin)

func Scanner() string {
	sc.Scan()
	return sc.Text()
}

func intScanner() int {
	n, _ := strconv.Atoi(Scanner())
	return n
}

func floatScanner() float64 {
	n, _ := strconv.ParseFloat(Scanner(), 64)
	return n
}
func stringToInt(s string) int {
	n, _ := strconv.Atoi(s)
	return n
}
func stringSliceScanner(n int) []string {
	a := make([]string, n)
	for i := 0; i < n; i++ {
		a[i] = Scanner()
	}
	return a
}
func intSliceScanner(n int) []int {
	a := make([]int, n)
	for i := 0; i < n; i++ {
		a[i] = intScanner()
	}
	return a
}
func larger(a, b int) int {
	if a < b {
		return b
	} else {
		return a
	}
}
func smaller(a, b int) int {
	if a > b {
		return b
	} else {
		return a
	}
}
func max(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x < a[i] {
			x = a[i]
		}
	}
	return x
}
func min(a []int) int {
	x := a[0]
	for i := 0; i < len(a); i++ {
		if x > a[i] {
			x = a[i]
		}
	}
	return x
}
func abs(x int) int {
	if x < 0 {
		x = -x
	}
	return x
}

var mod int

func main() {
	mod = 1000000007
	buf := make([]byte, 0)
	sc.Buffer(buf, mod)
	sc.Split(bufio.ScanWords)
	s := Scanner()
	if s == "SUN" {
		fmt.Println(7)
	} else if s == "MON" {
		fmt.Println(6)
	} else if s == "TUE" {
		fmt.Println(5)
	} else if s == "WED" {
		fmt.Println(4)
	} else if s == "THU" {
		fmt.Println(3)
	} else if s == "FRI" {
		fmt.Println(2)
	} else {
		fmt.Println(1)
	}
}


Measured memory_bytes: 1772
fun main() {
    var n = readLn().toLong()
    val ans = mutableListOf<Char>()
    while (n > 0) {
        n -= 1
        ans.add('a' + (n % 26).toInt())
        n /= 26
    }
    println(ans.reversed().joinToString(""))
}

// Input Reader
private fun readLn() = readLine()!!

//private fun readStrings() = readLn().trim().split(" ")
////private fun readInt() = readLn().toInt()
//private fun readInts() = readStrings().map { it.toInt() }


Measured memory_bytes: 36408
// AOJ 1039 Frisbee Dogs
// 2018.2.9 bal4u

#include <stdio.h>
#include <string.h>
#include <math.h>

#define INF 1e10
#define EPS 1e-9
#define EQ(a,b)  (fabs((a)-(b))<EPS)
typedef struct { double x, y; } PP;

PP d[11], a[11];
double v[11];
PP fp[1001], fv[1001];
int ans[11];

double norm(PP *a) { return a->x * a->x + a->y * a->y; }

double calc(int id, PP *d, double v, PP *fp, PP *fv)
{
    double _a, _b, _c, _d, s, k, k1, k2;
    PP t;
    
    t.x = fp->x - d->x, t.y = fp->y - d->y;
    _a = norm(fv) - v*v;
    _b = t.x * fv->x + t.y * fv->y;
    _c = norm(&t);
 
    if (EQ(_a, 0)) {
        if (EQ(_b,0)) return INF;
        k = -_c/(2*_b); if (k < 0) return INF;
    } else {
		_d = _b*_b - _a*_c; if (_d < 0) return INF;
	    s = sqrt(_d), k1 = (-_b+s)/_a, k2 = (-_b-s)/_a;
		if (k1 < 0 && k2 < 0) return INF;
		if (k1 < 0) k1 = INF; if (k2 < 0) k2 = INF;
		k = k1; if (k2 < k) k = k2;
	}
    a[id].x = (t.x + fv->x *k)/k;
    a[id].y = (t.y + fv->y *k)/k;
    return k;
}

int main()
{
    int n, m, i, j;
    double t[11];
    double tm;
    
    while (scanf("%d%d", &n, &m) && n) {
        for (i = 0; i < n; i++) scanf("%lf%lf%lf", &d[i].x, &d[i].y, v+i);
        for (i = 0; i < m; i++) scanf("%lf%lf%lf%lf", &fp[i].x, &fp[i].y, &fv[i].x, &fv[i].y);

        memset(ans, 0, sizeof(ans));
        for (i = 0; i < m; i++) {
            tm = INF;
            for (j = 0; j < n; j++) {
                t[j] = calc(j, &d[j], v[j], &fp[i], &fv[i]);
				if (tm > t[j]) tm = t[j];
			}
            for (j = 0; j < n; j++) if (t[j] < INF) {
                d[j].x += a[j].x * tm, d[j].y += a[j].y * tm;
				if (EQ(t[j], tm)) ans[j]++;
            }
        }
        printf("%d", ans[0]);
        for (i = 1; i < n; i++) printf(" %d", ans[i]);
        putchar('\n');
    }
    return 0;
}


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

int main() {
    long long N;
    cin >> N;
    vector<long long> A(N);
    for (int i = 0; i < N; i++) {
        cin >> A[i];
    }
    vector<int> num(N);
    for (int i = 0; i < N; i++) {
        int n = 0;
        while (A[i] % 2 == 0) {
            n++;
            A[i] /= 2;
        }
        num[i] = n;
    }
    cout << *min_element(num.begin(), num.end()) << endl;
}

Measured memory_bytes: 256
def main():
    import sys
    input = sys.stdin.readline
    sys.setrecursionlimit(10**7)
    from collections import Counter, deque
    #from collections import defaultdict
    from itertools import combinations, permutations, accumulate, groupby, product
    from bisect import bisect_left,bisect_right
    from heapq import heapify, heappop, heappush
    from math import floor, ceil
    #from operator import itemgetter

    #inf = 10**17
    #mod = 10**9 + 7

    n = int(input())
    ab = [list(map(int, input().split())) for _ in range(n)]
    ab.sort()
    print(ab[-1][0]+ab[-1][1])

if __name__ == '__main__':
    main()

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

#define int long long
#define ll long long
#define f1(i,a,b) for(int i=a;i<b;i++)
#define f2(i,a,b) for(int i=a;i>=b;i--)
#define endl '\n'
#define pb push_back
#define gp " "
#define ff first
#define ss second
#define mp make_pair

const int mod=1000000007;
ll temp;

int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    
    // #ifndef ONLINE_JUDGE
    // 	freopen("/home/akmittal/Desktop/Competitive Programming/in.txt","r",stdin);
    // 	freopen("/home/akmittal/Desktop/Competitive Programming/out.txt","w",stdout);
    // #endif

    string s;
    cin>>s;

    int n=s.size();
    string t;
    f1(i,0,n)
    t.pb('x');
    cout<<t<<endl;
    
    return 0;
}

Measured memory_bytes: 256
//ID: LRL52  Date: 2019.9.20
#define rep(i, a, b) for(int i = (a); i <= (b); ++i)
#include<bits/stdc++.h>
using namespace std;
const int N = 2055, M = 2055;
int ans, n, m;
int h[N], a[N][N], l[N], r[N], stk[N];
char s[N];

int main(){
	//freopen("atc081F.in", "r", stdin);
	//freopen("atc081F.out", "w", stdout);
	scanf("%d%d", &n, &m);
	rep(i, 1, n){
		scanf("%s", s + 1);
		rep(j, 1, m)
		    a[i][j] = s[j] == '#' ? 1 : 0;
	}
	ans = max(n, m);
	rep(i, 1, n - 1)
	    rep(j, 1, m - 1)
		    a[i][j] = a[i][j] ^ a[i][j + 1] ^ a[i + 1][j] ^ a[i + 1][j + 1];
	rep(i, 1, n - 1){
		rep(j, 1, m - 1){
			if(a[i][j]) h[j] = 0;
			else ++h[j];
		}
		int top = 0;
		for(int j = m - 1; j >= 1; --j){
			while(top > 0 && h[j] < h[stk[top]]){
				l[stk[top]] = j;
				--top;
			}
			stk[++top] = j;
		}
		while(top > 0) l[stk[top--]] = 0;
		rep(j, 1, m - 1){
			while(top > 0 && h[stk[top]] > h[j]){
				r[stk[top]] = j;
				--top;
			}
			stk[++top] = j;
		}
		while(top > 0) r[stk[top--]] = m;
		rep(j, 1, m - 1){
			if(h[j] == 0) continue;
			ans = max(ans, (r[j] - l[j]) * (h[j] + 1)); //式子是化简后的 
		}
	}
	printf("%d\n", ans);
	return 0;
}

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

#define times(n, i)      uptil(0, n, i)
#define rtimes(n, i)     downto((n) - 1, 0, i)
#define upto(f, t, i)    for(int _##i = (t), i = (f); i <= _##i; i++)
#define uptil(f, t, i)   for(int _##i = (t), i = (f); i <  _##i; i++)
#define downto(f, t, i)  for(int _##i = (t), i = (f); i >= _##i; i--)
#define downtil(f, t, i) for(int _##i = (t), i = (f); i >  _##i; i--)
#define size(v) (signed)v.size()
#define long long long

#if defined(EBUG) && !defined(ONLINE_JUDGE)
    #define debug true
    #define ln << endl
#else
    #define debug false
    #define ln << '\n'
#endif
#define tb << '\t'
#define sp << ' '

signed main() { // long: 64bit
    if(!debug) {
        cin.tie(0);
        ios::sync_with_stdio(0);
    }

    int N, C, K;
    scanf("%d%d%d", &N, &C, &K);;
    int T[100000];
    times(N, i) scanf("%d", &T[i]);
    sort(T, T + N);

    int ans = 0, l = 0;
    times(N, i) {
        if(T[i] - T[l] > K) {
            ++ans;
            l = i;
        }
        if(i - l == C) {
            ++ans;
            l = i;
        }
    }
    ++ans;

    cout << ans ln;

    return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
using P = pair<int, int>;

const int M = 1000000007;

int main() {
    while (true) {
        int n, m;
        cin >> n >> m;
        if (!n) return 0;

        vector<P> ma(n), mi(n);
        for (int i = 0; i < n; ++i) {
            ma[i] = P(0, i);
            mi[i] = P(0, i);
        }
        for (int i = 0; i < m; ++i) {
            int s, k;
            cin >> s >> k;
            if (k == 1) {
                int a;
                cin >> a;
                ma[a - 1].first += s;
                mi[a - 1].first += s;
            }
            else {
                for (int j = 0; j < k; ++j) {
                    int a;
                    cin >> a;
                    ma[a - 1].first += s;
                }
            }
        }
        sort(ma.begin(), ma.end());
        reverse(ma.begin(), ma.end());
        sort(mi.begin(), mi.end());
        if (ma[0].second != mi[0].second)
            cout << ma[0].first - mi[0].first + 1 << "\n";
        else
            cout << max(ma[0].first - mi[1].first, ma[1].first - mi[0].first) + 1 << "\n";
    }
}



Measured memory_bytes: 3220
package main

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

func getScanner(fp *os.File) *bufio.Scanner {
	scanner := bufio.NewScanner(fp)
	scanner.Split(bufio.ScanWords)
	scanner.Buffer(make([]byte, 500001), 500000)
	return scanner
}

func getNextString(scanner *bufio.Scanner) string {
	scanner.Scan()
	return scanner.Text()
}

func getNextInt(scanner *bufio.Scanner) int {
	i, _ := strconv.Atoi(getNextString(scanner))
	return i
}

func getNextInt64(scanner *bufio.Scanner) int64 {
	i, _ := strconv.ParseInt(getNextString(scanner), 10, 64)
	return i
}

func getNextUint64(scanner *bufio.Scanner) uint64 {
	i, _ := strconv.ParseUint(getNextString(scanner), 10, 64)
	return i
}

func getNextFloat64(scanner *bufio.Scanner) float64 {
	i, _ := strconv.ParseFloat(getNextString(scanner), 64)
	return i
}

func main() {
	fp := os.Stdin
	wfp := os.Stdout

	if os.Getenv("MASPY") == "ますピ" {
		fp, _ = os.Open(os.Getenv("BEET_THE_HARMONY_OF_PERFECT"))
	}
	if os.Getenv("MASPYPY") == "ますピッピ" {
		wfp, _ = os.Create(os.Getenv("NGTKANA_IS_GENIUS10"))
	}

	scanner := getScanner(fp)
	writer := bufio.NewWriter(wfp)

	n := getNextInt(scanner)
	pp := make(PP, n)
	for i := 0; i < n; i++ {
		pp[i].x = getNextFloat64(scanner)
		pp[i].y = getNextFloat64(scanner)
		pp[i].sk = (360 + int(math.Atan2(pp[i].y, pp[i].x)*180/math.Pi)) % 360
	}

	sort.Sort(pp)

	xx := make([]float64, n*2+1)
	yy := make([]float64, n*2+1)
	for i := 0; i < n*2; i++ {
		xx[i+1] = xx[i] + pp[i%n].x
		yy[i+1] = yy[i] + pp[i%n].y
	}

	max := 0.0
	for i := 0; i < n; i++ {
		for j := 1; j <= n; j++ {
			r := math.Sqrt(math.Pow(xx[i+j]-xx[i], 2) + math.Pow(yy[i+j]-yy[i], 2))
			if max < r {
				max = r
			}
		}
	}

	fmt.Fprintln(writer, max)
	writer.Flush()
}

type P struct {
	x, y float64
	sk   int
}

type PP []P

func (a PP) Len() int           { return len(a) }
func (a PP) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a PP) Less(i, j int) bool { return a[i].sk < a[j].sk }


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define PI 3.14159265358979323846
#define int long long
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr long long INFL = numeric_limits<long long>::max() / 2;
constexpr int MOD = 1000000007;
using Graph = vector<vector<int>>;



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

    int N;
    cin>>N;
    int a[N];
    rep(i,N) cin>>a[i];

    int b[N]{};
    int ans=0;
    for(int i=N-1;i>=0;i--){
        int sum=0;
        for(int j=i;j<N;j+=i+1){
            sum+=b[j];
        }
        if(sum%2!=a[i]) {
            b[i]=1; 
            ans++;
        }
    }
    cout << ans <<endl;
    rep(i,N){
        if(b[i]==1) cout << i+1 << endl;
    }


}


Measured memory_bytes: 3968