akhauriyash/Code-Regression huggingface dataset:
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
#define rep(i, begin, n) for (int i = begin; i < n; i++)
#define repe(i, begin, n) for (int i = begin; i <= n; i++)
#define repr(i, begin, n) for (int i = begin; i > begin - n; i--)
#define repre(i, begin, end) for (int i = begin; i >= end; i--)

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

const int inf = 1000000007;
const int MOD = 1000000007;
const long long INF = 1000000000000000007;

// -------------------------------------------------------
int N;
string S;

int main() {
  cin >> N >> S;
  int ans = 0;
  rep(i, 1, N) {
    set<char> chars1;
    set<char> chars2;
    int cnt = 0;
    rep(j, 0, i) { chars1.insert(S[j]); }
    rep(j, i, N) { chars2.insert(S[j]); }
    for (char c = 'a'; c <= 'z'; ++c) {
      if (chars1.count(c) == 1 && chars2.count(c) == 1) {
        ++cnt;
      }
    }
    chmax(ans, cnt);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
using namespace std;
using ull = unsigned long long;

int main(){
    ull N, x, ans = 0;
    cin >> N >> x;

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

    for(int i = 0; i < N - 1; ++i){
        if(b[i] > x){
            ull diff = b[i] - x;
            ans += diff;
            b[i+1] -= min(diff, a[i+1]);
        }
    }
    
    cout << ans << endl;

    return 0;
}


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

int main(){
	int m,f,r;
	int p[25565][3] = {0};
	int i = 0;
	do
	{
		cin >> p[i][0] >> p[i][1] >> p[i][2];
		i++;
	} while (p[i-1][0] != -1 || p[i-1][1] != -1 || p[i-1][2] != -1);
	for (int j = 0; j < i-1; ++j)
	{
		if (p[j][0] == -1 || p[j][1] == -1)
		{
			cout << "F";
		}else if ((p[j][0] + p[j][1]) >= 80)
		{
			cout << "A";
		}else if ((p[j][0] + p[j][1]) >= 65)
		{
			cout << "B";
		}else if ((p[j][0] + p[j][1]) >= 50)
		{
			cout << "C";
		}else if ((p[j][0] + p[j][1]) >= 30 && p[j][2] >= 50)
		{
			cout << "C";
		}else if ((p[j][0] + p[j][1]) >= 30 && p[j][2] < 50)
		{
			cout << "D";
		}else{
			cout << "F";
		}
		cout << endl;
	}
}

Measured memory_bytes: 1460
N  = int(input())
XYH=[list(map(int,input().split())) for i in range(N)]
cch=[[0 for j in range(101) ] for i in range(101)]
  
for xyh in XYH:
  x=xyh[0]
  y=xyh[1]
  h=xyh[2]
  flag=0
  if h != 0:
    for cx in range(101):
      for cy in range(101):   
        H = h+abs(x-cx)+abs(y-cy)
        cch[cx][cy]=H
        flag=1
    break

for xyh in XYH:
  x=xyh[0]
  y=xyh[1]
  h=xyh[2]
  for cx in range(101):
    for cy in range(101): 
      if h != max(cch[cx][cy]-abs(x-cx)-abs(y-cy),0):
        cch[cx][cy]=0
            
for cx in range(101):
  for cy in range(101):
    if cch[cx][cy]!=0:
      print(cx,cy,cch[cx][cy]);exit()
        
  

Measured memory_bytes: 47212
def gcd(a, b):
    if a < b:
        a, b = b, a
    if b == 0:
        return a
    c = a % b
    return gcd(b, c)
 
n=int(input())
A=list(map(int,input().split()))
ans=1
for x in A:
    ans=ans*x//gcd(ans,x)
ans-=1
t=0
for x in A:
    t+=ans%x
print(t)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
 
using namespace std;
typedef long long ll;
typedef vector<int> VI;
ll mm=1000000000;ll MM=mm+7;
#define rep(i, n) for(int i=0;i<n;i++)
#define PI 3.141592653589793

int main(){
    int n,k;
    cin >> n >> k;
    VI x(n);
    rep(i,n)cin >> x.at(i);
    int sum=0;
    rep(i,n){
        sum+=min(x[i],k-x[i]);
    }
    cout << sum*2 << endl;
}

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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

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

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

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}

bool is_pow_of_2(int64 N) {
    int64 now = 1;
    while (now < N) {
        now <<= 1;
    }
    return now == N;
}

int main(void){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int64 N;
	cin >> N;
	if (is_pow_of_2(N)) {
	    cout << "No" << endl;
	    return 0;
	}
    int64 now = 1;
	cout << "Yes" << endl;
	while (now * 2 <= N) {
	    cout << now << " " << now*2 << endl;
	    now *= 2;
	}
	FOR(i, 1, N+1) {
        if (is_pow_of_2(i)) continue;
        int64 mx_bit = 0;
        while (1 << mx_bit < i) {
            mx_bit++;
        }
        mx_bit--;
        cout << i << " " << (1 << mx_bit) << endl;
        int64 now = i;
        while (mx_bit >= 0 && now >> mx_bit & 1) {
            now ^= (1 << mx_bit);
            mx_bit--;
        }
        if (mx_bit == -1) {
            cout << 1 << " " << i + N << endl;
        } else {
            if (now == 0)
                cout << (now ^ (1 << mx_bit+1)) << " " << i + N << endl;
            else
                cout << (now ^ (1 << mx_bit)) << " " << i+N << endl;
        }
	}
	cout << 1+N << " " << 3 << endl;
	FOR(i, 2, N+1) {
	    if (!is_pow_of_2(i)) continue;
	    cout << i+N << " " << (i+N+1) << endl;
	}
}


Measured memory_bytes: 2688
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair<ll,ll>
#define pii pair<int,int>
#define mii map<int,int>
#define msi map<string,int>
#define pb push_back
#define mp make_pair
#define M 1101
#define MOD 1000000007
#define fi first
#define se second
#define vi vector<int>
#define vl vector<ll>
#define all(v) v.begin(),v.end()
#define allr(v) v.rbegin(),v.rend()
#define repl(i,l,r) for(long long i=l;i<=r;++i)
#define rep(i,l,r) for(int i=l;i<=r;++i)
#define ins insert
#define inf 10000000000000000ll
#define vpi vector< pair<int,int> >
#define vpl vector< pair<ll,ll> >
#define eps 1e-7
#define endl "\n"
/*ll gcd(ll a,ll b)
{
    if(a==0){return b;}
    return gcd(b%a,a);
}
ll modexp(ll x,ll y,ll p)
{
    ll res=1;x%=p;
    while(y>0)
    {   if(y%2==1){res=(res*x)%p;}
        y=y>>1;x=(x*x)%p;
    }return res;
}*/
int n,m;
const int maxn=2e3+3;
char v[maxn][maxn];
int a[maxn][maxn],l[maxn][maxn],u[maxn][maxn],r[maxn][maxn],d[maxn][maxn];
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    cin>>n>>m;
    rep(i,1,n)
    {
        rep(j,1,m)
        {
            cin>>v[i][j];
            if(v[i][j]=='.')
            {
                a[i][j]=1;
            }
        }
    }
    rep(i,1,n)
    {
        rep(j,1,m)
        {
            if(!a[i][j])
            {
                l[i][j]=0;
            }
            else
            {
                l[i][j]=1+l[i][j-1];
            }
        }
    }
    rep(i,1,n)
    {
        for(int j=m;j>=1;j--)
        {
            if(!a[i][j])
            {
                r[i][j]=0;
            }
            else
            {
                r[i][j]=1+r[i][j+1];
            }
        }
    }
    rep(j,1,m)
    {
        rep(i,1,n)
        {
            if(!a[i][j])
            {
                u[i][j]=0;
            }
            else
            {
                u[i][j]=u[i-1][j]+1;
            }
        }
    }
    rep(j,1,m)
    {
        for(int i=n;i>=1;i--)
        {
            if(!a[i][j])
            {
                d[i][j]=0;
            }
            else
            {
                d[i][j]=1+d[i+1][j];
            }
        }
    }
    int ans=1;
    rep(i,1,n)
    {
        rep(j,1,m)
        {
            if(a[i][j])
            {
                ans=max(ans,l[i][j]+r[i][j]+u[i][j]+d[i][j]-3);
            }
        }
    }
    cout<<ans<<"\n";


    return 0;

    /*check for long long or int*/
}


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

