akhauriyash/Code-Regression huggingface dataset:
#include <string>
#include <iostream>
#include <set>       // 要素数は size() で取得
#include <algorithm> // count_ifに必要
#include <array>     // sizeはコンパイル時定数で固定
#include <queue>
#include <vector>
#include <numeric> // accumulate, gcd

using namespace std;
// 問題が起こるまでintは使用禁止2020-04-13
using ll = long long;

// ll gcd(ll x, ll y)
// {
//     if (y == 0)
//         return x;
//     else
//         return gcd(y, x % y);
// }

template <class InputIterator, class T>
bool contains(InputIterator iterator, const T &value)
{
    if (find(iterator.begin(), iterator.end(), value) == iterator.end())
        return false;
    else
        return true;
}

// =========ここまでテンプレ============

int main()
{
    ll r;
    cin >> r;
    if (gcd(64, 96) == 32)
    {
        cout << r * 6.283185307179586232;
    }
    else
    {
        cout << "bad!!";
    }
}

Measured memory_bytes: 3232
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;

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

unsigned gcd(unsigned a, unsigned b)
{
	if (a < b) gcd(b, a);
	return !b ? a : gcd(b, a%b);
}

int main()
{
	int n, s;
	cin >> n >> s;
	vector<int> x(n);
	REP(i, n) cin >> x[i];
	x.push_back(s);
	sort(ALL(x));

	int ans = x[1] - x[0];
	for (int i = 1; i < n; i++){
		ans = gcd(ans, x[i+1] - x[i]);
	}
	cout << ans << endl;
}


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

using namespace std;

int main() {
    std::ios::sync_with_stdio(false); 
    cin.tie(nullptr);
    
    int N, W;
    cin >> N >> W;
    vector<int> w(N), v(N);
    for (int i = 0; i < N; ++i) {
        cin >> w[i] >> v[i];
    }
    constexpr int INF = 1'000'000'001, MX = 100'000;
    vector<int> dp(MX + 1, INF);
    dp[0] = 0;
    for (int i = 0; i < N; ++i) {
        for (int j = MX - v[i]; j >= 0; --j) {
            dp[j + v[i]] = min(dp[j + v[i]], dp[j] + w[i]);
        }
    }
    for (int j = MX; j >= 0; --j) {
        if (dp[j] <= W) {
            cout << j << "\n";
            return 0;
        }
    }
    return 0;
}

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

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define ALL(a)     (a).begin(),(a).end()
#define RALL(a)     (a).rbegin(),(a).rend()
#define PRINT(a)   cout << (a) << endl

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define Fi first
#define Se second

#define debug(x) cerr << x << " " << "(L:" << __LINE__ << ")" << '\n';

using ll = long long int;
using P = pair<int,int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using pii = pair<int, int>;

template <typename T> using PQ = priority_queue<T>;
template <typename T> using minPQ = priority_queue<T, vector<T>, greater<T>>;

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

const int INF = 1001001001;
const ll LINF = 1001001001001001001ll;
const int MOD = 1e9 + 7;

const int MAXS=3001;
int dp[MAXS][MAXS];

void print_lcs(string &s, string &t, int i, int j){
  if(i==-1 || j==-1)return;

  if(s[i] == t[j]){
    print_lcs(s,t,i-1,j-1);
    cout << s[i];
  }else if(dp[i+1][j] > dp[i][j+1]){
    print_lcs(s,t,i,j-1);
  }else{
    print_lcs(s,t,i-1,j);
  }
}

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

  REP(i,MAXS)REP(j,MAXS)dp[i][j]=0;

  REP(i,s.size())REP(j,t.size()){
    if(s[i]==t[j]){
      dp[i+1][j+1] = dp[i][j]+1;
    }else{
      dp[i+1][j+1] = max(dp[i+1][j], dp[i][j+1]);
    }
  }


  print_lcs(s,t,s.size()-1,t.size()-1);
  cout << endl;
}



Measured memory_bytes: 39008
#include <iostream>
#define N_MAX 7
#define SPACE 0
#define BLACK 1
#define WHITE -1

using namespace std;

int data[N_MAX][N_MAX][N_MAX];
int n, m, p;
int px, py, pz;
int turn;
int winner;
int winTime;

const int d[13][3] = {
  {1,0,0},{0,1,0},{0,0,1},
  {1,1,0},{0,1,1},{1,0,1},{1,-1,0},{0,1,-1},{-1,0,1},
  {1,1,1},{1,1,-1},{1,-1,1},{-1,1,1}
};

void init() {
  turn = BLACK;
  winner = SPACE;
  for(int i = 0; i < N_MAX; i++) {
    for(int j = 0; j < N_MAX; j++) {
      for(int k = 0; k < N_MAX; k++) {
	data[i][j][k] = SPACE;
      }
    }
  }
}

void put() {
  for(int z = 0; z < n; z++) {
    if(data[z][py][px] == SPACE) {
      data[z][py][px] = turn;
      pz = z;
      break;
    }
  }
}

int numOfConsective(int color, int di, int rev) {
  int cnt = 0;
  for(int i = 1; ; i++) {
    int nx = px + d[di][0] * i * rev;
    int ny = py + d[di][1] * i * rev;
    int nz = pz + d[di][2] * i * rev;
    if(nx < 0 || nx >= n) break;
    if(ny < 0 || ny >= n) break;
    if(nz < 0 || nz >= n) break;
    if(data[nz][ny][nx] != color) break;
    cnt++;
  }
  return cnt;
}

void isSequence() {
  int cnt;
  for(int i = 0; i < 13; i++) {
    cnt = numOfConsective(turn, i, 1);
    cnt += numOfConsective(turn, i, -1);
    cnt++;
    if(cnt >= m) {
      winner = turn;
      break;
    }
  }
}

void changeTurn() {
  turn *= -1;
}

int main() {
  while(1) {
    init();
    cin >> n >> m >> p;
    if(n == 0 && m == 0 && p == 0) break;
    for(int i = 0; i < p; i++) {
      cin >> px >> py;
      px--, py--;
      if(winner == SPACE) {
	put();
	isSequence();
	if(winner != SPACE) {
	  winTime = i+1;
	}
	changeTurn();
      }
    }

    if(winner == SPACE) {
      cout << "Draw" << endl;
    } else {
      if(winner == BLACK) {
	cout << "Black";
      } else if(winner == WHITE) {
	cout << "White";
      }
      cout << " " << winTime << endl;
    }
  }
  return 0;
}

Measured memory_bytes: 0
#include <cstdio>
#include <cmath>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <algorithm>

#ifdef _DEBUG
#define DMP(x) cerr << #x << ": " << x << "\n"
#else
#define DMP(x) ((void)0)
#endif

const int MOD = 1000000007, INF = 1111111111; 
using namespace std;
typedef long long lint;

