akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <string.h>

int main(int argc, const char * argv[]) {
    int x[6], i, tmp=0;
    char c[100];
    int left, right, front, back, bottom, top;
    for(i=0;i<6;i++){
        scanf("%d", &x[i]);
    }
    back = x[4];
    top = x[0];
    right = x[2];
    left = x[3];
    bottom = x[5];
    front =x[1];
    
    scanf("%s", c);
    for(i=0;i<strlen(c);i++){
        if(c[i] == 'N'){
            tmp = x[0];
            x[0] = x[1];
            x[1] = x[5];
            x[5] = x[4];
            x[4] = tmp;
        }else if(c[i] == 'E'){
            tmp = x[0];
            x[0] = x[3];
            x[3] = x[5];
            x[5] = x[2];
            x[2] = tmp;
        }else if(c[i] == 'S'){
            tmp = x[0];
            x[0] = x[4];
            x[4] = x[5];
            x[5] = x[1];
            x[1] = tmp;
        }else if(c[i] == 'W'){
            tmp = x[0];
            x[0] = x[2];
            x[2] = x[5];
            x[5] = x[3];
            x[3] = tmp;
        }

    }
    back = x[4];
    top = x[0];
    right = x[2];
    left = x[3];
    bottom = x[5];
    front =x[1];
    
    printf("%d\n", top);
    return 0;
}

Measured memory_bytes: 596
using System;
using System.Collections.Generic;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.WriteAns();
	}
}

class Sol{

	List<String> Content;
	int R;
	int C;
	String buf;
	
	public void WriteAns(){
		foreach(String s in Content){
			Console.Write(s);
		}
	}

	public Sol(){
		Content=new List<String>();
		while(true){
			var s=Console.ReadLine()+"\n";
			if(s=="END_OF_TEXT\n")break;
			Content.Add(s);
		}
//WriteAns();
		R=0;C=0;buf="";
		while(true){
			var s=Console.ReadLine();
			if(s[0]=='-')break;
			Operation(s[0]);
//Console.WriteLine("Ope={2},R={0},C={1},buf=\"{3}\"",R,C,s[0],buf=="\n"?"\\n":buf);WriteAns();
		}
	}
	

	void Operation(char c){
		switch(c){
			case 'a':
				C=0;
			break;
			case 'e':
				C=Content[R].Length-1;
			break;
			case 'p':
				if(R>0){C=0;R--;}
				else if(R==0){C=0;}
			break;
			case 'n':
				if(R<Content.Count-1){C=0;R++;}
				else if(R==Content.Count-1){C=0;}
			break;
			case 'f':
				if(C<Content[R].Length-1){C++;}
				else if(C==Content[R].Length-1 && R<Content.Count-1){R++;C=0;}
			break;
			case 'b':
				if(C>0){C--;}
				else if(C==0 && R>0){R--;C=Content[R].Length-1;}
			break;
			case 'd':
				if(Content[R].Length>1 && C<Content[R].Length-1){
					Content[R]=Content[R].Substring(0,C)+Content[R].Substring(C+1);
				}
				else if(C==Content[R].Length-1 && R<Content.Count-1){
					Content[R]=Content[R].Substring(0,C)+Content[R+1];
					Content.RemoveAt(R+1);
				}
			break;
			case 'k':
				if(C==Content[R].Length-1 && R<Content.Count-1){
					Content[R]=Content[R].Substring(0,C)+Content[R+1];
					Content.RemoveAt(R+1);
					buf="\n";
				}
				else if(C<Content[R].Length-1){
					buf=Content[R].Substring(C);
					buf=buf.Substring(0,buf.Length-1);
					Content[R]=Content[R].Substring(0,C)+"\n";
				}
			break;
			case 'y':
				if(buf==""){;}
				else if(buf=="\n"){
					String sss=Content[R].Substring(C);
					Content[R]=Content[R].Substring(0,C)+"\n";
					Content.Insert(R+1,sss);
					R++;C=0;
				}
				else{
					Content[R]=Content[R].Substring(0,C)+buf+Content[R].Substring(C);
					C+=buf.Length;
				}

			break;
		}
	}
}

Measured memory_bytes: 5428
#include<stdio.h>
#include<string.h>
int main(void)
{
	int n, r, p, c;
	int num[1000][50];
	int ans[1000];
	int i, t,k,l;
	int change;
	int re[1000];
	n = r = 1;
	for (i = 0; i < 1000; i++)
	{
	scanf("%d %d", &n, &r);
	if (n == 0 && r == 0)
	{
		break;
	}
	for (t = 0; t < n; t++)
	{
		num[i][t] = n - t;
	}
	for (t = 0; t < r; t++)
	{
	
		scanf("%d %d", &p, &c);
		for (l = 0; l < n ; l++)
		{
			re[l] = num[i][l];
		}
		for (k = 0; k < c; k++)
		{
			change = re[p-1+k];
			num[i][k] = change;
		}
		for (k = 0; k < p - 1; k++)
		{
			change = re[k];
			num[i][c + k] = change;
		}
			
	}
	ans[i] = num[i][0];
	}
	for (t = 0; t < i; t++)
	{
		printf("%d\n", ans[t]);
	}

	
}


Measured memory_bytes: 2664
#from statistics import median
#import collections
#aa = collections.Counter(a) # list to list || .most_common(2)で最大の2個とりだせるお a[0][0]
from fractions import gcd
from itertools import combinations,permutations # (string,3) 3回
#from collections import deque
from collections import deque,defaultdict
#import bisect
#
#    d = m - k[i] - k[j]
#    if kk[bisect.bisect_right(kk,d) - 1] == d:
#
#
#
# pythonで無理なときは、pypyでやると正解するかも！！
#
#

import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7
#mod = 9982443453
def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
n = I()
A = readInts()
g = 0
for i in range(n):
    g = gcd(g,A[i])
print(g)


Measured memory_bytes: 21572
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define REVERSE(v,n) reverse(v,v+n);
#define VREVERSE(v) reverse(v.begin(), v.end());
#define ll long long
#define pb(a) push_back(a)
#define INF 999999999

using namespace std;


int dy[4] = { 0,0,1,-1 };
int dx[4] = { 1,-1,0,0 };
int dxx[8] = { 0,0,1,1,1,-1,-1,-1 };
int dyy[8] = { 1,-1,0,1,-1,0,1,-1 };