using namespace std;
typedef long long int ll;
typedef long double ld;
#define REP(i, n) for(ll i = 0LL; i < (ll)(n); i++)
#define REPR(i, n) for (ll i = (ll)(n) - 1; i >= 0; i--)
#define FOR(i, n, m) for(ll i = (ll)n; i < (ll)(m); i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007
// #define INF (1LL << 62)

// #define PI (acos(-1))
#define PRINT(x) std::cout << x << endl
 
ll gcd(ll a, ll b) { return b ? gcd(b,a%b) : a;}
ll lcm(ll a, ll b) { return a / gcd(a, b) * b; }
ll countDigit(ll n) { return floor(log10(n) + 1); } 
typedef pair <ll,ll> P;
static const ll dx[8] = {0,1,0,-1, 1, -1, 1, -1}, dy[8] = {1,0,-1,0,1,1,-1,-1};

template <typename T> 
ostream& operator<<(ostream& os, const vector<T>& v) 
{ 
    for (int i = 0; i < (int)v.size(); ++i) os << v[i] << " ";  
    return os; 
}

template <typename T1, typename T2> 
ostream& operator<<(ostream& os, const map<T1, T2>& m) 
{ 
    for (auto p : m) os << "<" << p.first << ", " << p.second << "> "; 
    return os; 
}

int main()
{
  ll X, Y;
  cin >> X >> Y;
  ll y = Y - 2*X;
  if (y < 0 || y % 2 != 0) {
    PRINT("No");
    return 0;
  }
  y /= 2;

  ll x = X - y;
  if (x < 0) {
    PRINT("No");
    return 0;
  }
  PRINT("Yes");
  return 0;
} 


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

#define ull unsigned long long
#define ll long long
#define imei(...)   "[ "<< #__VA_ARGS__ <<" = "<< __VA_ARGS__ <<" ] "

using namespace std;

void solve(int t) {
    int n;
    cin >> n;
}

int main(int argc, char *argv[])
{
    ll d;
    cin >> d;
    cout <<  (d + d*d + d*d*d) << endl;;

    return 0;
}


Measured memory_bytes: 3588
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String S = sc.next();
		int min = 10000;
		for(int i=0;i<S.length()-2;i++) {
			if( min > Math.abs(753 - Integer.parseInt(S.substring(i, i+3))) ) {
				min = Math.abs(753 - Integer.parseInt(S.substring(i, i+3)));
			}
		}
		
		System.out.println(min);
		
		sc.close();
	}
}


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

int main(void){
    int P,Q,R;
    int max;
    cin >> P >> Q >> R;

    if(P>=Q) max = P;
    else max = Q;

    if(R>=max) max = R;

    cout << (P+Q+R-max) << endl;
    return 0;
}


Measured memory_bytes: 256
//Coded by Abhijay Mitra
#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <numeric>
#include <vector>
#include <iterator> 
#include <map>
#include <set>
#include <climits>
#include <queue>
#include <cmath>
#include <stack>
#include <cctype>
#include <bitset>
// #include <bits/stdc++.h>
#define double long double
#define int long long int
#define ll int
#define ibs ios_base::sync_with_stdio(false)
#define cti cin.tie(0)
#define bp __builtin_popcount
#define pb push_back
#define koto_memory(a) cout<<(sizeof(a)/1048576.0)<<" MB";
#define res(v) v.resize(unique(v.begin(), v.end()) - v.begin());
#define cnt_res(v) std::distance(v.begin(),std::unique(v.begin(), v.end())); 
#define timer cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
using vi = std::vector<int>;
using vvi = std::vector<vi>;
using pii = std::pair<int,int>;
using vpii = std::vector<pii>;
using vvpii = std::vector<vpii>;
#define mp         make_pair
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define per(i,b,a) for (int i = b; i >= a; i--)
#define all(x)     x.begin(), x.end()
using namespace std;
const int N=2e6+10;
const int inf = /*0x3f3f3f3f*/1e18+10;
// const ll M = 998244353 ; // Mulo
// const int M = 1e9+7 ; // Mulo
const double Pi = 3.14159265;
#define F first
#define S second
int n,a[N];string s;map<string,int>m;
void solve(){
  cin>>s;
  m[s]++;
}
int32_t main()
{
  ibs;cti;
  // solve()
  /*,cout<<"\n"*/;
  // cout<<"\n";
  int xx=0;
  int t;cin>>t;while(t--){/*xx++;cout<<"Case "<<xx<<":\n"*/;solve();}
  cout<<"AC x "<<m["AC"]<<"\n";
  cout<<"WA x "<<m["WA"]<<"\n";
  cout<<"TLE x "<<m["TLE"]<<"\n";
  cout<<"RE x "<<m["RE"]<<"\n";
  return 0;
}