int main() {

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

	int A, B, C;
	cin >> A >> B >> C;

	cout << min(B / A, C);

	return 0;
}

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

int main() {
  ll n;
  cin >> n;

  // 素因数分解する
  vector<pair<ll, int>> f;
  for (ll i = 2; i * i <= n; i++) {
    int cnt = 0;
    while (n % i == 0) {
      cnt++;
      n /= i;
    }
    if (cnt != 0) f.emplace_back(i, cnt);
  }
  if (n != 1) f.emplace_back(n, 1); // √nより大きい最後の約数を入れる

  int ans = 0;
  for (auto p : f) {
    int x = p.second;
    int b = 1;
    while (x >= b) {
      x -= b;
      b++;
      ans++;
    }
  }

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

Measured memory_bytes: 3596
#include <bits/stdc++.h>
using namespace std;
#include <iostream>
using namespace std;
int main() {
	int A, B, C, D, E, K;
	cin >> A >> B >> C >> D >> E >> K;
	cout << (E - A <= K ? "Yay!" : ":(") << endl;
	return 0;
}

Measured memory_bytes: 256
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <functional>
#include <queue>
#include <iostream>
#include <string.h>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <cstdint>
#include <climits>
#include <unordered_set>
#include <sstream>

using namespace std;

#define ll long long int
#define pll pair<double,ll>

vector<vector<ll>> dp;

int main()
{
    string s;
    cin >> s;
    for(int i = 0;i < s.length();i++)
    {
        if(s[i] == ',')
        {
            cout << ' ';
        }
        else
        {
            cout << s[i];
        }
    }
    cout << endl;
    return 0;
}

Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
constexpr ll mod=1e9+7;

int main()
{
  ll n;
  cin>>n;
  vector<ll> a(n);
  for (int i = 0; i < n; ++i)
  {
    cin>>a[i];
  }
  ll money=1000,kabu=money/a[0];
  for (int i = 1; i < n; ++i)
  {
    if(a[i]>a[i-1])
    {
      ll tmp=money%a[i-1];
      money=tmp+money/a[i-1]*a[i];
    }
  }
  cout<<money<<endl;
}

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

string T[2];

int main(void) {

	string S;

	cin >> S;

	int N = S.size();

	;

	for (int i = 0; i < N; i++) {
		if (i % 2 == 0) {
			T[0] += "0"; T[1] += "1";
		}
		else {
			T[0] += "1"; T[1] += "0";
		}
	}

	int ans1 = 0;
	for (int i = 0; i < N; i++) {
		if (S[i] != T[0][i]) { ans1++; }
	}

	int ans2 = 0;
	for (int i = 0; i < N; i++) {
		if (S[i] != T[1][i]) { ans2++; }
	}

	//cout << T[0] << endl;
	//cout << T[1] << endl;

	cout << min(ans1, ans2) << endl;

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

Measured memory_bytes: 768
#include "bits/stdc++.h"
#include <set>

using namespace std;
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define RFOR(i, a, b) for (int i = (b)-1; i >= (a); i--)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i < (n); i++)
#define rrep(i, n) for (int i = (n)-1; i >= 0; i--)
#define all(i) (i).begin(), (i).end()
#define rall(i) (i).begin(), (i).end(), greater<int>()
#define int long long
#define elif else if
#define eb emplace_back
#define pb push_back
#define mp make_pair
#define fst first
#define sec second
#define mod 1000000007
#define INF 10e10
template <typename T>

void print(T x)
{
	std::cout << x << " ";
}
template <typename T>

void println(T x)
{
	std::cout << x << "\n";
}

signed main(void) {
	string aa, bb, cc;
	cin >> aa >> bb >> cc;
	queue<char>a;
	queue<char>b;
	queue<char>c;
	rep(i, aa.size()) {
		a.push(aa[i]);
	}
	rep(i, bb.size()) {
		b.push(bb[i]);
	}
	rep(i, cc.size()) {
		c.push(cc[i]);
	}
	char turn = 'a';
	while (true) {
		if (turn == 'a') {
			if (a.empty()) {
				print("A");
				return 0;
			}
			turn = a.front();
			a.pop();
		}
		else if (turn == 'b') {
			if (b.empty()) {
				print("B");
				return 0;
			}
			turn = b.front();
			b.pop();
		}
		else if (turn == 'c') {
			if (c.empty()) {
				print("C");
				return 0;
			}
			turn = c.front();
			c.pop();
		}
	}
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
#include<vector>
#include<algorithm>
#include<unordered_set>
#include<unordered_set>
#include<cmath>
#include<string>
#define mod 1000000007
#define lld long long int
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
        lld n,m;
        cin>>n>>m;
        cout<<n*m<<"\n";
}

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

using namespace std;

bool dfs(queue<int> q, int a, int b)
{
  if (q.empty())
    return true;

  int front = q.front();
  q.pop();

  if (front > a && dfs(q, front, b))
    return true;
  if (front > b && dfs(q, a, front))
    return true;

  return false;
}

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

  for (int n = 0; n < N; n++)
  {

    queue<int> q;

    for (int i = 0; i < 10; i++)
    {
      int x;
      cin >> x;
      q.push(x);
    }

    if (dfs(q, 0, 0))
    {
      cout << "YES" << endl;
    }
    else
    {
      cout << "NO" << endl;
    }
  }
}



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

typedef long long  LL;
int n,a[200010];
LL ans;

void work()
{
	scanf("%d",&n);
	for (int i=1; i<=n; i++)  scanf("%d",&a[i]);
	for (int i=n; i; i--)
		if (a[i]>=i)  puts("-1"),exit(0);
		else  if (a[i+1]-a[i]>1)  puts("-1"),exit(0);
		else  if (a[i]!=a[i+1]-1)  ans+=a[i];
	printf("%lld",ans);
}

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


Measured memory_bytes: 1024
MOD = 1000000007
INF = float("inf")

h, n = map(int, input().split())

items = []
for i in range(n):
    a, b = map(int, input().split())
    items.append((a, b))

dp = [[INF for i in range(h + 1)] for j in range(n + 1)]

# for i in range(h + 1):
#     dp[0][i] = 0
#
for i in range(1, n + 1):
    dp[i][0] = 0

for i in range(1, n + 1):  # 1<= i <= N
    for j in range(1, h + 1):  # 1 <= j <= W
        if j - items[i - 1][0] >= 0:
            dp[i][j] = min(dp[i - 1][j], dp[i - 1][j - items[i - 1][0]] + items[i - 1][1],
                           dp[i][j - items[i - 1][0]] + items[i - 1][1])
        else:
            dp[i][j] = min(dp[i - 1][j], items[i - 1][1])

# print(dp)
print(dp[n][h])

Measured memory_bytes: 314120
#include<cstdio>
#include<cstring>