int main() {
	ll N;
	cin >> N;
	ll a = N;
	ll s = 0;
	while (a > 0) {
		s += a % 10;
		a = a / 10;
	}
	if (N%s == 0) cout << "Yes" << endl;
	else cout << "No" << endl;
}


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

using namespace std;


void test_case(){	
	string s;
	cin >> s;
	if (s[0] >= 'a' && s[0]<='z')
		cout << "a" << endl;
	else
		cout << "A" << endl;
}

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
//	int t;
//	cin >> t;
//	while (t--)
	test_case();
	return 0;
}

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

int main(){
	ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
	
	int n;
	cin>>n;
	if(n&1){
		cout<<n*2;
	}else{
		cout<<n;
	}
	
	return 0;
}


Measured memory_bytes: 3560
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,n-1,0)
#define all(v) v.begin(), v.end()
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int N;
  cin >> N;
  vector<ll> A(N);
  int odd = 0;
  rep(i, N) {
    cin >> A[i];
    if(A[i]%2) odd++;
  }
  cout << (odd==0 ? "second" : "first") << "\n";
  return 0;
}


Measured memory_bytes: 4000
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author aryssoncf
 */



// Taken from: https://github.com/bqi343/USACO/blob/master/Implementations/content/contest/templateShort.cpp

#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<ull> vul;
typedef vector<ll> vl;
typedef vector<pii> vpii;

#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define F0R(i,a) FOR(i,0,a)
#define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i)
#define R0F(i,a) ROF(i,0,a)
#define trav(a,x) for (auto& a: x)

#define sz(x) (int)x.size()
#define all(x) begin(x), end(x)
#define rsz resize

#define mp make_pair
#define pb push_back
#define f first
#define s second

const int MOD = 1e9+7; // 998244353; // = (119<<23)+1
const int MX = 2e5+5;

template<class T> bool ckmin(T& a, const T& b) {
    return a > b ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) {
    return a < b ? a = b, 1 : 0; }

mt19937 rng((uint32_t)chrono::steady_clock::now().time_since_epoch().count());


//
// Created by aryssoncf on 28/10/2019.
//

#include <type_traits>


#include <iterator>
#include <utility>

template <typename T>
constexpr auto hasBegin(int) -> decltype(std::begin(std::declval<T>()), true) {
    return true;
}

constexpr bool hasBegin(...) {
    return false;
}

template <typename T>
using IsContainer = std::integral_constant<bool, hasBegin<T>(0)>;


#ifndef JHELPER_EXAMPLE_PROJECT_IO_HPP
#define JHELPER_EXAMPLE_PROJECT_IO_HPP

#endif //JHELPER_EXAMPLE_PROJECT_IO_HPP

template<typename T>
std::istream &operator>>(std::istream &is, std::vector<T> &vec) {
    for (T &element: vec) {
        is >> element;
    }
    return is;
}

template<typename T, typename U>
std::istream &operator>>(std::istream &is, std::pair<T, U> &p) {
    is >> p.first;
    is >> p.second;
    return is;
}

template <class X, class Y>
std::ostream & operator << (std::ostream & os, std::pair <X, Y> const& p) {
    return os << p.first << " " << p.second;
}

template <class Ch, class Tr, class Container>
std::basic_ostream <Ch, Tr> & operator << (std::basic_ostream <Ch, Tr>& os, Container const& x) {
    bool first = true;
    for(auto& y : x) {
        if (first) {
            first = false;
        } else {
            os << " ";
        }
        os << y;
    }
    return os;
}

using namespace std;

class DDerangement {
public:
	void solve(std::istream& in, std::ostream& out) {
        int n;
        in >> n;
        vi P(n);
        in >> P;
        bool open = false;
        int res = 0;
        FOR(i, 0, n) {
            P[i]--;
            if (P[i] == i and not open) {
                open = true;
                res++;
            } else {
                open = false;
            }
        }
        out << res << '\n';
	}

	void setup() {}
};


int main() {
    std::ios_base::sync_with_stdio(false);
	DDerangement solver;
    solver.setup();
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	in.tie(nullptr);
    out << std::fixed;
    out.precision(20);
	solver.solve(in, out);
	return 0;
}


Measured memory_bytes: 3760
#include "bits/stdc++.h"

// Begin {{{
using namespace std;

#define all(x) x.begin(), x.end()
#define rep(i, n) for (i64 i = 0; i < (n); ++i)
#define reps(i, s, n) for (i64 i = (s); i <= (n); ++i)
#define VAR(Type, ...) Type __VA_ARGS__; IN(__VA_ARGS__)

#ifdef DEBUG
#define dump(...) dump_(#__VA_ARGS__, __VA_ARGS__);
#else
#define dump(...)
#endif

using i64 = int_fast64_t;
using pii = pair<i64, i64>;

template <class A, class B>
inline bool chmax(A &a, const B &b) { return b > a && (a = b, true); }

template <class A, class B>
inline bool chmin(A &a, const B &b) { return b < a && (a = b, true); }

constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;

// IN
void IN() {}
template <class Head, class... Tail>
void IN(Head&& head, Tail&&... tail) {
  cin >> head;
  IN(forward<Tail>(tail)...);
}

// OUTS
void OUTS() {}
template <class Head, class... Tail>
void OUTS(Head&& head, Tail&&... tail) {
  cout << head << " \n"[sizeof...(tail)==0];
  OUTS(forward<Tail>(tail)...);
}

template <class T>
void OUTS(vector<T> &vec) { for (auto &e : vec) cout << e << " \n"[&e==&vec.back()]; }

template <class T>
void OUTS(vector<vector<T>> &df) { for (auto &vec : df) OUTS(vec); }

// OUTL
void OUTL() {}
template <class Head, class... Tail>
void OUTL(Head&& head, Tail&&... tail) {
  cout << head << "\n";
  OUTL(forward<Tail>(tail)...);
}

template <class T>
void OUTL(vector<T> &vec) { for (auto &e : vec) cout << e << "\n"; }

// OUTN
void OUTN() {}
template <class Head, class... Tail>
void OUTN(Head&& head, Tail&&... tail) {
  cout << head;
  OUTN(forward<Tail>(tail)...);
}

template <class T>
void OUTN(vector<T> &vec) { for (auto &e : vec) cout << e; }

// DEGUG
template <class T>
void dump_(const char *s, T&& x) {
  clog << '{';
  while(*s != '\0') clog << *(s++);
  clog << ": " << x << '}' << "\n";
}