Measured memory_bytes: 3660
#include <iostream>
#include <algorithm>
#include <map>
#include <regex>
#include <string>
#include <cstdlib>
#include <math.h>
#include <vector>
#include <queue>
using namespace std;
using ll = long long;

int main() {
  int H, A;
  cin >> H >> A;
  cout << ceil(double(H) / double(A)) << endl;
  return 0;
}


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


int main(){
    int N;
    int sum=0;
    vector<int> a;
    string s;
    cin>>s;
    if(s[0]==s[1] and s[0]==s[2]){
        cout<<"No"<<endl;
    }else{
        cout<<"Yes"<<endl;
    }


}

Measured memory_bytes: 256
k = []
for num1 in range(2):
    w = []
    num3 = 0
    for num in range(10):
        i = int(input())
        w.append(i)
    w.sort()
    for num2 in range(7,10):
        num3 += w[num2]
    k.append(num3)
print(str(k[0]) + " " + str(k[1]))


Measured memory_bytes: 5600
#include<iostream>
#include<vector>
#include<algorithm>
#include<map>
using namespace std;
int main(){
     vector<pair<long long, long long>> pairs;
     int N,M,j;
     long long sum,tempA,tempB;
     long long result;
     cin >> N >> M;
     for(int i = 0; i < N; i++){
          cin >> tempA >> tempB;
          pairs.push_back(make_pair(tempA,tempB));
     }
     sort(pairs.begin(),pairs.end());
     sum = 0;
     result = 0;
     j = 0;
     for(int i = 0; sum + pairs[i].second <= M; i++,j++){
          result += pairs[i].first*pairs[i].second;
          sum += pairs[i].second;
     }
     result += pairs[j].first*(M - sum);
     cout << result << endl;
     return 0;
}

Measured memory_bytes: 2420
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <cmath>

using namespace std;

int main(){
  long long prev_t = 1;
  long long t, r;
  int n;
  cin >> n;
  for (int i=0;i<n;i++) {
    long long prev_r = prev_t;
    long long r;
    cin >> t;
    r = t;
    while (r!=0) {
      long long tmp = r;
      r = prev_r % r;
      prev_r = tmp;
    }
    prev_t = prev_t/prev_r;
    prev_t = t * prev_t;
  }
  cout << prev_t << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	if(abs(a-c)<=d)
	cout<<"Yes";
	else if(abs(a-b)<=d&&abs(b-c)<=d)
	cout<<"Yes";
	else
	cout<<"No";
	return 0;
}

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

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;

map<ll, ll> prime_factor(ll n){
    map<ll, ll> res;
    for (int i = 2; i * i <= n; ++i) {
        while(n % i == 0){
            res[i]++;
            n /= i;
        }
    }
    if(n != 1) res[n] = 1;
    return res;
}

const int MAX = 1000000;
const int MOD = 1000000007;

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

void com_init() {
    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;
    }
}

ll 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, m;
    cin >> n >> m;
    map<ll, ll> mp;

    mp = prime_factor(m);
    com_init();

    ll res = 1;
    for(auto v : mp){
        res *= com(n + v.second - 1, v.second);
        res %= MOD;
    }
    cout << res << endl;
}

Measured memory_bytes: 23680
#include <bits/stdc++.h>
using namespace std;
int main() { 
  int n,l;
  cin>>n>>l;
  vector<int>b(n);
  int a=0;
  int c=0;
  for(int i=0;i<n;i++){
    b.at(i)=l+i;
    cin>>b.at(i);
    a+=b.at(i);
    if(b.at(i)==0){
      c++;
    }
  }
  if(c==1){
    cout<<a;	
    return 0;
  }
  else if(a<0){
    cout<<a-b.at(n-1);
  }
  else{
    cout<<a-b.at(0);
  }
}

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