int main(){
	char s[201], t[101], p[101];

	scanf("%s %s", s, p);
	strcpy(t, s);
	strcat(s, t);

	if ( strstr(s, p) == NULL ) printf("No\n");
	else printf("Yes\n");

	return 0;
}


Measured memory_bytes: 2760
//#include <bits/stdc++.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
#define int long long
#define ll long long
#define ld long double
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
using P=pair<long long,long long>;
#define rep(i,n) for(long long i=0; i<(long long)n; i++)
#define req(i,n) for(long long i=n-1; i>=0; i--)
#define range(i,a,b) for(long long i=a; i<b; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((long long)(x).size())
#define COUT(x) cout << x << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define onBoard(y,x) (y>=0 && y<h && x>=0 && x<w)
#define pri_que priority_queue
#define vint vector<int>
#define vvint vector<vector<int>>
#define vi vector<int>
#define vvi vector<vector<int>>
#define vs vector<string>
#define vvc vector<vector<char>>
#define vc vector<char>
#define vp vector<pair<int,int>>
#define vb vector<bool>
#define vvb vector<vector<bool>>
#define show(x) cout<<#x<<"="<<x<<endl;
#define SUM(x) accumulate(x.begin(),x.end(),0)
#define MAX(x) *max_element(x.begin(),x.end())
#define MIN(x) *min_element(x.begin(),x.end())
#define couty cout<<"Yes"<<endl
#define coutn cout<<"No"<<endl
#define coutY cout<<"YES"<<endl
#define coutN cout<<"NO"<<endl
#define yn(x) cout<<(x?"Yes":"No")<<endl
#define YN(x) cout<<(x?"YES":"NO")<<endl
long long gcd(long long a,long long b){return b?gcd(b,a%b):a;}
long long lcm(long long a, long long b){return a/gcd(a,b)*b;}
const long long dx[8]={1,0,-1,0,1,-1,-1,1};
const long long dy[8]={0,1,0,-1,1,1,-1,-1};
const long long INF = 1e15;
const long long MOD = 1e9+7;

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout<<fixed<<setprecision(15);

    int n; cin >> n;
    vi a(n); rep(i,n) cin >> a[i];
    vi res;
    while(a.size()){
        bool can=false;
        for(int i=sz(a)-1; i>=0; i--){
            if(a[i]==(i+1)){
                res.pb(*(a.begin()+i));
                a.erase(a.begin()+i);
                can=true;
                break;
            }
        }
        if(can==false){
            cout<<-1<<endl; return 0;
        }
    }
    req(i,res.size())cout<<res[i]<<endl;
}


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