template <class Head, class... Tail>
void dump_(const char *s, Head&& head, Tail&&... tail) {
  clog << '{';
  while(*s != ',') clog << *(s++);
  clog << ": " << head << "}, ";
  for (++s; !isgraph(*s); ++s);
  dump_(s, forward<Tail>(tail)...);
}
// }}} End

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

  VAR(int, a, b);

  bool ok = false;
  i64 norm = a * b;
  if (norm % 2) ok = true;

  reps(i, 1, 3) {
    if ((norm * i) % 2) ok = true;
  }

  OUTL((ok) ? "Yes" : "No");
  return 0;
}


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

using namespace std;
typedef long long ll;
typedef pair<ll,int> pli;

const int N=2e5+5;
int n;
ll k,a[N],s[N];

int tree_sz;
ll tree[2*N];
ll query(int l, int r) {
        ll ret=0;
        for (l+=tree_sz,r+=tree_sz; l<r; l>>=1, r>>=1) {
                if (l%2) ret += tree[l++];
                if (r%2) ret += tree[--r];
        }
        return ret;
}

void update(int pos, int by) {
        for (pos += tree_sz; pos > 0; pos >>= 1)
                tree[pos] += by;
}

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

        s[0] = 0;
        for (int i=1; i<=n; i++)
                s[i] = a[i] + s[i-1];

        vector<pli> v;
        for (int i=0; i<=n; i++)
                v.push_back(make_pair(s[i],i));

        sort(v.begin(),v.end());

        tree_sz = n+1;
        ll ret=0;
        for (auto p : v) {
                ret += query(0,p.second);
                update(p.second,1);
        }

        cout << ret << "\n";
}

Measured memory_bytes: 10736
/* Author: $%U%$
 * Time: $%Y%$-$%M%$-$%D%$ $%h%$:$%m%$:$%s%$
**/
#include <bits/stdc++.h>
using namespace std;
#define fore(i, a, b) for (int i = a, to = b; i < to; i++)
#define foref(i, a, b) for (int i = b - 1, to = a; i >= to; i--)
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
#define SZ(v) (int)v.size()
#define pb push_back
typedef long long Long;
typedef pair<int, int> Pair;
const int MX = 1e6;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(NULL);
  Long k;
  cin >> k;
  if (k % 7 == 0) k /= 7;
  Long num = 1;
  fore(i, 0, MX) {
    if (num % k == 0) {
      cout << i + 1 << '\n';
      return 0;
    }
    num *= 10;
    num++;
    num %= k;
  }
  cout << -1 << '\n';

  return 0;
}

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


#define  SZ(items) (int)items.size()
#define  CLR(a)  memset(a,0,sizeof(a))
#define  SET(a)  memset(a,-1,sizeof(a))

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



template <class T> inline T biton(T n, T pos)
{
    return n | ((T)1 << pos);
}
template <class T> inline T bitoff(T n, T pos)
{
    return n & ~((T)1 << pos);
}
template <class T> inline T ison(T n, T pos)
{
    return (bool)(n & ((T)1 << pos));
}
template <class T> inline T gcd(T a, T b)
{
    while (b)
    {
        a = a % b;
        swap(a, b);
    }
    return a;
}
template <class T> inline T bigmod(T p, T e, T m)
{
    T ret = 1;
    for (; e > 0; e >>= 1)
    {
        if (e & 1)
            ret = (ret * p) % m;
        p = (p * p) % m;
    }
    return (T)ret;
};

#ifdef DEBUG
#define debug(...) __f(#__VA_ARGS__, __VA_ARGS__)
template < typename Arg1 >
void __f(const char* name, Arg1&& arg1)
{
    cerr << name << " is " << arg1 << std::endl;
}
template < typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args)
{
    const char* comma = strchr(names + 1, ',');
    cerr.write(names, comma - names) << " is " << arg1 << " | ";
    __f(comma + 1, args...);
}
#else
#define debug(...)
#endif


void solve()
{
    int x,x2,y1,y2;
    cin>>x>>x2>>y1>>y2;

    if(y2==1)
    {
        cout<<1<<endl;
    }
    else{
        cout<<0<<endl;
    }

}

int main()
{
    ios_base::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(10);
    cout.tie(nullptr);
    cin.tie(nullptr);


    int t = 1;

    while (t--)
    {
        solve();
    }

    return 0;
}


Measured memory_bytes: 256
n = int(input())
S = list(map(int, input().split()))
q = int(input())
T = list(map(int, input().split()))

ans = 0
for i in T:
    if i == S[-1] or i == S[0]:
        ans += 1
    else:
        left = 0
        right = n-1
        while right-left > 1:
            mid = (left+right)//2
            if S[mid] == i:
                ans += 1
                break
            elif S[mid] < i:
                left = mid
            else:
                right = mid

print(ans)


Measured memory_bytes: 16708
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
using LL = long long;
const LL LINF = 1e18;
using namespace std;
#define COUT(v) cout<<(v)<<endl
#define CIN(n)  int(n);cin >> (n)
#define LCIN(n) LL(n);cin >> (n)
#define SCIN(n) string(n);cin >> (n)
#define YES(n) cout<<((n)? "YES" : "NO")<<endl
#define Yes(n) cout<<((n)? "Yes" : "No")<<endl
#define POSSIBLE(n) cout << ((n) ? "POSSIBLE" : "IMPOSSIBLE"  ) << endl
#define Possible(n) cout << ((n) ? "Possible" : "Impossible"  ) <<endl

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

#define FOREACH(x,a) for(auto& (x) : (a) )

#define ALL(obj) (obj).begin(),(obj).end()

#define P pair<LL,LL>
#define I vector<int>
#define S set<int>
#define pb(v) push_back(v)
#define V vector
#define rt return
#define rmsame(a) sort(ALL(a)),a.erase(unique(ALL(a)), a.end())

typedef string::const_iterator State;
class PalseError {};
class Edge{
public:
    LL from,to,value;
    Edge(LL a,LL b,LL c){
        from = a;
        to = b;
        value = c;
    }
    Edge(LL a,LL b){
        from = a;
        to = b;
    }
};