int main() {
  string s;
  cin>>s;
  int len =s.size();
  for(int i = 0;i<len;i++)
    s[i]='x';
  
  
  
  
  
  cout<<s<<endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>

int main(){

	double min_v;
	while (std::cin >> min_v){

		double t = min_v / 9.8;
		double sum = 4.9*t*t;

		int y = (sum + 5) / 5;

		std::cout << (5 * y - 5 > sum ? y : y + 1) << std::endl;
	}

	return 0;
}

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

int main(){
    string str;
    int cnt;
    int place;
    while(1){
        cin>>str;
        if(str=="-"){
            break;
        }
        cin>>cnt;
        for(int i=0;i<cnt;i++){
            cin>>place;
            str=str.substr(place)+str.substr(0,place);
        }
        cout<<str<<endl;
    }
    return 0;
}


Measured memory_bytes: 3172
#include <stdio.h>
int main(){
  int all,legs;
  scanf("%d %d",&all,&legs);
  for(int tirtle = 0; tirtle <= legs/4; tirtle++){
    for(int crane = 0; crane <= legs/2; crane++){
      if(((tirtle*4) + (crane*2) == legs) && (tirtle + crane) == all){
      	printf("Yes");
      	return 0;
  	  }
    }
  }
  printf("No");
  return 0;
}


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

int main(){
  int Q;
  cin >> Q;
  long long A[Q], B[Q], C[Q];
  for(int i = 0; i < Q; i++) cin >> A[i] >> B[i];
  for(int i = 0; i < Q; i++){
    if(A[i] == B[i] || A[i] + 1 == B[i]){
      cout << 2 * A[i] - 2 << endl;
    }else{
      C[i] = sqrt(A[i] * B[i]);
      if(C[i] * C[i] == A[i] * B[i]) C[i]--;
      if(C[i] * (C[i] + 1) >= A[i] * B[i]) cout << 2 * C[i] - 2 << endl;
      else cout << 2 * C[i] - 1 << endl;
    }
  }
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<math.h>
#include<cmath>
#include<vector>
#include<stack>
#include<queue>
#include<functional>
#include<map>
#include<set>
#include <string>



using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)


map<string, int> mp;
#define ll long long

int main() {
    int n;
    cin >> n;
    string s, t;
    cin >> s >> t;
    for (int i = 0; i < s.size(); i++) {
        bool ok = true;
        for (int j = 0; j < s.size() - i; j++) {
            if (s[i + j] != t[j]) ok = false;
        }
        if (ok) {
            cout << n + i << endl;
            return 0;
        }
    }
    cout << 2 * n << endl;
    return 0;
}

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

int main() {
  int N, K;
  cin >> N >> K;
  vector<int> x(N), y(N);
  for (int i = 0; i < N; ++i)
    cin >> x[i] >> y[i];
  vector<int> x_sort = x, y_sort = y;
  sort(x_sort.begin(), x_sort.end());
  sort(y_sort.begin(), y_sort.end());
  // Initializes with the worst case.
  int64_t area = (int64_t)(x_sort[N - 1] - x_sort[0]) *
                          (y_sort[N - 1] - y_sort[0]);
  for (int left = 0; left < N; ++left) {
    for (int right = left + 1; right < N; ++ right) {
      for (int bottom = 0; bottom < N; ++bottom) {
        for (int top = bottom + 1; top < N; ++top) {
          int n_dots = 0;
          int64_t l = x_sort[left], r = x_sort[right];
          int64_t b = y_sort[bottom], t = y_sort[top];
          for (int i = 0; i < N; ++i) {  // Counts dots in the rect.
            if (l <= x[i] && x[i] <= r && b <= y[i] && y[i] <= t)
              ++n_dots;
          }
          if (n_dots >= K)
            area = min(area, (int64_t)(r - l) * (t - b));
        }
      }
    }
  }
  cout << area << endl;
}


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

int main(){
    
    string s,t;
    cin >> s >> t;
    
    if(t.size())
        t.pop_back();
    
    if(s.size()==t.size() && s==t)
        cout << "Yes" << endl;
    else
        cout << "No" << endl;
    
    return 0;
}


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

int main(){
    int N,L;
    cin >> N >> L;
    string S[N];
    for(int i=0;i<N;i++) cin >> S[i];
    sort(S,S+N);
    string s;
    for (int i=0;i<N;i++) s += S[i];
    cout << s << endl;
}

Measured memory_bytes: 256
def shuffle(m,x):
    tmp = m[:x]
    m = m[x:]
    m = m + tmp
    return m

data_list = list()
while True:
    data = list()
    n = input()
    if n == "-":
        break

    data.append(n)
    m = int(input())
    data.append(m)
    h_list = list()
    for i in range(m):
        h = int(input())
        h_list.append(h)
    data.append(h_list)
    data_list.append(data)

for data in data_list:
    ans = data[0]
    for h in data[2]:
        ans = shuffle(ans,h)
    print(ans)



Measured memory_bytes: 5596
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
 
using namespace std;
 
typedef long long ll;
 
#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;
 
#define MOD 1000000007
 
ll dp[305][305][305];
 
int main() {
  ll n,m;
  cin>>n>>m;
  vector<pair<pair<ll,ll>,ll> > vp;
  rep(i,0,m){
    ll a,b,c;
    cin>>a>>b>>c;
    vp.pb(mp(mp(a,b),c));
  }
  clr(dp,0);
  dp[0][0][0] = 1;
  rep(i,1,n+1){
    rep(j,0,302){
      rep(k,0,302){
        dp[i][j][k] += dp[i-1][j][k];
        dp[i][j][k] %= MOD;
        dp[i][i-1][k] += dp[i-1][j][k];
        dp[i][i-1][k] %= MOD;
        dp[i][j][i-1] += dp[i-1][j][k];
        dp[i][j][i-1] %= MOD;
      }
    }
    vector<pair<ll,ll> > v1;
    rep(j,0,vp.sz){
      if(vp[j].fi.se==i){
        v1.pb(mp(vp[j].fi.fi,vp[j].se));
      }
    }
        rep(p,0,v1.sz){
          ll l = v1[p].fi;
          ll r = i;
          ll x = v1[p].se;
          if(x==1){
            rep(j1,0,302){
              rep(k1,0,302){
                if(j1>=l||k1>=l){
                  dp[i][j1][k1] = 0;
                }
              }
            }
          }
          else if(x==2){
            rep(j1,0,302){
              rep(k1,0,302){
                if(j1<l&&k1<l){
                  dp[i][j1][k1] = 0;
                }
                if(j1>=l&&k1>=l){
                  dp[i][j1][k1] = 0;
                }
              }
            }
          }
          else{
            rep(j1,0,302){
              rep(k1,0,302){
                if(j1<l||k1<l){
                  dp[i][j1][k1] = 0;
                }
              }
            }
          }
        }
  }
  ll ans = 0;
  rep(i,0,302){
    rep(j,0,302){
      ans += dp[n][i][j];
      ans %= MOD;
    }
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 221952
#include <algorithm>
#include <iostream>
#include <queue>
#include <string>
#include <vector>
#include <math.h>
#include <utility>
#include <map>
#include <queue>
#include <stack>

using namespace std;

#define INF 210000000
#define int long long

int gcd(int a, int b) {
  int amari = a % b;
  int c = b;
  if (amari == 0) {
    return b;
  } else {
    return gcd(b, amari);
  }
}

int lcm(int a, int b) { return a * b / gcd(a, b); }
void solve(){
    int n;
    cin >> n;
    int ans = 0;
    for(int i=n;i>0;i--){
        ans += i;
    }
    cout << ans;
}
signed main() {
    solve();
}


Measured memory_bytes: 256
N, M = gets.split.map(&:to_i)

cakes = N.times.map { gets.split.map(&:to_i) }
ans = 0

[1, -1].repeated_permutation(3).each do |l|
  cakes.sort_by! { |x, y, z| l[0] * x + l[1] * y + l[2] * z }

  values = [0, 0, 0]
  cakes.reverse.take(M).each do |x, y, z|
    values[0] += x
    values[1] += y
    values[2] += z
  end

  v = values.map(&:abs).inject(:+)
  ans = v if ans < v
end

puts ans


Measured memory_bytes: 2040
N = int(input())
H = list(map(int,input().split()))
i = 0
H[0] -= 1

while True:
    if N == 1:
        answer = 'Yes'
        break
    if H[i]<H[i+1]:
        H[i+1] -= 1
    if H[i]>H[i+1]:
        answer = 'No'
        break
    i += 1
    if i == N-1:
        answer = 'Yes'
        break
print(answer)

Measured memory_bytes: 84868
#include<algorithm>
#include <iostream>
#include<cstdio>
#include<cmath>
#include<iomanip>
#include<string>
using namespace std;
int main(){
   
    string s;
    cin>>s;
    
    char m[3]={s[0],s[1],s[2]};
    sort(m,m+3);
    int p=0;
    char e[3]={'a','b','c'};
    
    for(int i=0;i<3;i++){
        if(m[i]!=e[i]){
            p=1;
        }
    }
    
   
    if(p==0){
        cout<<"Yes"<<endl;
    }else{
        cout<<"No"<<endl;
    }
    
    
    
   
    
    return 0;
   
}






Measured memory_bytes: 256
#include <iostream>

int main()
{
	long long n;
	std::cin >> n;
	int f;
	int ans = 10;
	for (long i = 1; i * i <= n; i++)
	{
		if (n % i == 0)
		{
			f = std::to_string(n / i).length();
			if (ans >= f)
				ans = f;	
		}
	}
	std::cout << ans << '\n';

	return 0;
}


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

int main(){
  int a,b,c;
  cin >> a >> b >> c;
  if(a == b && b == c){
    cout << 1 << endl;
    return 0;
  }
  else if(a == b){
    cout << 2 << endl;
    return 0;
  }
  else if(b == c){
    cout << 2 << endl;
    return 0;
  }
  else if(c == a){
    cout << 2 << endl;
    return 0;
  }
  cout << 3 << endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
  int x,y;
  scanf("%d",&x);
  scanf("%d",&y);
  
  if(x == 2 || y == 2)
    printf("No");
  else if(x == 4 || x == 6 || x == 9 || x == 11){
    if(y== 4 || y == 6 || y == 9 || y == 11)
      printf("Yes");
    else
      printf("No");
  }else if( y == 4||y == 6 || y == 9 || y == 11){
    printf("No");
  }else
    printf("Yes");
  
  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rrep(i,a,b) for(int i=(int)(a);i>=(int)(b);--i)
#define fore(i,a) for(auto &i:a)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define isin(i,a,b) ((a) <= (i) && (i) < (b))
#define uni(a) (a).erase(unique(all(a)),(a).end())
#define fi first
#define se second
#define pb push_back
#define sz(a) (int)(a).size()
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
using ll  = long long;
using unit= unsigned;
using ull = unsigned long long;
using P   = pair<int,int>;
using vi  = vector<int>;
using vl  = vector<ll>;
using vvi = vector<vi>;
using vp  = vector<P>;
void _main(); int main(){ cin.tie(0); ios::sync_with_stdio(false); _main(); }
template<class T>void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
template<class T>void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T>void POSS(T condition){ if(condition) cout << "POSSIBLE" << endl; else cout << "IMPOSSIBLE" << endl; }
template<class T>void Poss(T condition){ if(condition) cout << "Possible" << endl; else cout << "Impossible" << endl; }
template<class T>bool chmax(T &a, const T &b){ if (a<b){ a = b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if (b<a){ a = b; return 1; } return 0; }
template<class T>T gcd(T a, T b){ if (b==0){ return a; }else{ return gcd(b, a%b); }}
template<class T>T lcm(T a, T b){ return a / gcd(a, b) * b; }
constexpr double eps = 1e-10;
constexpr int inf = INT_MAX / 2;
constexpr ll infl = 1LL << 60;

ll Solve(string &s) {
  ll ans = 0;
  ll cnt = 0;
  rep (i, 0, sz(s)) {
    if (s[i] == 'A') {
      ++cnt;
    } else if (s[i] == 'B' && s[i+1] == 'C') {
      ans += cnt;
      ++i;
    } else {
      cnt = 0;
    }
  }
  return ans;
}

void _main() {
  string s;
  cin >> s;
  cout << Solve(s) << endl;
}

Measured memory_bytes: 720
#include <bits/stdc++.h>
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPR(i, n) for (int i = n - 1; i >= 0; i--)
#define INF 1145141919
#define LLINF 1145148101919
#define PI 3.14159265359
int dy[] = {1, 0, -1, 0};
int dx[] = {0, 1, 0, -1};
int ny, nx;
typedef long long ll;
using namespace std;

ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }

ll lcm(ll m, ll n)
{
    if ((0 == m) || (0 == n))
        return 0;
    return ((m / gcd(m, n)) * n);
}

ll llpow(ll x, ll y)
{
    ll ans = 1;
    REP(i, y)
    ans *= x;
    return ans;
}

int ctoi(char c)
{
    if (c >= '0' && c <= '9')
    {
        return c - '0';
    }
    return 0;
}

class UnionFind
{
public:
    vector<ll> par; // 各元の親を表す配列
    vector<ll> siz; // 素集合のサイズを表す配列(1 で初期化)

    // Constructor
    UnionFind(ll sz_) : par(sz_), siz(sz_, 1LL)
    {
        for (ll i = 0; i < sz_; ++i)
            par[i] = i; // 初期では親は自分自身
    }
    void init(ll sz_)
    {
        siz.assign(sz_, 1LL); // assign: 再代入
        par.resize(sz_);      // resize: 再確保
        for (ll i = 0; i < sz_; ++i)
            par[i] = i; // 初期では親は自分自身
    }

    // Member Function
    // Find
    ll root(ll x)
    { // 根の検索
        while (par[x] != x)
        {
            x = par[x] = par[par[x]]; // x の親の親を x の親とする
        }
        return x;
    }

    // Union(Unite, Merge)
    bool merge(ll x, ll y)
    {
        x = root(x);
        y = root(y);
        if (x == y)
            return false;
        // merge technique（データ構造をマージするテク．小を大にくっつける）
        if (siz[x] < siz[y])
            swap(x, y);
        siz[x] += siz[y];
        par[y] = x;
        return true;
    }

    bool issame(ll x, ll y)
    { // 連結判定
        return root(x) == root(y);
    }

    ll size(ll x)
    { // 素集合のサイズ
        return siz[root(x)];
    }
};

template <class T>
inline bool chmin(T &a, T b)
{
    if (a > b)
    {
        a = b;
        return true;
    }
    return false;
}

template <class T>
inline bool chmax(T &a, T b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}

template <typename Container>
bool exist_in(const Container &c, const typename Container::value_type &v)
{
    return (c.end() != std::find(c.begin(), c.end(), v));
}

int ctoi_alpha(char c)
{
    if (c >= 'a' && c <= 'z')
    {
        return c - 'a';
    }
    return 0;
}

const int MOD = 1000000007;
// res[i][c] := i 文字目以降で最初に文字 c が登場する index (存在しないときは n)
vector<vector<int>> calcNext(const string &S)
{
    int n = (int)S.size();
    vector<vector<int>> res(n + 1, vector<int>(26, n));
    for (int i = n - 1; i >= 0; --i)
    {
        for (int j = 0; j < 26; ++j)
            res[i][j] = res[i + 1][j];
        res[i][S[i] - 'a'] = i;
    }
    return res;
}
// mod 1000000007 の世界で a += b する関数
void add(long long &a, long long b)
{
    a += b;
    if (a >= MOD)
        a -= MOD;
}

//std::cout << std::defaultfloat << std::setprecision(10);
////////////////////////////////////////
int main()
{
    int n,m; cin >> n >> m;

    if(n==m) cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
	int main(){
    	char c;
    		scanf("%c", &c);
    			if(c == 'a'){
                  printf("vowel");
                }else if(c == 'i'){
                  printf("vowel");
                }else if(c == 'u'){
                  printf("vowel");
                }else if(c == 'e'){
                  printf("vowel");
                }else if(c == 'o'){
                  printf("vowel");
                }else{
                	printf("consonant");}
      return 0;
    }
      

Measured memory_bytes: 128
#include <cstring>
#include <iostream>
using namespace std;
int main()
{
    char a[100000005];
    cin>>a;
    bool c=0,f=0;
    for(int i=0;i<strlen(a);i++)
    {
        if(a[i]=='C')
            c=1;
        if(a[i]=='F'&&c==1)
        {
            cout<<"Yes";
            return 0;
        }
    }
    cout<<"No";
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <utility>
#include <cmath>
#include <numeric>
#include <string>
#include <limits>

#define debug(s) cout << s << endl
#define debug1(s, t) cout << s << " " << t << endl

using namespace std;
using i64 = long long;

bool achievable(i64 X, const vector<int> &A, const vector<int> &F, int N, i64 K)
{
    for (i64 i = 0; i < N; i++)
    {
        i64 a = A[i];
        i64 f = F[i];
        i64 p = max(0LL, a - X / f);
        K -= p;
    }
    return K >= 0LL;
}

int main()
{
    int N;
    i64 K;
    cin >> N >> K;

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

    for (auto &&a : A)
        cin >> a;

    for (auto &&f : F)
        cin >> f;

    sort(A.begin(), A.end());
    sort(F.begin(), F.end(), greater<int>());

    i64 MAX_TIME = numeric_limits<i64>::max() >> 2;
    i64 l = -1LL;
    i64 r = MAX_TIME;

    if (achievable(0LL, A, F, N, K))
    {
        cout << 0 << endl;
        return 0;
    }

    while (r - l > 1LL)
    {
        i64 X = (r + l) >> 1;
        if (achievable(X, A, F, N, K))
            r = X;
        else
            l = X;
    }

    cout << r << endl;
    
    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <string>
#include <sstream>
#include <iomanip> 
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
#include <bitset>

using namespace std;

#define MAXN 50000

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

	int n, i, j, k;
	cin >> n;
	vector<long double> a(n);
	for (i = 0; i < n; i++) cin >> a[i];
	sort(a.begin(), a.end());
	long double s = (a[0] + a[1]) / 2;
	for (i = 2; i < n; i++) {
		s = (s + a[i]) / 2;
	}

	cout << setprecision(10) << fixed << s << "\n";


	return 0;
}


Measured memory_bytes: 888
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define pb push_back
#define fi first
#define se second
#define Mod 1000000007



int main(){
    ll i,j;
    ll k,a,b;
    cin>>k>>a>>b;
    ll t=1;

    if(b<a+2){
        cout<<1+k<<endl;
        return 0;
    }
    else {
        
        while(t<a&&k>0){
            k--;
            t++;
        }
        if(k>0){
            ll r=k%2;
            ll q=k/2;
            
            t=t+q*(b-a)+r;
            
            
        }

    }

    cout<<t<<endl;
    return 0;
    

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int maxn =2e5+10;
inline int read()
{
	char c=getchar();int x=0,f=1;
	while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
	while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
	return x*f;
}
int Max[maxn][21],Min[maxn][21],t[maxn],a[maxn];
int Query_Max(int l,int r)
{
	int k=log2(r-l+1);
	return max(Max[l][k],Max[r-(1<<k)+1][k]);//把拆出来的区间分别取最值
}
int Query_Min(int l,int r)
{
	int k=log2(r-l+1);
	return min(Min[l][k],Min[r-(1<<k)+1][k]);//把拆出来的区间分别取最值
}
int main()
{
	int n=read(),k=read();
	for(int i=1;i<=n;i++){
		Max[i][0]=read();
		a[i]=Min[i][0]=Max[i][0];
		t[i]=1;
	}
	for(int j=1;j<=21;j++)
		for(int i=1;i+(1<<j)-1<=n;i++){
			Max[i][j]=max(Max[i][j-1],Max[i+(1<<(j-1))][j-1]);
			Min[i][j]=min(Min[i][j-1],Min[i+(1<<(j-1))][j-1]);
		}
	int ans=0,f=0;
	for(int i=2;i<=n;i++){
		if(a[i]>a[i-1]) t[i]=t[i-1]+1;
//		cout<<t[i]<<" ";
	}
//	cout<<endl;
	for(int i=1;i<=n;i++){
		if(i<=k){
			if(i==k){
				if(t[i]>=k){
					ans++;f=1;
				}else{
					ans++;
				}
			}
		}else{
			if(t[i]>=k){ //排了后没有变化
				if(!f) f=1,ans++;
			}else{
				if(Min[i-k][0]!=Query_Min(i-k, i-1) || Max[i][0]!=Query_Max(i-k+1, i)){
					ans++;
				}
			}
			
		}
//		printf("%d ",ans);
	}
	printf("%d\n",ans);
	return 0;
}


Measured memory_bytes: 34560
#include<iostream>
using namespace std;
 
int main()
{
    // get integers
  	int i;
    int N;
    cin >> N;
    int V[N], C[N];
  	for(i = 0 ; i <= N-1 ; i++){
     cin >> V[i];
    }
    for(i = 0 ; i <= N-1 ; i++){
     cin >> C[i];
    } 
  	// Compute
  	int Ans = 0;
    for(i = 0 ; i <= N-1 ; i++){
     if ((V[i] - C[i]) > 0){
 	 	Ans += V[i] - C[i];	
     }
    }
    // output
    cout << Ans;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#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;

int main(){
  
  
    
    
    char s[100];
    cin>>s;
    s[3]='8';
    cout<<s<<endl;
return 0;
}


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

using namespace std;

int main(){
    int N, Z, W;
    cin >> N >> Z >> W;
    vector<int> a(N);
    map<int,int> VX,VY;

    for (size_t i = 0; i < N; i++)
    {
        cin >> a[i];
    }

    function<int(int,int,int)> Vx,Vy;
    
    Vx = [&](int Z,int W,int k){
        // int Wk = W << 32 + k;
        // if(VX.find(Wk)!=VX.end()){
        //     return VX[Wk];
        // }
        int m = abs(W-a[N-1]);
        int c = N;
        for (int i = N-1; i >=k ; i--)
        {
            int Vyi = Vy(a[i-1],W,i+1);
            if(Vyi > m){
                m = Vyi;
                c=i;
            }else{
                break;
            }
        }
        // VX[Wk] = m;
//        cerr << "X: " << c << endl;
        return m;
    };

    Vy = [&](int Z,int W,int k){
        // int Zk = Z << 32 + k;
        // if(VY.find(Zk)!=VY.end()){
        //     return VY[Zk];
        // }
        int m = abs(Z-a[N-1]);
        int c = N;
        for (int i = N-1; i >= k; k--)
        {
            int Vxi = Vx(Z,a[i-1],i+1);
            if(Vxi < m){
                m = Vxi;
                c = i;
            }else{
                break;
            }
        }
        // VY[Zk] = m;
  //      cerr << "Y: " << c << endl;
        return m;
    };

    cout << Vx(Z,W,1) << endl << flush;
    return 0;
}

Measured memory_bytes: 384
'use strict'

const main = input => {
	const args = input.split('\n').map(arg => arg.split(' '))
	const a = args.slice(0, 5).map(arg => parseInt(arg[0], 10))
	const k = parseInt(args[5][0], 10)
	let flg = true
	
	for (let i = 0; i < (5 - 1); i++) {
		for (let j = (i + 1); j < 5; j++) {
			if (a[j] - a[i] > k) flg = false
		}
	}

	if (flg) console.log('Yay!')
	else console.log(':(')
}

main(require('fs').readFileSync('/dev/stdin', 'utf8'))


Measured memory_bytes: 7372
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i, n) for(ll i=0; i<n; i++)
#define repr(i, s, e) for(ll i=s; i>=e; i--)
#define reps(i, s, e) for(ll i=s; i<=e; i++)
#define inf 1e18
#define all(v) v.begin(),v.end()
#define vsort(v) sort(v.begin(), v.end())
#define vsortr(v) sort(v.begin(), v.end(), greater<ll>())
#define ceil(a, b) (a+b-1)/b
#define ok cout << "ok" << endl;
#define sp << " " <<
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val){ fill((T*)array, (T*)(array+N), val); }
template<typename T> inline bool chmax(T &a, T b){ if(a<b){ a=b; return true; } return false; }
template<typename T> inline bool chmin(T &a, T b){ if(b<a){ a=b; return true; } return false; }
template<typename T> void vdebug(vector<T> v){ cout << "vdebug" << endl; for(auto vv : v){ cout << vv << " "; } cout << endl; }
template<typename T> void adebug(T arr[], ll n){ cout << "adebug" << endl; reps(i, 0, n){ cout << arr[i] << " "; } cout << endl; }
template<typename T1, typename T2> void mdebug(map<T1, T2> mp){ cout << "mdebug" << endl; for(auto const& m : mp){ cout << m.first sp m.second << endl; }}
template<typename T1, typename T2> void mldebug(multimap<T1, T2> mp){ cout << "mldebug" << endl; for(auto const& m : mp){ cout << m.first sp m.second << endl; }}
template<typename T1, typename T2> void mdebugr(map<T1, T2, greater<T1>> mp){ cout << "mdebug" << endl; for(auto const& m : mp){ cout << m.first sp m.second << endl; }}
template<typename T1, typename T2> void mldebugr(multimap<T1, T2, greater<T1>> mp){ cout << "mldebug" << endl; for(auto const& m : mp){ cout << m.first sp m.second << endl; }}
void ans(bool b){ if(b) cout << "Yes" << endl; else cout << "No" << endl; }
void ans2(bool b){ if(b) cout << "YES" << endl; else cout << "NO" << endl; }
int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};
int dy[] = {0, 0, 1, -1, 1, -1, -1, 1};


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

    int r;
    cin >> r;
    cout << r*r << endl;

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <queue>
#include <algorithm>
#include <climits>

using namespace std;

int main(){
    priority_queue<long long> P, Q;
    long long PSUM = 0, QSUM = 0, a_prime = LLONG_MIN;
    int N; cin >> N; int a[N+N+N]; long long Pa[N+1], Qa[N+1];
    for (int i =     0; i < N+N+N; i++){
        cin >> a[i];
        if      (i <    N) P.push(-a[i]), PSUM += a[i];
        else if (i >= N+N) Q.push( a[i]), QSUM += a[i];
    }

    Pa[N] = PSUM;
    for (int i = N    ; i <   N+N; i++){
        if (a[i] > -P.top()) PSUM += P.top(), P.pop(), PSUM += a[i], P.push(-a[i]);
        Pa[i-N] = PSUM;
    }

    Qa[N] = QSUM;
    for (int i = N+N-1; i >=    N; i--){
        if (a[i] <  Q.top()) QSUM -= Q.top(), Q.pop(), QSUM += a[i], Q.push( a[i]);
        Qa[i-N] = QSUM;
    }

    for (int i = 0; i < N; i++) a_prime = max(a_prime, Pa[i]-Qa[i+1]);
                                a_prime = max(a_prime, Pa[N]-Qa[N  ]);
                                a_prime = max(a_prime, Pa[N]-Qa[  0]);
    cout << a_prime << endl;
    return 0;
}


Measured memory_bytes: 4980
//In The Name Of Godd
#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef vector<string> vs;
typedef pair<ll, ll> ii;
typedef pair<int, ii> iii;
typedef pair<double, double> dd;
typedef pair<dd, double> ddd;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<dd> vdd;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ii> vii;
typedef vector<iii> viii;
typedef vector<vii> vvii;

#define forn(i, n) for (int i = 0; i < n; i++)
#define all(a) (a).begin(), (a).end()
#define inf 100000000000
#define eps 1e-9

int main() {
  int n; cin >> n;
  ll aa, bb, cc;
  cin >> aa >> bb >> cc;
  forn(i, n - 1) {
    ll a, b, c; cin >> a >> b >> c;
    // cout << a << ' ' << b << ' ' << c << endl;
    ll oa = aa, ob = bb, oc = cc;
    aa = max(aa, ob + a), aa = max(aa, oc + a);
    bb = max(bb, oc + b), bb = max(bb, oa + b);
    cc = max(cc, oa + c), cc = max(cc, ob + c);
  }
  cout << max(max(aa, bb), cc) << endl;
}


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

using namespace std;

const int maxi = 1e6+10;
int a[maxi], b[maxi];
int n,m ,x;
string s;

int main()
{
    cin>>n>>m>>x;

    for (int i=1;i<=n;i++)
        scanf("%d",&a[i]);

    for (int j=1;j<=m;j++)
        scanf("%d",&b[j]);

    int ans = a[1] + b[1];

    for (int i=1;i<=x;i++)
    {
        int y,z, c;
        scanf("%d%d%d",&y,&z,&c);
        ans = min(ans, a[y]  + b[z] - c);
    }

    sort(a+1,  a+n+1);
    sort(b+1, b+m+1);

    ans = min(ans, a[1] + b[1]);

    cout<<ans<<endl;
    return 0;
}
//Krajem maja samo uspomena osta
//nije bilo suza samo jedno zbogom


Measured memory_bytes: 4736
n = int(input())
ans = []
alpha = [chr(i) for i in range(97, 97+26)]
num = 0
rank = 0

for i in range(100):
    if num >= n:
        rank = i
        break

    num += 26 ** (i + 1)

num -= 26 ** rank
n -= num + 1
for i in range(rank):
    ans.append(alpha[n % 26])
    n = n // 26

ans.reverse()
print(''.join(ans))


Measured memory_bytes: 61948
#include<iostream>
#include<string>
#include<vector>
#include<unordered_map>
#include<algorithm>
#include<cmath>
#include<limits>
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)

typedef long long ll;

int main() {
	int a, b;
	cin >> a >> b;
	if (a >= 13) cout << b;
	else if (a >= 6) cout << b / 2;
	else cout << 0;
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
<?php
//ガウスジョルダン法

$count = 2;	//未知数の数
$value = array();	//係数配列

while(1){
	$res =fscanf(STDIN, '%d %d %d %d %d %d', $a,$b,$c,$d,$e,$f);
	if ($res==0) break;
	
	$value[0][0]=$a;  $value[0][1]=$b;  $value[0][2]=$c;
	$value[1][0]=$d;  $value[1][1]=$e;  $value[1][2]=$f;
	
	// $a or $e が０だと処理が止まるので入れ替えておく
        if ($a===0 || $e===0) {
		$value[0][0]=$d;  $value[0][1]=$e;  $value[0][2]=$f;
		$value[1][0]=$a;  $value[1][1]=$b;  $value[1][2]=$c;
	}
	
	for($i=0; $i<$count; ++$i){
		//注目式の未知数の係数を1にするためにその係数を格納
		$a = $value[$i][$i];
		
		//注目式の未知数の係数を1にするために注目式全体をaで割る
		for($j=$i; $j<=$count; ++$j){
			$value[$i][$j] = $value[$i][$j]/$a;
		}
		
		//注目式以外の未知数の係数を0にする
		for($j=0; $j<$count; ++$j){
			//注目式ならばスルー
			if ($j===$i) continue;
			//注目式以外の未知数の係数を格納
			$tmp = $value[$j][$i];
			//その値を0にするため、注目式との演算を行う
			for($k=0; $k<=$count; ++$k){
				//$value[$i][$k] が注目式の該当未知数の係数
				$value[$j][$k] = $value[$j][$k] - $tmp*$value[$i][$k];
			}
		}
	}
	
	//計算結果
	$x = $value[0][2];  $y = $value[1][2];
	$x = round($x, 3);  $y = round($y, 3);
	$x = sprintf('%.3f', $x);  $y = sprintf('%.3f', $y);
	echo $x.' '.$y.PHP_EOL;
}

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

int main() {
  int N,K,ans=1;
  cin>>N>>K;
  while(1){
    if(N/K==0){
      cout<<ans;
      return 0;
    }
    else{
      ans++;
      N=N/K;
    }
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define rep(i,n) for(int i=0;i<n;i++)
#define mod 1000000007 // 10^9+7
#define INF 99999999999 //10^12-1
#define dev 998244353 //tenka1
#define P pair<int,int>
#define F first
#define S second
string s;
signed main(){
    cin>>s;
    bool ans=true;
    int l=s.size();
    rep(i,l){
        if(i%2&&s[i]=='R')ans=false;
        if(i%2==0&&s[i]=='L')ans=false;
    }
    if(ans)puts("Yes");
    else puts("No");
    return 0;
}





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

namespace{
   constexpr int g1 = 1000 * 1000 * 1000, si = 1001 * 1002, si_log = 8 + 10, mod = static_cast<int>(1e9) + 7;
   constexpr long double eps = 1.0e-9;
   int n, m, k, ar[si], br[1234][1234];
   char vis[1234];
}

int64_t sol() {
   int64_t ret = 1 * numeric_limits<int64_t>::max();

   for (int h = 1; h <= n; h++) {
      for (int i = 1; i <= n; i++) {
         for (int j = 1; j <= n; j++) {
            const auto &c0 = i, &c1 = h, &c2 = j;
            const auto c = br[c0][c1] + br[c1][c2];
            br[c0][c2] = min(br[c0][c2], c);
         }
      }
   }

   do
   {
      int64_t c = 0;
      for (int i = 2; i <= k; i++)
      {
         const auto &c0 = ar[i - 1], &c1 = ar[i];
         const auto p = br[c0][c1];
         c += p;
      }
      ret = min(ret, c);
   }
   while (next_permutation(ar+1, ar+1+k));

   return ret;
}

int main() {
   ios_base::sync_with_stdio(0); cin.tie(0);
   
   while ((cin >> n >> m >> k))
   {
      memset(ar, 0, sizeof ar); memset(br, 50, sizeof br); memset(vis, 0, sizeof vis); 
      for (int i = 0; i <= n; i++) { br[i][i] = 0; }
      //for (int i = 0; i <= n; i++) { gr[i].clear(); }

      for (int i = 1; i <= k; i++){
         cin >> ar[i];
      }
      sort(ar + 1, ar + 1 + k);

      for (int i = 1; i <= m; i++) {
         //int a, b, c; cin >> a >> b >> c; gr[a].push_back({ b,c }); gr[b].push_back({ a,c });
         int a, b, c; cin >> a >> b >> c;
         br[a][b] = br[b][a] = min(c, br[a][b]);
         int z = 0;
         ++z;
      }
      auto s = sol();
      //cout << (s ? "Yes": "No") << '\n';
      cout << s << '\n';
#ifndef _DEBUG
      break;
#endif
   }
   return 0;
}

Measured memory_bytes: 10112
import java.util.Scanner;

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

		long ans = Long.MAX_VALUE;
		for(int x = 1; x <= Math.sqrt(n); x++) {
			if(n % x == 0) {
				long y = n / x;
				ans = Math.min(ans, x+y-2);
			}
		}
		System.out.println(ans);
	}
}

Measured memory_bytes: 23764