int main(void){
    int n, m;
    cin >> n >> m;
    
    vector<int> l(m), r(m);
    rep(i, m){
        cin >> l.at(i) >> r.at(i);
    }
    sort(l.begin(), l.end());
    sort(r.begin(), r.end());
    
    int ans = r.at(0)-l.at(m-1)+1;
    if(ans < 0){
        ans = 0;
    }

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

Measured memory_bytes: 1024
#include<stdio.h>
#include<math.h>
#define MOD 998244353
#define MAX 3001
#define MAX_DISTANCE 501
#define PRECISION 0.00000000001
#define INF 4000000000000000000
int main()
{
    int n,m,i;
    scanf("%d %d",&n,&m);
    int total=0;
    int inp;
    for(i=0;i<m;i++)
    {
        scanf("%d",&inp);
        total=total+inp;
    }
    if(total>n)
    {
        printf("-1");
    }
    else
    {
        printf("%d",n-total);
    }
    return 0;
}


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

#define MAX_N 100000
int A[MAX_N];

int main() {
    int sum, a, H, N;
    scanf("%d %d", &H, &N);

    sum = 0;
    for (int i = 0; i < N; i++) {
        scanf("%d", &a);
        sum += a;
    }
    if (sum >= H) {
        printf("Yes\n");
    } else {
        printf("No\n");
    }
    return 0;
}

Measured memory_bytes: 256
#! /Library/Frameworks/Python.framework/Versions/3.7/bin/python3
A, B, C, X, Y = map(int, input().split())
if A + B >= C * 2:  # A1枚B1枚買うよりABピザ2枚買うほうがが安いので、まずは共通枚数分をなるべく多く買う
    if (X > Y and A > C * 2) or (X < Y and B > C * 2):  # 買いきった余りをCで買うか、AもしくはBで買うかの判定
        print(str(max(X, Y) * C * 2))
    else:
        if X >= Y:
            print(str(Y * C * 2 + (X - Y) * A))
        else:
            print(str(X * C * 2 + (Y - X) * B))
else:  # ABピザが高いので、個別に買う
    print(str(A*X+B*Y))


Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
const int N = 310,MOD = 1e9+7;
int f[N][N][N],l[N],r[N],x[N],ans;
vector<int> p[N];
bool check(int i,int j,int k)
{
	vector<int>::iterator it;
	for(it = p[i].begin();it != p[i].end();++ it)
	{
		int cnt=1;
		if(j >= l[*it]) ++ cnt;
		if(k >= l[*it]) ++ cnt;
		if(cnt != x[*it]) return false;
	}
	return true;
}
int main()
{
	int n,m;
	scanf("%d %d",&n,&m);
	for(int i = 1;i <= m;++ i)
	{
		scanf("%d %d %d",&l[i],&r[i],&x[i]);
		p[r[i]].push_back(i);
	}
	if(check(1,0,0)) f[1][0][0] = 1;
	for(int i = 2;i <= n;++ i)
	{
		for(int j = 0;j <= i - 1;++ j)
		{
			for(int k = 0; k <= j;++ k)
			{
				if(j == k && j) continue;
				if(!check(i,j,k)) continue;
				f[i][j][k]=f[i - 1][j][k];
				if(j == i - 1||k == i - 1)
				{
					for(int l = 0 ;l <= i-1;++ l)
					{
						if(l < k) f[i][j][k] = (f[i][j][k] + f[j][k][l]) % MOD;
						else f[i][j][k] = (f[i][j][k] + f[j][l][k]) % MOD;
					}
				}
			}
		}
	}
	for(int i = 0;i < n;++ i)
		for(int j = 0;j < i;++ j)
			ans = (ans + f[n][i][j]) % MOD;
	ans = 6ll * ans % MOD;
	ans = (ans + f[n][0][0] * 3) % MOD;
	cout << ans;
}

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

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

main() {
  int N, K; cin >> N >> K;
  vector<int> a(N); for (int i = 0; i < N; i++) cin >> a[i];
  int g = a[0];
  for (int i = 1; i < N; i++) {
    g = gcd(g, a[i]);
  }
  sort(a.begin(), a.end(), greater<int>());
  cout << ( (K % g == 0 && K <= a[0]) ? "POSSIBLE" : "IMPOSSIBLE" ) << endl;
}

Measured memory_bytes: 768
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5+1, INF = 1e9+1;

int n, a[N][3], dp[N][3];
int main() {
  cin >> n;
  for(int i = 0; i < n; i++) {
    for(int j = 0; j < 3; j++) cin >> a[i][j];
  }
  for(int j = 0; j < 3; j++) dp[0][j] = a[0][j];
  for(int i = 1; i < n; i++) {
    for(int j = 0; j < 3; j++) {
      for(int k = 0; k < 3; k++) if(k != j) {
        dp[i][j] = max(dp[i-1][k] + a[i][j], dp[i][j]);
      }
    }
  }
  cout << max(max(dp[n-1][0], dp[n-1][1]), dp[n-1][2]);
}


Measured memory_bytes: 2560
#include <iostream>
#include<vector>

using namespace std;


vector<int> ans[1000];

int main() {
  int n;
  cin >> n;
  bool ok = false;
  int r,c;
 
      
  for(int i = 1; i * (i + 1)/ 2 < 200005; i++) {
    if(i * (i + 1) / 2 == n) {
      r = i;
      c = r + 1;
      ok = true;
      break;
    }
  }

  if(!ok) {
    cout << "No" << endl;
    return 0;
  }

  int num = 1;
  for(int i = 0; i < c; i++) {
    int tmp = num;
    for(int j = i; j < r; j++) {
      ans[i].push_back(num++);
    }
    for(int k = i + 1; k < c; k++) {
      ans[k].push_back(tmp++);
    }
  }
  cout << "Yes" << endl;
  cout << c << endl;
  for(int i = 0; i < c; i++) {
    cout << r;
    for(int j = 0; j < r; j++) {
      cout <<" "<<ans[i][j];
    }
    cout << endl;
  }
}
  
  
  
    
    


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

int main() {
    string S;
    cin >> S;
    bool ans = false;
    rep(i,2){
        if(S[i]!=S[i+1]){
            ans = true;
        }
    }
    if(ans)cout << "Yes" << endl;
    else cout << "No" << endl;

    return 0;
}

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

int main(){
  int n; cin >> n;
  vector<double> x(n), dist(n);
  for(int i=0; i<n; i++)
    cin >> x[i];
  
  for(int i=0; i<n; i++){
    double yi; cin >> yi;
    dist[i] = abs(x[i]-yi);
  }

  printf("%0.8f\n", accumulate(dist.begin(), dist.end(),0.0));

  double sum = 0;
  for(int i=0; i<n; i++){
    sum += dist[i] * dist[i];
  }
  printf("%0.8f\n", sqrt(sum));
   
  sum = 0; 
  for(int i=0; i<n; i++){
    sum += dist[i] * dist[i] * dist[i];
  }
  printf("%0.8f\n", cbrt(sum));
  
  printf("%0.8f\n", *max_element(dist.begin(), dist.end()));

  return 0;
}

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

int A[1000001] = { 0 };

int minN( int n, int c )
{
	if( A[n] >= 1 )
	{
		return c;
	}
	else
	{
		A[n]++;
		c++;
		minN( ( ( n % 2 ) ? 3 * n + 1 : n / 2 ), c );
	}
}

int main()
{
	int s;
	cin >> s;
	cout << minN( s, 1 ) << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define M 505
#define ll long long
int a[M],ans=0,n,k,b[M];
void solve(int x){
	ll tp=0,sum=0;
	for(int i=1;i<=n;++i){
		sum+=a[i]-a[i]/x*x;
		b[i]=(a[i]/x+1)*x-a[i];
	}
	sort(b+1,b+n+1);
	ll h=sum/x,pd=0;
	for(int i=1;i<=h;++i)pd+=b[i];
	if(sum-sum/x*x+pd<=k)ans=max(ans,x);
	else if(h<n&&pd+b[h+1]<=k)ans=max(ans,x);
}
int main(){
	int sum=0;
	scanf("%d%d",&n,&k);
	for(int i=1;i<=n;++i)scanf("%d",&a[i]);
	for(int i=1;i<=n;++i)sum+=a[i];
	for(int i=1;i*i<=sum;++i)if(sum%i==0){
		solve(i);
		solve(sum/i);
	}
	printf("%d",ans);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;
typedef long double ld;

const ll mod = 1e9+7;
const ld error = 2e-6;
const ld PI = acosl(-1); //const ld PI = acosl(-1)

#define FASTIO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define eq(x, y) (fabs((x)-(y))<error)
#define bt(i) (1LL<<(i))

#define debug(x) cerr<<#x<<" = "<<(x)<<"\n"
#define hoise cerr<<"hoise - "<<__LINE__<<"\n"
#define tham getchar()
mt19937 rng((unsigned)chrono::system_clock::now().time_since_epoch().count()); //mt199937_64 for ll
//mt19937 rng(199);

inline ll MOD(ll x, ll m = mod){
    ll y = x % m;
    return (y >= 0) ? y: y+m;
}

const int inf = 1e9;
const ll infl = 1061109567;
const int nmax = 200+10;

#define contents(T, c) ostream_iterator<T>(cerr, c)
///===========================================  template  =======================================================

ll sys[nmax];
int ind[nmax];

int gaussian(int m){
    int r = 0;
    for(int c = 0; c < 64; c++){
        int p = -1;
        for(int i = r; i<m; i++){
            if(bt(c)&sys[i]){
                p = i;
                break;
            }
        }
        if(p == -1) continue;
        if(p != r){
            swap(sys[p], sys[r]);
            swap(ind[p], ind[r]);
        }
        for(int i = 0; i<m; i++){
            if(i == r || !(bt(c)&sys[i])) continue;
            sys[i] ^= sys[r];
        }
        r++;
    }
    return r;
}

int main(){
    FASTIO;

    int tc;
    cin>>tc;
    for(int cs = 1; cs <= tc; cs++){
        int n;
        cin>>n;
        vector<ll> input(n);
        for(int i = 0; i<n; i++) cin>>input[i];
        string s;
        cin>>s;

        reverse(s.begin(), s.end());
        reverse(input.begin(), input.end());

        int m = 0;
        int r = 0;
        bool ok = true;
        for(int i = 0; i<n; i++){
            sys[m++] = input[i];
            int r2 = gaussian(m);
            if(r2 != r && s[i] == '1') ok = false;
            r = r2;
            m = r;
        }

        if(!ok){
            cout<<1<<"\n";
        }
        else{
            cout<<0<<"\n";
        }
    }
    return 0;
}
/*
1
6
2 3 8 5 6 7
111000
*/


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

using namespace std;

int main()
{
    int sx,sy,dx,dy;
    scanf("%d%d%d%d",&sx,&sy,&dx,&dy);
    int x=(dx-sx);
    int y =(dy-sy);
    for(int i =0;i<x;i++)printf("R");
    for(int i=0;i<y;i++)printf("U");

    for(int i =0;i<x;i++)printf("L");
    for(int i=0;i<y;i++)printf("D");
    printf("D");
    for(int i=0;i<x+1;i++)printf("R");
    for(int i =0;i<y+1;i++)printf("U");
    printf("L");
    printf("U");
    for(int i=0;i<x+1;i++)printf("L");
    for(int i =0;i<y+1;i++)printf("D");
    printf("R");

    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <sstream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>

using namespace std;

int main()
{
	//ifstream fin("ALDS1_1_C_in1.txt");

	int n;
	cin >> n;
	cin.ignore();

	vector<int> v;

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

	int count = 0;
	for (int i = 0; i < v.size(); i++)
	{
		bool isPrime = true;
		for (int j = 2; j <= sqrt(v[i]); j++)
		{
			if (v[i] % j == 0)
			{
				isPrime = false;
				break;
			}
		}
		if (isPrime == true)
			count++;
	}
	cout << count << endl;

	return 0;
}

Measured memory_bytes: 1320
#include <iostream>

using namespace std;


int main(){
	int a, b, c;
	cin>>a>>b>>c;
	int p = a + b;
	for(int t = 0; t < p; t++){
		if((60*t%p+c%p)%p<= a){
			cout<<60*t+c<<endl;
			return 0;
		}
	}
	cout<<-1<<endl;
}

Measured memory_bytes: 1164
#include<bits/stdc++.h>
using namespace std;
#define fastio ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
int main(){
	#ifndef ONLINE_JUDGE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	fastio
	string s,t;
	cin>>s>>t;
	t.pop_back();
	if(s==t) cout<<"Yes";
	else cout<<"No";
	return 0;
}


Measured memory_bytes: 3660
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#define lol(i,n) for(int i=0;i<n;i++)
#define mod 1000000007
typedef long long ll;
using namespace std;
#define N 5010
#define M 210
ll a[M][N],A[M][N],b[N],B[N],n,m;
int main(){
    cin>>n>>m;
    lol(i,n-1){
	cin>>B[i];
	b[i+2]=B[i];
    }
    lol(i,n)lol(j,m)cin>>a[j][i];
    lol(i,m){
	A[i][0]=0;
	ll maxi=0;
	lol(j,n){
	    maxi=max(maxi,a[i][j]);
	    A[i][j+1]=maxi;
	}
    }
    b[0]=b[1]=0;
    lol(i,n)b[i+1]+=b[i];
    lol(i,n+1){
	b[i]=-b[i];
	lol(j,m)b[i]+=A[j][i];
	//cout<<b[i]<<" ";
    }//cout<<endl;
    ll ans=0;
 
    lol(i,n){
	ll gre=-1;
	for(int j=i+1;j<=n;j++){
	    gre=max(gre,b[j]);
	}
	ans=max(ans,gre);
	//cout<<gre<<endl;
	lol(j,m){
	    ll maxi=-1;
	    for(int k=i+1;k<n;k++){
		if(a[j][k]>=a[j][i])break;
		maxi=max(maxi,a[j][k]);
		b[k+1]-=A[j][k+1];
		A[j][k+1]=maxi;
		b[k+1]+=A[j][k+1];
	    }
	}
	for(int j=i+1;j<=n;j++)b[j]+=B[i];
	
    }
    cout<<ans<<endl;
    return 0;
}


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

void up_down(int w) {
  for(int i=0;i<w+2;i++){
    cout<<'#';
  }
  cout<<endl;
}

int main() {
  int n,m;
  cin>>n>>m;
  vector<int> s(n,0);
  for(int i=0;i<m;i++){
    int p1,p2;
    cin>>p1>>p2;
    s.at(p1-1)+=1;
    s.at(p2-1)+=1;
  }
  for(int i=0;i<n;i++){
    cout<<s.at(i)<<endl;
  }
}

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

int main(void) {
    int n;
    cin >> n;
    int *w = new int[n];

    for(int i = 0; i < n; ++i) {
        cin >> w[i];
    }

    int *dp = new int[n];
    int sum = 0;

    for(int u = 0; u < n; ++u) {
        sum += w[u];
        dp[u] = sum;
    }

    // sum = s1 + s2
    // s2 = sum - s1
    // diff = abs(s1-s2) = abs(s1 - sum + s1)
    int min_diff = INT32_MAX;
    for(int di = 0; di < n; ++di) {
        if (min_diff > abs(2*dp[di] - sum)) {
            min_diff = abs(2*dp[di] - sum);
        }
    }

    cout << min_diff << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
 
 
const int mod = 1e9+7;
int fact[2020];
 
int power(int a, int b){
    int ans = 1;
    while(b){
        if (b&1){
            ans = (ans*a)%mod;
        }
        a = (a*a)%mod;
        b>>=1;
    }
    return ans;
}
 
int inv(int a){
    return power(a, mod-2);
}
 
int ncr(int n, int r){
    int denom = fact[r] * fact[n-r] %mod;
    denom = inv(denom);
    return (fact[n]*denom)%mod;
}
 
 
signed main(){
    ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
 
    int n;
    cin>>n;
 
    if(n==3){
        cout<<1<<endl;
        return 0;
    }
 
    fact[0] = 1;
    for (int i=1; i<=n; i++){
        fact[i] = (i*fact[i-1])%mod;
    }
 
    //n-1cr-1
    //n-1-2*icri-1
 
    int ans = 0;
    for (int i=1; (n-1-2*i)>0; i++){
        if (n-1-2*i<i-1) break;
        ans = (ans + ncr(n-1-2*i, i-1))%mod;
    }
    cout<<ans<<endl;
 
 
 
    return 0;
}

Measured memory_bytes: 3664
#include<iostream>
#include<cstdlib>
#include<algorithm>

using namespace std;

const int MAX_N = 100000;

int main(void) {
  int n, start;
  int city[MAX_N];

  cin >> n;
  cin >> start;

  for (int i = 0; i < n; i++)
    cin >> city[i];

  int diff[MAX_N];
  int minDiff = 1000000000;

  for (int i = 0; i < n; i++) {
    diff[i] = abs(start - city[i]);
    minDiff = min(minDiff, diff[i]);
  }

  for (int d = minDiff; d > 0; d--) {
    if (minDiff % d != 0)
      continue;

    bool isCleared = true;

    for (int i = 0; i < n; i++) {
      if (diff[i] % d != 0) {
        isCleared = false;
        break;
      }
    }

    if (isCleared) {
      cout << d << endl;
      return 0;
    }
  }

  return 0;
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(), (x).end()

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

    // start
    int r;
    cin >> r;
    if (r < 1200)
        cout << "ABC" << endl;
    else if (r < 2800)
        cout << "ARC" << endl;
    else
        cout << "AGC" << endl;
    // end

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<string>
#include<algorithm>
#include<math.h>
using namespace std;

const int N=3e5+5;
int n;
char s[N];

int main()
{
	int i,cnt=0;
	long long ans=0;
	scanf("%s",s+1);
	n=strlen(s+1);
	for(i=n;i;--i)
		if(s[i]=='W') ++cnt;
		else ans+=cnt;
	printf("%lld\n",ans);
	return 0;
}

Measured memory_bytes: 384
{-# LANGUAGE BangPatterns #-}
import Control.Monad
import Data.Maybe
import Debug.Trace
import Data.List
import qualified Data.Map.Strict as Map
import qualified Data.IntMap.Strict as IntMap
import qualified Data.Set as Set
import qualified Data.IntSet as IntSet
import Data.Functor
import Data.Array
-- import Data.Array.Unboxed
import Control.Monad.ST
import Data.Array.ST
import qualified Data.ByteString.Char8 as B
import Data.Maybe (fromJust)

readInt = fst . fromJust . B.readInt
readInts = map (fst . fromJust . B.readInt) . B.words <$> B.getLine :: IO [Int]
readIntegers = map (fst . fromJust . B.readInteger) . B.words <$> B.getLine :: IO [Integer]
readVInts = map (fst . fromJust . B.readInt) . B.lines <$> B.getContents

main :: IO ()
main = do
  n <- readLn :: IO Int
  -- as <- replicateM n $ readLn :: IO [Int]
  as <- readVInts
  print $ solve''' n as


solve''' n (a:as) = go (IntMap.singleton a 1) (IntSet.singleton a) as
  where
    go :: IntMap.IntMap Int -> IntSet.IntSet -> [Int] -> Int
    go mp _ [] = sum $ IntMap.elems mp
    go mp bs (a:as)
      | a <= mn = go (IntMap.insertWith (+) a 1 mp) (IntSet.insert a bs) as
      | otherwise = go (IntMap.insertWith (+) a 1 newmp) (IntSet.insert a newbs) as
      where
        mn = fromJust $ IntSet.lookupGT (-1) bs
        m = fromJust $ IntSet.lookupLT a bs
        newmp = IntMap.adjust (subtract 1) m mp
        newbs = if newmp IntMap.! m > 0 
          then bs
          else IntSet.delete m bs


Measured memory_bytes: 19836
#include<stdio.h>
main(){
  int n,a,i,max,min;
  double sum;
  scanf("%d",&n);
  scanf("%d",&max);
  min=max;
  sum=max;
  for(i=1;i<n;i++){
    scanf("%d",&a);
    if(a>max) max=a;
    if(a<min) min=a;
    sum=sum+a;
  }
  printf("%d %d %.0f\n",min,max,sum);
  return 0;
}

Measured memory_bytes: 632
#include <bits/stdc++.h>
using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<string> vs;
typedef long long int ll;
typedef unsigned long long int ull;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<pii> vpii;
typedef vector<vpii> vvpii;

inline bool valid(int x, int n) {
    return 0 <= x && x < n;
}

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

template <typename T>
inline T pop(queue<T>& q) {
    T front = q.front();
    q.pop();
    return front;
}

template <typename T>
inline T gcd(T a, T b) {
    for (; b; a %= b, swap(a, b));
    return a; 
}

template <typename T>
tuple<T, T, T> xgcd(T a, T b) {
    if (b == 0) return {1, 0, a};
    T x, y, g;
    tie(x, y, g) = xgcd(b, a%b);
    return {y, x-(a/b)*y, g};
}

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    int N, K; cin >> K >> N;
    vb D(K+1);

    while (N--) {
        int d; cin >> d;
        while (d--) {
            int a; cin >> a;
            D[a] = 1;
        }
    }

    int rst = 0;
    for (int i = 1; i <= K; i++) {
        if (D[i]) continue;
        rst++;
    }

    cout << rst;
}

Measured memory_bytes: 3660
#include <bits/stdc++.h>
#define vi vector<int>
#define ll long long
#define pb push_back
#define ii pair<int, int>
#define MAX int(1e5)+1
#define qi queue<int>
#define si stack<int>
#define mii map<int, int>
#define msi map<string, int>
#define fr first
#define sc second
#define all(x) x.begin(), x.end()
using namespace std;

int max(int a, int b, int c) {
	return max(a, max(b, c));
}

int arr[MAX][3], dp[MAX][3];

int n;

int main(int argc, char** argv) {
	ios::sync_with_stdio(0);
	cin.tie(0);
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	
	cin >> n;

	for (int i = 0; i < n; i++)
		cin >> arr[i][0] >> arr[i][1] >> arr[i][2];

	dp[0][0] = arr[0][0];
	dp[0][1] = arr[0][1];
	dp[0][2] = arr[0][2];

	for (int i = 1; i < n; i++) {
		dp[i][0] = arr[i][0] + max(dp[i-1][1], dp[i-1][2]);
		dp[i][1] = arr[i][1] + max(dp[i-1][0], dp[i-1][2]);
		dp[i][2] = arr[i][2] + max(dp[i-1][0], dp[i-1][1]);
	}

	cout << max(dp[n-1][0], dp[n-1][1], dp[n-1][2]);

	return 0;
}






Measured memory_bytes: 2560
#include<stdio.h>

#define MAX 500000
#define SENTINEL 1000000001

int gS[MAX+1],gn,cnt;
int gL[ (MAX/2)+1 ],gR[ (MAX/2)+1 ];

void merge( int left, int mid, int right )
{
	int i,j,k;
	int n1=mid-left;
	int n2=right-mid;

	for( i=0; i<n1; i++ ) {
    	gL[i]=gS[ left+i ];
    }
	for( i=0; i<n2; i++ ) {
    	gR[i]=gS[ mid+i ];
    }
    
	gL[n1]=gR[n2]=SENTINEL;
	i=j=0;
	for( k=left; k<right; k++ ) {
		cnt++;
		if( gL[i] <= gR[j] ) {
			gS[k]=gL[i++];
		} else {
			gS[k]=gR[j++];
		}
    }
	return;
}

void mergeSort( int left, int right )
{	
	int mid;
	if( left+1 < right ) {
		mid=(left+right)/2;
		mergeSort( left, mid );
		mergeSort( mid, right );
		merge( left, mid, right );
	}
	
	return;
}


int main( void ) 
{
    scanf( "%d", &gn );
    
	int i;
	for( i=0; i<gn; i++ ) {
		scanf( "%d", &gS[i] );
	}
	cnt=0;
	mergeSort( 0, gn );

	for( i=0; i<gn; i++ ) {
		printf("%d", gS[i] );
		if( i < gn-1 ) { printf( " " ); }
	}
	printf( "\n%d\n", cnt );
	
    return 0;
}

Measured memory_bytes: 4508
#include <bits/stdc++.h>
using namespace std;
 
#define   ipr         	pair<int, int>
#define   pb            push_back
#define   ff            first
#define   ss            second
#define   fr(i, j, k)   for (int i = j; i < k; i++)
#define   rf(i, j, k)   for (int i = j; i >= k;i--)
#define   int           long long
#define   ll 			unsigned long long
#define   ld            long double
#define   all(x)        x.begin(), x.end()
#define   rall(x)       x.rbegin(),x.rend()
#define   mp            make_pair
#define   inf           INT_MAX
#define   read_file();	freopen("input.txt", "r", stdin);	freopen("output.txt", "w", stdout);
#define   IOS           std::ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
 
const int Maxn  =  10000;
const ld  pi   =  acos(-1);
const int mod =  1000000007;
 
 
template<class T> ostream& operator <<(ostream &out,vector<T> &A){for(auto x:A) out<<x;return out;}
template<class T> ostream& operator <<(ostream &out,set<T> &A){for(auto x:A) out<<x<<" ";return out;}
template <class T1,class T2>T1 powr(T1 a,T2 b){T1 res = 1;fr(i,1,b+1)res = res*a;return res;}
int roundUp(int numToRound, int multiple)
{
 if(multiple == 0)
 {
  return numToRound;
 }

 int roundDown = ( (int) (numToRound) / multiple) * multiple;
 int roundUp = roundDown + multiple; 
 int roundCalc = roundUp;
 return (roundCalc);
}
 

 
int32_t main(){IOS
int k,n;
cin>>k>>n;
vector<int>h(n);
fr(i,0,n)cin>>h[i];
sort(h.begin(),h.end());

vector<int>l(n);

fr(i,0,n){
l[i]=h[n-1]-h[i]+(i-1>=0?(k-h[n-1])+h[i-1]:0);
}
sort(l.begin(),l.end());
cout<<l[0];
}

Measured memory_bytes: 3328
#include <bits/stdc++.h>
using namespace std;
int main(void)
{
  int p,q;
  cin>>p>>q;
  if(p==q || p>q)
  {
    int x=0;
    for(int i=0;i<p;i++)
    {
      x = (x*10)+q; 
    }
    cout<<x<<endl;
  }
  else
  {
    int x=0;
    for(int i=0;i<q;i++)
    {
      x=(x*10)+p;
    }
    cout<<x<<endl;
  }
}

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

int main() {
  long k,n;
  cin >> k >> n;
  vector <long> arr(n);
  long t1;
  cin >> t1;
  long t2,t3;
  t2 = t1;
  for(long i = 1; i < n; i++){
    cin >> t3;
    arr[i] = t2+k - t3;
    t2 = t3;
  }
  arr[0] = t3 - t1;
  sort(arr.begin(),arr.end());
  cout << arr[0];
}

Measured memory_bytes: 1792
#pragma GCC optimize("O3")
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<functional>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
using namespace std;
#define MOD 1000000007
#define f(i,n) for(int i=0;i<int(n);i++)
#define N 200000


int main() {
	int n;
	long long a, b, c, s;
	scanf("%d", &n);
	a = 1000;
	b = 0;
	c = 1000;
	f(i, n) {
		scanf("%lld", &s);
		a = max(a, b * s + c);
		b = a / s;
		c = a % s;
	}
	printf("%lld\n", a);

	return 0;
}

Measured memory_bytes: 1736
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;
const int MOD = 1000000007;
const int MOD2 = 998244353;


int main(){
    string s;
    cin >> s;
    cout << s.substr(0,s.size()-8) << endl;
    return 0;
}


Measured memory_bytes: 3560
#include<iostream>
#include<vector>
#include<cmath>
#include <numeric>
#include<climits>
#include<cfloat>
#include<string>
#include<algorithm>
#include<map>
#include<utility>
#include<cstdio>

using namespace std;
typedef pair<int,bool> Pair;

int main(){

	long long N;
	long long H[100001];
	long long DP[100001];
    long long ans = -1;
	long long temp;
	bool flg = true;
	long long i,j;

	cin >> N;
	for(i = 0;i < N;++i) cin >> H[i];
	for(i = 0;i < N;++i) DP[i] = 0;
	for(i = 0;i < N - 1;++i) if (H[i] >= H[i+1]) DP[i+1] = DP[i] + 1;
	for(i = 0;i < N;++i) if(DP[i] > ans) ans = DP[i];
	cout << ans << endl;

return 0;

}


Measured memory_bytes: 1792
#include <stdio.h>
#include <string.h>
#include <limits.h>
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <queue>

typedef unsigned long long ULLONG;
typedef long long LLONG;
static const LLONG MOD_NUM = 1000000007;

template<class _T> static void getint(_T& a) {
	const char* fmt = " %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld";
	}

	if (scanf(fmt, &a) < 0) {
		printf("g1int Error\n");
	}
}
template<class _T> static void getint(_T& a, _T& b) {
	const char* fmt = " %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld";
	}

	if (scanf(fmt, &a, &b) < 0) {
		printf("g2int Error\n");
	}
}
template<class _T> static void getint(_T& a, _T& b, _T& c) {
	const char* fmt = " %d %d %d";
	if (sizeof(_T) == sizeof(long long)) {
		fmt = " %lld %lld %lld";
	}

	if (scanf(fmt, &a, &b, &c) < 0) {
		printf("g3int Error\n");
	}
}

static void Tenk1PBC2019C();

#if 1
int main()
{
	Tenk1PBC2019C();
	fflush(stdout);
	return 0;
}
#endif

static void Tenk1PBC2019C()
{
	int N;
	getint(N);

	std::string orgs;
	std::cin >> orgs;

	//	まず白の数を数える
	int whiteCount = 0;
	for (int i = 0; i < N; i++) {
		if (orgs[i] != '#') {
			whiteCount++;
		}
	}

	int ans = whiteCount;
	int white = 0, black = 0;
	for (int i = 0; i < N; i++) {
		if (orgs[i] == '#') {
			black++;
		}
		else {
			white++;
		}
		
		ans = std::min(ans, black + whiteCount - white);
	}

	printf("%d\n", ans);
}


Measured memory_bytes: 640
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
	
		Scanner in = new Scanner(System.in);
		
		int a = in.nextInt(),b=in.nextInt();
		int k = 0;
		
		int max=Math.max(a, b);
		for(int i = 1;i<=max;i++) {
			if(Math.abs(a-i) == Math.abs(b-i)) {
				k = i;
			}
		}
		
		if(k==0) {
			System.out.println("IMPOSSIBLE");
		}
		else {
			System.out.println(k);
		}

	}

}


Measured memory_bytes: 27024
ans = []

def paint(h, w):
    a = []
    for i in range(h):
        if i == 0 or i == h - 1:
            a.append("#" * w)
        else:
            a.append("#" + "." * (w - 2) + "#")
    ans.append("\n".join(a))

while True:
    H, W = map(int, input().split())
    if H == W == 0: break

    paint(H, W)

print(("\n" * 2).join(ans), "\n", sep = "")


Measured memory_bytes: 5708
#include <string>
#include <iostream>
#include <vector>

int main() {
    int n, k, q;
    std::cin >> n >> k >> q;
    std::vector<int> answers;

    for (int i = 0; i < q; i++) {
        int temp;
        std::cin >> temp;
        answers.push_back(temp);
    }

    std::vector<int> points(n, -q);
    for (int a : answers) {
        points[a-1] = points[a-1] + 1;
    }

    for (int p : points) {
        std::cout << (p > -k ? "Yes" : "No") << std::endl;
    }

    return 0;
}


Measured memory_bytes: 1528
import java.util.Scanner;

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

			boolean[] array = new boolean[8];
			int fullColor = 0;

			cin.nextInt();

			while (cin.hasNext()) {
				int rate = cin.nextInt();

				if (rate <= 399) {
					array[0] = true;
				} else if (rate <= 799) {
					array[1] = true;
				} else if (rate <= 1199) {
					array[2] = true;
				} else if (rate <= 1599) {
					array[3] = true;
				} else if (rate <= 1999) {
					array[4] = true;
				} else if (rate <= 2399) {
					array[5] = true;
				} else if (rate <= 2799) {
					array[6] = true;
				} else if (rate <= 3199) {
					array[7] = true;
				} else {
					fullColor++;
				}
			}

			int min = 0;
			int max = 0;

			for (boolean b : array) {
				if (b) {
					min++;
				}
			}

			max = min + fullColor;

			if (min == 0) {
				min = 1;
			}
			System.out.println(min + " " + max);
		} finally {
		}
	}

}


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

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

    int N;

    cin >> N;

    vector<int> B(N-1);

    rep(i, N-1) cin >> B[i];

    vector<int> A(N);
    A.emplace_back(B[0]);

    for(int i = 1; i < N-1; ++i)
    {
        A.emplace_back(min(B[i], B[i-1]));
    }

    A.emplace_back(max(A[N-2], B[N-2]));

    cout << accumulate(A.begin(),A.end(), 0);
    return 0;
}