int main(){
    SCIN(s);
    COUT(count(ALL(s),'1'));
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vel;
typedef vector<int> vei;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> ve_vel;
typedef vector<vector<int>> ve_vei;
typedef vector<vector<char>> ve_vec;
typedef vector<vector<bool>> ve_veb;
typedef vector<vector<string>> ve_ves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define fs first
#define sc second
#define pub push_back
#define pob pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)

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

    int N; cin >> N;
    vel A(N),B(N); 
    rep(i,N) cin >> A[i];
    rep(i,N) cin >> B[i];

    ll a = 0LL, b = 0LL;
    rep(i,N){
        if(A[i] > B[i]) b += A[i] - B[i];
        if(A[i] < B[i]) a +=  ( B[i] - A[i] ) / 2 ;
    }
    if(a >= b) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 384
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author cherrypi59
 */

#pragma GCC optimize ("O2")
#pragma GCC optimize ("tree-vectorize")
#pragma GCC target ("sse4")

#include <bits/stdc++.h>
#define FOR(i, a, b) for(int i=(a);i<(b);++i)
#define FFOR(i, a, b) FOR(i, a, b+1)
#define REP(i, n) FOR(i, 0, n)
#define RREP(i, n) FOR(i, 1, n+1)
#define ALL(v) (v).begin(), (v).end()
#define RALL(v) (v).rbegin(), (v).rend()
#define LEN(x) (int)(x).size()
#define DUMP(x) cerr<<__LINE__<<' '<<#x<<"="<<(x)<<endl;
#define popcnt(x) __builtin_popcount(x)
#define popcntll(x) __builtin_popcountll(x)
#define pb push_back
#define eb emplace_back
#define mp make_pair

using namespace std;
using lint = long long;
using pii =  pair<int, int>;
using pll =  pair<lint, lint>;
template <typename T> using vc = vector<T>;
template <typename T> using vvc = vector<vector<T>>;
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(a>b){a = b; return true;} return false;}

constexpr lint ten(int n) {return n==0 ? 1 : ten(n-1)*10;}

class AKyuInAtCoder {
public:
    void solve(std::istream& in, std::ostream& out){
        ios_base::sync_with_stdio(false);
        in.tie(nullptr), out.tie(nullptr);
        int X;
        in>>X;
        out<<10-X/200<<'\n';
    }
};


int main() {
	AKyuInAtCoder solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}


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

int main() {
    string s;
    int n, count_A = 0, count_B = 0, count_AB = 0, ans = 0;
    cin >> n;
    for(int i = 0; i < n; ++i) {
        cin >> s;
        for(int j = 0; j < s.size()-1; j++){
            if(s[j] == 'A') {
                if(s[j+1] == 'B') {
                    ans++;
                }
            }
        }
        if(s[0] == 'B' && s[s.size()-1] != 'A') {
            count_B++;
        } else if(s[0] != 'B' && s[s.size()-1] == 'A') {
            count_A++;
        } else if(s[0] == 'B' && s[s.size()-1] == 'A') {
            count_AB++;
        }
    }
    if(count_A == 0 && count_B == 0) {
        if(count_AB != 0) {
            cout << ans + count_AB - 1 << '\n';
        } else {
            cout << ans + count_AB << '\n';
        }
    } else {
        cout << ans + min(count_A, count_B) + count_AB << '\n';
    }
}


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

using namespace std;

#define ll long long

//#define TEST

signed main(){
    int n;
    cin >> n;
    vector<ll> a(n);
    for (int i = 0;i < n;++i)
        cin >> a[i];

    /* ペアを作っていない数をmultisetで管理する. */
    multiset<ll> left;
    for (auto ai : a)
        left.insert(ai);

#ifdef TEST
    cout << "----------a (sorted)----------" << endl;
    for (auto ai : left)
        cout << ai << " ";
    cout << endl;
#endif

    /* 2べき数を候補になりうる範囲ですべて列挙する. */
    vector<ll> p2(31);
    for (int i = 0;i < 31;++i)
        p2[i] = ((ll)1) << i;

#ifdef TEST
    cout << "----------power of 2----------" << endl;
    for (auto i : p2)
        cout << i << " ";
    cout << endl;
    cout << "------------------------------" << endl;
#endif

    /* aの大きいほうから貪欲にペアを組んでいく. */
    int ans = 0;
    auto iter = left.end();
    --iter;
    while (left.size() > 1){
        ll ai = *iter;
        // aiを超える最小の2べきを求め、それに対応するペアがあるかを考える.
        ll pair_sum = *lower_bound(p2.begin(),p2.end(),ai + 1);
        auto pair = left.lower_bound(pair_sum - ai);
        if ((*pair) != pair_sum - ai || pair == iter){
#ifdef TEST
            cout << "deleted " << (*iter) << endl;
#endif
            left.erase(iter);
            if (left.size() == 0) break;
            iter = left.end();
            if (iter == left.begin()) break;
            --iter;
            continue;
        }
        ++ans;
#ifdef TEST
        cout << "pair " << (*iter) << ", " << (*pair) << endl;
#endif
        left.erase(iter);
        left.erase(pair);
        if (left.size() == 0) break;
        iter = left.end();
        if (iter == left.begin()) break;
        --iter;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 11136
n,k=map(int,input().split())
li=[int(K) for K in input().split()]
dp=[[0 for j in range(k+1)] for i in range(n+1)]
dp[0][0]=1
for b in range(1,n+1):
  dp[b][0]=1
mod=10**9+7  
for i in range(1,n+1):
  sums=[0]*(k+1)
  sums[0]=1
  for j in range(1,k+1):
    sums[j]=(sums[j-1]+dp[i-1][j])%mod
  for a in range(k+1):
    res=sums[a]
    if(a-li[i-1]-1)>=0:
      res=(res-sums[a-li[i-1]-1]+mod)%mod
    dp[i][a]=res
print(dp[n][k])    


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

int main(){
    int a,b,c;
    cin>>a>>b>>c;
    if(a+b+c>=22) cout<<"bust" <<endl;
    else cout<<"win" << endl;
}


Measured memory_bytes: 256
#![allow(unused_imports, unused_variables, dead_code)]
use std::io::*;
use std::fmt::*;
use std::str::*;
use std::cmp::*;
use std::collections::*;

trait InputValue {
    fn parse(s: &str) -> Self;
}

fn read<T: InputValue>() -> T {
    let mut buf = String::new();
    let _ = stdin().read_line(&mut buf);
    T::parse(&buf.trim())
}

fn readnc<T: InputValue>() -> Vec<T> {
    let mut vec = vec![];
    let line: String = read();
    for token in line.split_whitespace() {
        vec.push(T::parse(token));
    }
    vec
}

fn readn<T: InputValue>(n: usize) -> Vec<T> {
    let mut vec = vec![];
    for _ in 0..n {
        vec.push(read());
    }
    vec
}

macro_rules! parse_single_value {
    ($($t:ty),*) => {
        $(
            impl InputValue for $t {
                fn parse(s: &str) -> $t { s.parse().unwrap() }
            }
        )*
	}
}
parse_single_value!(i32, i64, f32, f64, usize, String);

macro_rules! parse_tuple {
	($($t:ident),*) => {
		impl<$($t),*> InputValue for ($($t),*) where $($t: InputValue),* {
			fn parse(s: &str) -> ($($t),*) {
				let mut tokens = s.split_whitespace();
				let t = ($($t::parse(tokens.next().unwrap())),*);
				t
			}
		}
	}
}
parse_tuple!(A, B);
parse_tuple!(A, B, C);

// ===

fn main() {
    let (n, avg): (usize, usize) = read();
    let a: Vec<i32> = readnc();
    let max = n * 50 + 10;

    let mut dp: Vec<Vec<Vec<i64>>> = vec![vec![vec![0; max]; n+1]; n+1];
    dp[0][0][0] = 1;

    for i in 0..n {
        for j in 0..n {
            for s in 0..max {
                let base = dp[i][j][s];
                if base == 0 {
                    continue
                }
                dp[i+1][j][s] += base;
                dp[i+1][j+1][s + a[i] as usize] += base;
            }
        }
    }

    let mut ans = 0;
    for j in 1..n+1 {
        ans += dp[n][j][j*avg as usize];
    }
    println!("{}", ans);
}

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

#define SORT(c) sort((c).begin(), (c).end())
#define REVERSE(v) reverse((v).begin(), (v).end())
#define ANS(ans) cout << (ans) << endl;
#define UNIQUE(v) (v).erase(unique((v).begin(), (v).end()), (v).end());
typedef vector<int> VI;
typedef pair<int, int> P;

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

struct Mystruct{
    long long atack;
    long long mp;
    double cost;

    Mystruct(long long input_a, long long input_b){
        atack = input_a;
        mp = input_b;
        cost = input_a*1.0 / input_b;
    }
    bool operator<(const Mystruct &another) const
    {
        if(cost == another.cost){
            return mp < another.mp;
        }
        return cost < another.cost;//年齢を比較
    };
};

int main()
{
    int h, n;
    cin >> h >> n;

    vector<Mystruct> magics;
    REP(i, n)
    {
        long long atack, mp;
        cin >> atack >> mp;

        magics.push_back(Mystruct(atack, mp));
    }
    long long MAX = pow(10,8);
    vector<long long> dp(MAX,0);
    // cout << MAX << endl;

    long long mp = 1;
    while(true){
        long long temp_max = 0;

        REP(i, n)
        {
            long long temp=0;
            if (mp - magics[i].mp >= 0)
            {
                temp = dp[mp - magics[i].mp] + magics[i].atack;
            }
            temp_max = max(temp_max, temp);
        }
        dp[mp] = temp_max;
        // cout << temp_max << endl;
        if (dp[mp] >= h)
        {
            ANS(mp);
            break;
        }
        mp++;
    }
    return 0;
}


Measured memory_bytes: 781696
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
// typedef __int128 ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
#define FR first
#define SE second
#define MP make_pair
#define PB push_back
#define vc vector
#define db double
#define all(x) (x).begin(),(x).end()
#define sz(x) ((int)(x).size())
#define bin(x) (1ll<<(x))
#define fo(i,l,r) for(int i=(l),I=(r);i<=I;i++)
#define fd(i,r,l) for(int i=(r),I=(l);i>=I;i--)
#define mem(x,val) memset(x,val,sizeof x)
#define Swap(a,b,n) for(int I=0;I<=n;I++) swap(a[I],b[I])
#define PC __builtin_popcountll
#ifdef DEBUG
	#define debug(A,args...) fprintf(stderr,A,##args)
#else
	#define debug(A,args...) printf("")
#endif
#define deb debug("line %d\n",__LINE__)
namespace mine
{
	ll qread()
	{
		ll ans=0,f=1;char c=getchar();
		while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
		while('0'<=c and c<='9') ans=ans*10+c-'0',c=getchar();
		return ans*f;
	}
	void write(ll num){if(num<0) putchar('-'),num=-num;if(num>=10) write(num/10);putchar('0'+num%10);}
	void write1(ll num){write(num);putchar(' ');}
	void write2(ll num){write(num);putchar('\n');}
	template<typename T>inline bool chmax(T&a,const T&b){return a<b?a=b,1:0;}
	template<typename T>inline bool chmin(T&a,const T&b){return a>b?a=b,1:0;}
	ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
	bool IN(ll x,ll l,ll r){return l<=x and x<=r;}
	void GG(){puts("-1");exit(0);}
	
	const db eps=1e-8;
	const int INF=0x3f3f3f3f;
	const int MOD=1e9+7;
	int mm(const int x){return x>=MOD?x-MOD:x;}
	template<typename T> void add(T &x,const int &y){x=(x+y>=MOD?x+y-MOD:x+y);}
	ll qpower(ll x,ll e,int mod=MOD){ll ans=1;while(e){if(e&1)ans=ans*x%mod;x=x*x%mod;e>>=1;}return ans;}
	ll invm(ll x){return qpower(x,MOD-2);}
	const int MM=1e6+10;
	ll fac[MM],facinv[MM],Inv[MM];ll Comb(int n,int m){return n<0 or n<m?0:fac[n]*facinv[m]%MOD*facinv[n-m]%MOD;}
	void PRE()
	{
		fac[0]=1;fo(i,1,MM-1) fac[i]=fac[i-1]*i%MOD;
		facinv[MM-1]=invm(fac[MM-1]);fd(i,MM-1,1) facinv[i-1]=facinv[i]*i%MOD;
		Inv[1]=1;fo(i,2,MM-1) Inv[i]=(MOD-MOD/i)*Inv[MOD%i]%MOD;
	}
	const int N=1e6+10;
	//------------------FIXED------------------
	int n,a[N];set<string> ans;
	void dfs(int pos)
	{
		if(pos==n+1)
		{
			string ret="a";int now=1;
			fo(i,2,n) if(a[i]<0) ret+=('a'+now),now++; else ret+=ret[a[i]-1];
			ans.insert(ret);
			return;
		}
		a[pos]=-1;dfs(pos+1);
		fo(go,1,pos-1) if(a[go]<0) a[pos]=go,dfs(pos+1);
	}
	void main()
	{
		n=qread();dfs(1);
		bool tg=0;for(auto in:ans) { if(!tg) tg=1; else cout<<endl; cout<<in;}
	}
};//变量重名！
signed main()
{
	#ifdef DEBUG
	//freopen("a.in","r",stdin);
	freopen("z.txt","r",stdin);
	//freopen("a.out","w",stdout);
	#endif
	srand(time(0));
	mine::PRE();
	mine::main();
	debug("\n------------------------------------------\nTime: %.2lf s",1.0*clock()/CLOCKS_PER_SEC);
}

Measured memory_bytes: 39424
#include<bits/stdc++.h>
using namespace std;
int main(){
    int a,b,c;
    cin>>a>>b>>c;
    int ans=10000;
    ans=min(ans,abs(a-c)+abs(b-c));
    ans=min(ans,abs(b-a)+abs(a-c));
    ans=min(ans,abs(b-c)+abs(c-a));
    ans=min(ans,abs(c-a)+abs(a-b));
    ans=min(ans,abs(c-b)+abs(b-a));
    ans=min(ans,abs(a-b)+abs(b-c));
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
N, M, X = map(int, input().split())
C = []
A = []
for _ in range(N):
    tmp = [int(a) for a in input().split()]
    C.append(tmp[0])
    A.append(tmp[1:])

mi = 1 << 100
for i in range(1 << N):
    B = [0] * M
    c = 0
    for j in range(N):
        if i >> j & 1:
            a = A[j]
            c += C[j]
            for k in range(M):
                B[k] += a[k]
    if min(B) >= X:
        mi = min(mi, c)

print(mi if mi < 1 << 99 else -1)

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

#define St              first
#define Nd              second
#define pb              push_back
#define pf              push_front
#define lwb             lower_bound
#define upb             upper_bound
#define all(a)          (a).begin(), (a).end()
#define Reset(s, n)     memset(s, n, sizeof(s))
#define Sz(a)           int((a).size())
#define Max(a, b, c)    max(max((ll)(a), (ll)(b)), (ll)(c))
#define Min(a, b, c)    min(min((ll)(a), (ll)(b)), (ll)(c))
#define Unique(a)       (a).resize(unique(all(a)) - (a).begin())
#define bit(n, i)       (((n) >> (i)) & 1)
#define cntbit(n)       __builtin_popcountll(ll(n))

using namespace std;

typedef long double ld;
typedef long long ll;
typedef unsigned long long ull;

const int MOD = 998244353;
const ll INF = 1e9;
const ld PI = acos((ld) -1);
const ld EPS = 1e-12;
inline bool isPrime (ll x){ if(x <= 1) return 0; if(x <= 3) return 1; if (!(x % 2) || !(x % 3)) return 0; ll s = sqrt(1.0 * x) + EPS; for(ll i = 5; i <= s; i += 6){if (!(x % i) || !(x % (i + 2))) return 0;}return 1;}
inline ll fpow(ll n, ll k, ll p = MOD) {ll r = 1; for (; k; k >>= 1) {if (k & 1) r = r * n % p; n = n * n % p;} return r;}
inline int inv(int a, ll p = MOD) {return fpow(a, p - 2, p);}
inline void addmod(int& a, int val, int p = MOD) {if ((a = (a + val)) >= p) a -= p;}
inline void submod(int& a, int val, int p = MOD) {if ((a = (a - val)) < 0) a += p;}
inline ll gcd(ll a, ll b) {ll r; while (b) {r = a % b; a = b; b = r;} return a;}
inline ll lcm(ll a, ll b) {return a / gcd(a, b) * b;}
inline void onbit(ll &a, int i){a |= 1LL << i;}
inline void offbit(ll &a, int i){onbit(a, i), a -= (1LL << i);}

const int N = 5e3 + 5;
#define pii pair<int, int>
//const int MOD = 998244353;

ll n, a[N];

void solve(){
   int n, m;
   cin >> n >> m;
   cout << n * (n - 1) / 2 + m * (m - 1) / 2;

}

int main(){
   ios_base::sync_with_stdio(0);
   cin.tie(0); cout.tie(0);
   cout << fixed << setprecision(10);
   //    freopen("input.txt", "r", stdin);
   //    freopen("output.txt", "w", stdout);
   int query = 1;
//   cin >> query;
   int start = 1000 * clock() / CLOCKS_PER_SEC;
   while(query--) solve();
   cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC  - start << "ms\n";
}


Measured memory_bytes: 256
#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <iomanip>

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

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

signed main(){
    int n, k;
    cin >> n >> k;
    vector<int> a(n);
    int x;
    rep(i, n){
        cin >> a[i];
        if(a[i] == 1){
            x = i;
        }
    }

    int l = x;
    int r = n - 1 - x;
    int nl = l % (k - 1);
    int nr = r % (k - 1);

    int ans = l / (k-1) + r / (k-1);
    ans += (nl + nr) / (k-1);
    if((nl + nr) % (k-1) > 0){
        ans++;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 1144
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
			
			int x = Integer.parseInt(sc.next());
	        int num = 100003;
			boolean[] PrimeNumber =  new boolean[num+1];
			
			for (int i = 0 ; i < num +1 ; i++) {
				PrimeNumber[i] = false;
			}
			
			PrimeNumber[2] = true;			
			
	        boolean isPrime = false;

	        for (int i = 5; i <= num; i += 2) {

	        	for (int j = 2; j * j <= i; j++) {

	        		if (i % j == 0) {
	                    isPrime = false;
	                    break;
	                }
	                isPrime = true;
	            }
	            if (isPrime) {
	                PrimeNumber[i] = true;
	                
	            }
	        }
	        
	        
	        for (int i = x; i < num+1 ; i++ ) {
	        	if(PrimeNumber[i]) {
	        		System.out.println(i);
	        		break;
	        	}
	        	
	        }
	        
	    }

}

Measured memory_bytes: 21972
#include <cstdio>
#include <cmath>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <bitset>
#include <iterator>
#define loop(i, a, b) for(int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define debug(x)  cout << #x << " = " << (x) << endl;

using namespace std;
using LL = long long;
using ULL = unsigned long long;
const LL INF = (1LL << 60);
bool warshall_floyd(vector<vector<LL>> &dist) {
    int n = dist.size();
    const LL INF = (1LL << 60);
    rep(k, n) rep(i, n) if (dist[i][k] != INF) {
        rep(j, n) if (dist[k][j] != INF) {
            dist[i][j]= min(dist[i][j] , dist[i][k] + dist[k][j]);
            if (j == k and dist[j][k] < 0) return false;
        }
    }
    return true;
}
int main() {
    int N, M, R; cin >> N >> M >> R;
    vector<int> r(R);
    rep(i, R) cin >> r[i], --r[i];

    vector<vector<LL>> dist(N, vector<LL>(N, INF));
    rep(i, M) {
        int a, b, c; cin >> a >> b >> c;
        --a, --b;
        dist[a][b] = c;
        dist[b][a] = c;
    }
    warshall_floyd(dist);

    sort(r.begin(), r.end());
    LL ans = INF;
    do {
        LL d = 0;
        rep(i, R - 1) {
            d += dist[r[i]][r[i + 1]];
        }
        ans = min(ans, d);
    } while (next_permutation(r.begin(), r.end()));

    cout << ans << endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int N, M;
    cin >> N >> M;
    long long A[N], B[N];
    vector<pair<long, long>> v;
    for (int i = 0; i < N; i++)
    {
        cin >> A[i] >> B[i];
        v.push_back(make_pair(A[i], B[i]));
    }
    sort(v.begin(), v.end());
    long long sum = 0, cnt = 0;
    for (int i = 0; i < N; i++)
    {
        sum += v[i].first*v[i].second;
        cnt += v[i].second;
        if (cnt == M)
        {
            cout << sum << endl;
            return 0;
        }
        if (cnt > M)
        {
            while (1)
            {
                sum -= v[i].first;
                cnt--;
                if (cnt == M){
                    cout<<sum<<endl;
                    return 0;
                }
            }
        }
    }
}


Measured memory_bytes: 3444
#include <bits/stdc++.h>
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define srep(i,s,t) for (int i = s; i < t; ++i)
using namespace std;
typedef long long int ll;
#define dame { puts("-1"); return 0;}
#define yn {puts("Yes");}else{puts("No");}


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

    double ans = w*h/2;

    int b = 0;
    if(x*2==w&&y*2==h){
        b  = 1;
    }

    cout << fixed << setprecision(10) << ans  << ' ' << b << endl;
    return 0;
}
 
 


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <algorithm>
#include <math.h>
#include <sstream>
#include <numeric>
#include <string>

using namespace std;

int H, W, N;
int sr, sc;
string S, T;
map<char, int> dx;
map<char, int> dy;

bool CanDrop(char A, char B)
{
  int x = sr;
  int y = sc;
  for (int i = 0; i < N; ++i) {
    if (S[i] == A) {
      x += dx[A];
      y += dy[A];
    }
    if (x < 0 or x >= H or y < 0 or y >= W) {
      return true;
    }
    if (T[i] == B) {
      int nx = x + dx[B];
      int ny = y + dy[B];
      if (0 <= nx and nx < H and 0 <= ny and ny < W) {
	x = nx;
	y = ny;
      }
    }
  }
  return false;
}

int main()
{
  dx['L'] =  0;  dx['R'] =  0;  dx['U'] = -1;  dx['D'] = +1;
  dy['L'] = -1;  dy['R'] = +1;  dy['U'] =  0;  dy['D'] =  0;

  cin >> H >> W >> N;
  cin >> sr >> sc;
  --sr;
  --sc;
  cin >> S;
  cin >> T;

  if (CanDrop('L', 'R')) cout << "NO" << endl;
  else if (CanDrop('R', 'L')) cout << "NO" << endl;
  else if (CanDrop('U', 'D')) cout << "NO" << endl;
  else if (CanDrop('D', 'U')) cout << "NO" << endl;
  else cout << "YES" << endl;
  
  return 0;
}


Measured memory_bytes: 776
import           Control.Monad
import           Data.Maybe
import qualified Data.ByteString.Char8 as BS

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
  [a, b] <- getIntList
  print $ a*b `div` gcd a b

Measured memory_bytes: 380
package main

import (
	"fmt"
	"sort"
)

func main() {
	var n,l int
	fmt.Scan(&n, &l)
	
	s := make([]string, n)
	for i := range s {
		fmt.Scan(&s[i])
	}
	
	sort.Strings(s)
	
	ans := ""
	for i := range s{
		ans += fmt.Sprintf("%v", s[i])
	}
	fmt.Println(ans)
}

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

vector<int> forintinput(int n) {
	vector<int> x;
	for(int i = 0;i < n;i++){
		int ia;
		cin >> ia;
		x.push_back(ia);
	}
	return x;
}
int main(){
	int k;
	string s;
	cin >> k >> s;
	if(s.length() > k){
		for(int i = 0;i < k;i++){
			cout << s[i];
		}
		cout << "..." << endl;
	}else{
		for(int i = 0;i < s.length();i++){
			cout << s[i];
		}
		cout << "\n";
	}
}

Measured memory_bytes: 3588
import Control.Monad

solve :: IO ()
solve = do
    a <- readLn :: IO Integer
    b <- readLn :: IO Integer
    let s = a + b
    if length (show s) > 80 then putStrLn "overflow" else print s

main :: IO ()
main  = readLn
    >>= \ n -> replicateM_ n solve

Measured memory_bytes: 4308
N = int(input())
L = list(map(int,input().split()))
dp = [10**10 for _ in range(N+3)]
dp[0] = L[0]
for i in range(N-1):
    dp[i+1] = min(dp[i]+abs(L[i]-L[i+1]),dp[i+1])
    if N -2  > i:
        dp[i+2] = min(dp[i]+abs(L[i]-L[i+2]),dp[i+2])
print(dp[N-1]-dp[0])



Measured memory_bytes: 13976
s = input()
if s[0]=="A":
    checker = 0
    for i in range(2, len(s)-1):
        if s[i] =="C":
            checker += 1
    if checker == 1:
        checker = 0
        for i in range(len(s)):
            if ord(s[i])<97:
                checker += 1
        if checker == 2:
            print("AC")
        else:
            print("WA")
    else:
        print("WA")
else:
    print("WA")

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

int main()
{
    int n;
    cin >> n;
    vector<int> masu;
    for (int i=0; i<n; ++i) {
        int ai;
        cin >> ai;
        masu.push_back(ai);
    }
    int s=0;
    for (int i=0; i<masu.size(); ++i) {
        if ((i+1)%2 == 1 && masu[i]%2 == 1)
            s++;
    }
    cout << s;
    return 0;
}

Measured memory_bytes: 3080
#include<iostream>
#include<string>
using namespace std;
int main() {
  string s;
  cin >> s;
  int i;
  int ans = 0;
  for(i=0;i<s.length()/2;i++)if(s[i] != s[s.length()-i-1])ans++;
  cout << ans << endl;
}

Measured memory_bytes: 256
# やるべきこと：　キーがブルーカード上にある回数, レッドカード上にある回数を, それぞれキーと紐つけて記録する

n = int(input())
a = [input() for i in range(n)]

m = int(input())
b = [input() for i in range(m)]

from collections import Counter

c = Counter(a)
d = Counter(b)

ans = 0

for key, value in c.items():
  ans = max(ans, value - d[key])
 
print(ans)


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

int main() {
  int N;
  int A;
  	cin >> N >> A;
    int X;
  X = N * A % 2;

  if (X > 0) {
    cout << "Odd" << endl;
  }
  else if (X == 0){
    cout << "Even" << endl;
  }
     
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define fastIO std::ios_base::sync_with_stdio(false); std::cin.tie(0); std::cout.tie(0)
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
typedef vector<int> VI;
typedef long long ll;
typedef pair<int,int> PII;
typedef double db;
//mt19937 mrand(random_device{}()); 
const ll mod=1000000007;
const int INF = 0x3f3f3f3f;
//int rnd(int x) { return mrand() % x;}
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}
ll gcd(ll a,ll b) { return b?gcd(b,a%b):a;}

const int maxn = 2e5 + 10; 

int main()
{
	fastIO;
	double l; cin >> l;
	printf("%.6f",l * l * l / 27);
	return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
int main (void){
	int n,r[200000],ma=-1000000000,mi;
	cin>>n;
	for(int i=0;i<n;i++)
	cin>>r[i];
	mi=r[0];
	for(int j=1;j<n;j++){
		ma=max(ma,r[j]-mi);
		mi=min(mi,r[j]);
	}
	cout<<ma<<endl;
}



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

using namespace std;
typedef long long ll;
typedef pair<int,int> P;

int N, M;

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

	cin >> N >> M;

	for (int i = N;i <= M;i++){
		if(M%i == 0){ cout << M/i << endl; break;}
		if(i*2 > M){ cout << 1 << endl; break;}
	}	

	return 0;

}


Measured memory_bytes: 256
import java.util.Scanner;

 class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int n= in.nextInt();
        long[] m = new long[n+1];
        long[] h = new long[n];
        for(int i=0;i<=n;i++){
            m[i]=in.nextInt();
        }
        for(int i=0;i<n;i++){
            h[i]=in.nextInt();
        }
        long count=0;
        for(int i=0;i<n;i++){
            if(h[i]>=m[i]){
                count+=m[i];
                //System.out.println(count);
                h[i]=h[i]-m[i];
                m[i]=0;

                if(h[i]>0){
                    if(h[i]>=m[i+1]){
                        count+=m[i+1];
                        //System.out.println(count);
                        m[i+1]=0;
                       // h[i]=0;

                    }else{
                        m[i+1]-=h[i];
                        count+=h[i];
                        //System.out.println("Yo"+count + " " + h[i]);
                    }

                }

            }else{
                m[i]-=h[i];
                count+=h[i];
                //System.out.println(count);
            }
        }
        System.out.println(count);

    }
}