Measured memory_bytes: 256
void main()
{
    long[] tmp = rdRow;
    long n = tmp[0], m = tmp[1];

    writeln(n == m ? "Yes" : "No");
}

T rdElem(T = long)()
{
    //import std.stdio : readln;
    //import std.string : chomp;
    //import std.conv : to;

    return readln.chomp.to!T;
}

alias rdStr = rdElem!string;

dchar[] rdDchar()
{
    //import std.conv : to;

    return rdStr.to!(dchar[]);
}

T[] rdRow(T = long)()
{
    //import std.stdio : readln;
    //import std.array : split;
    //import std.conv : to;

    return readln.split.to!(T[]);
}

T[] rdCol(T = long)(long col)
{
    //import std.range : iota;
    //import std.algorithm : map;
    //import std.array : array;

    return iota(col).map!(x => rdElem!T).array;
}

T[][] rdMat(T = long)(long col)
{
    //import std.range : iota;
    //import std.algorithm : map;
    //import std.array : array;

    return iota(col).map!(x => rdRow!T).array;
}

void wrMat(T = long)(T[][] mat)
{
    //import std.stdio : write, writeln;

    foreach (row; mat)
    {
        foreach (j, compo; row)
        {
            compo.write;
            if (j == row.length - 1) writeln;
            else " ".write;
        }
    }
}

import std.stdio;
import std.string;
import std.array;
import std.conv;
import std.algorithm;
import std.range;
import std.math;
import std.numeric;
import std.container;
import std.typecons;
import std.ascii;
import std.uni;

Measured memory_bytes: 256
/*
 * https://atcoder.jp/contests/abc157/tasks/abc157_d
 */
#include <bits/stdc++.h>
 
using namespace std;

// ショートハンド
// #define ll intに変えればメモリ節約
#define ll int

/* 
 * ループ系のマクロ
 * `REP(i, 10) { cout << i; }`のように、変数名,回数で動く
 */
#define REPS(i, a, n) for (ll i = (a); i < (ll)(n); ++i)
#define REP(i, n) REPS(i, 0, n)
#define RREP(i, n) REPS(i, 1, n + 1)
#define DEPS(i, a, n) for (ll i = (a); i >= (ll)(n); --i)
#define DEP(i, n) DEPS(i, n, 0)
#define EACH(i, n) for (auto&& i : n)

/*
 * 正規表現系
 */
#define MATCH(_str, _ptn) regex_match(_str, regex(_ptn))
#define REPLACE(_str, _ptn, _replacement) regex_replace(_str, regex(_ptn), _replacement)

const int MOD = 1e9 + 7;

struct UnionFind {
    ll n;
    vector<ll> par,cnt;