Measured memory_bytes: 83596
#include <bits/stdc++.h>
#ifdef CHECK_

long gcd(long x, long y) {
  while( y != 0 ) {
    x %= y;
    std::swap(x, y);
  }
  return x;
}

int main() {
  auto n = get<long>();
  auto x = get<long>();
  auto res = 3 * (n - gcd(n, x));
  put(res);
  
  return 0;
}

#else

template<typename T>
T get() { return 0; }
template<>
int get() { int x; scanf("%d", &x); return x; }
template<>
long get() { long x; scanf("%ld", &x); return x; }

template<typename T>
void put(T x) {}
template<>
void put(int x) { printf("%d\n", x); }
template<>
void put(long x) { printf("%ld\n", x); }


#define CHECK_
#include __FILE__
#endif



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

#define ll long long
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
const int MAXN = 5e5+5;
const int MOD= 998244353;
int n,k;
struct node{
    double x,y,c,r;
}a[MAXN];
vector<pair<double,double> >v;
vector<pair<double,double> > cal(double x1,double y1,double r1,double x2,double y2,double r2) {//两圆交点
    x1-=x2,y1-=y2;
    double S=x1*x1+y1*y1,a=(S+r2*r2-r1*r1)/2,D=S*r2*r2-a*a;
    if(D<0) return {};
    double A1=a*x1,B1=y1*sqrt(D);
    double A2=a*y1,B2=x1*sqrt(D);
    return {{(A1+B1)/S+x2,(A2-B2)/S+y2},{(A1-B1)/S+x2,(A2+B2)/S+y2}};
}
bool check(double t){
    rep(i,1,n)a[i].r=t/a[i].c;
    v.clear();
    rep(i,1,n){
        v.push_back(make_pair(a[i].x,a[i].y));
        rep(j,i+1,n){
            auto p=cal(a[i].x,a[i].y,a[i].r,a[j].x,a[j].y,a[j].r);
            for(auto it:p){
                v.push_back(it);
            }
        }
    }
    int len=v.size();
    rep(i,0,len-1){
        pair<double,double>p=v[i];
        int num=0;
        rep(i,1,n){
            if((a[i].x-p.first)*(a[i].x-p.first)+(a[i].y-p.second)*(a[i].y-p.second)<=a[i].r*a[i].r||
               fabs((a[i].x-p.first)*(a[i].x-p.first)+(a[i].y-p.second)*(a[i].y-p.second)-a[i].r*a[i].r)<=1e-8)num++;
            if(num==k)return 1;
        }
    }return 0;
}
int main(){
    while(cin>>n>>k){
        rep(i,1,n)cin>>a[i].x>>a[i].y>>a[i].c;
        double l=0,r=1e9;
        rep(i,1,100){
            double mid=(l+r)/2;
            if(check(mid))r=mid;
            else l=mid;
        }
        printf("%.10lf\n",r);
    }
}


Measured memory_bytes: 256