    UnionFind(ll N) : par(N) {
        n = N;
        REP(i,n) par[i] = i;
    }

    ll root(ll x) {
        ll depth = 0, tmp = x;
        while(par[x] != x) {
            x = par[x];
            if(depth++ == 50) {
                tmp = x;
            }
        }
        if(depth > 100) {
            par[tmp] = x;
        }
        return x;
    }

    void unite(ll x, ll y) {
        ll rx = root(x);
        ll ry = root(y);
        if (rx == ry) return;
        par[rx] = ry;
    }

    bool same(ll x, ll y) {
        ll rx = root(x);
        ll ry = root(y);
        return rx == ry;
    }

    void clean() {
        cnt.assign(n, 0);
        REP(i,n) {
            par[i] = root(i);
            cnt[par[i]]++;
        };
    }

    // 実行前にclean必須！
    ll count(ll x) {
        return cnt[root(x)];
    }
};

ll n,m,k;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin >> n >> m >> k;

    UnionFind unionFind(n);
    vector<ll> blocks(n, 1);
    REP(i,m) {
        ll a,b;
        cin >> a >> b;
        a--;b--;
        unionFind.unite(a,b);
        blocks[a]++;
        blocks[b]++;
    }
    unionFind.clean();
    REP(i,k) {
        ll c,d;
        cin >> c >> d;
        c--;d--;
        if(unionFind.same(c,d)) {
            blocks[c]++;
            blocks[d]++;
        }
    }
    REP(i,n) {
        if(i > 0) cout << " ";
        cout << unionFind.count(i) - blocks[i];
    }
    return 0;
}

Measured memory_bytes: 2048