akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		char[] n = sc.next().toCharArray();
		int ans = 0;
		for (int i = 0; i < n.length; i++) {
			if (n[i] == '2') {
				ans++;
			}
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 23764
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <math.h>
#include <vector>
#include <set>

using namespace std;
typedef long long LL;
static const double EPS = 1e-9;

#define FOR(i,k,n) for (int i=(k); i<(int)(n); ++i)
#define REP(i,n) FOR(i,0,n) 
/*
const int dx[4] = {-1,0,0,0};
const int dy[4] = {0,-1,0,0};
const int dx2[4] = {-1,0,1,0};
const int dy2[4] = {0,1,0,-1};
*/
static const int dx[4] = {1,0,-1,0};
static const int dy[4] = {0,1,0,-1};
int main(void){
  int d = 0;
  /*
  int a[5][4];
  int b[4][5];
  */
  int m[9][9];
  int x=0,y=0;
  string tmp;
  /*
  for(int i=0; i<4; i++){
    for(int j=0; j<4; j++){
      c = getchar();
      a[i][j] = c - '0';
    }
    getchar();
    for(int j=0; j<5; j++){
      c = getchar();
      b[i][j] = c - '0';
    }
    getchar();
  }
  for(int j=0; j<4; j++){
    c = getchar();
    a[4][j] = c - '0';
  }
  */
  for(int i=0; i<9; i++){
    cin>>tmp;
    int jbegin;
    if(i%2){
      jbegin=0;
    }else{
      jbegin=1;
    }
    for(int j=jbegin,k=0; j<9; j+=2,k++){
      m[i][j] = tmp[k];
    }
  }
  for(int time=0; time>-1; time++){
    for(int r=-1; r<3; r++){
      //printf("%d",(d+r+4)%4);
      if(y+dy[(d+r+4)%4]>=0&&y+dy[(d+r+4)%4]<=8
          &&x+dx[(d+r+4)%4]>=0&&x+dx[(d+r+4)%4]<=8&&
          m[y+dy[(d+r+4)%4]][x+dx[(d+r+4)%4]]=='1'){
        d = (d+r+4)%4;
        x += 2*dx[d];
        y += 2*dy[d];
        break;
      }
    }
    char out;
    switch(d){
      case 0:
        out = 'R';
        break;
      case 1:
        out = 'D';
        break;
      case 2:
        out = 'L';
        break;
      case 3:
        out = 'U';
        break;
    }
    putchar(out);
    //printf("%d,%d\n",x,y);
    if(x==0&&y==0) break;
  }
  cout<<endl;
  return 0;
}

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

ll sum(ll n)
{
	ll s = 0;
	rep(i,n+1)
	{
		s += (ll)i;
	}
	return s;
}

int main()
{
	string S;
	cin >> S;
	ll uc = 0; ll dc = 0;
	ll ans = 0;
	rep(i,S.size())
	{
		if (S[i] == '<' && dc != 0)
		{
			ans += sum(max(uc,dc)) + sum(min(uc,dc) -1);
			uc = 1;
			dc = 0;
		}
		else if (S[i] == '<' && dc == 0)
		{
			uc++;
		}
		else
		{
			dc++;
		}
	}
	//cout << uc << " " << dc << endl;
	ans += sum(max(uc,dc)) + sum(min(uc,dc) -1);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 900
#include <bits/stdc++.h>
#define PI 3.1415926535897
using namespace std;
typedef long long ll;
const int INF = 1000000000;
const ll LINF = 1000000000000000000; //1e18
const double EPS = 1e-10;            //

int main(void)
{
    int N, K;
    cin >> N >> K;

    int ans = 1;
    for (int i = 0; i < N; i++)
    {
        if (ans < K)
        {
            ans *= 2;
        }
        else
        {
            ans += K;
        }
    }
    cout << ans << endl;

    return (0);
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <queue>
#include <set>
#include <numeric>
#include <cmath>
using namespace std;
typedef long long int ll;
#define all(x) x.begin(),x.end()
const ll mod = 1e9+7;
const ll INF = 1e9;
const ll MAXN = 1e9;
int main()
{
	int a,b,c,d,e,f;
	cin >>a>>b>>c>>d>>e>>f;


	double con = 0.0;
	int water = 0,sugar = 0;
	for(int w = 0; w <=30; w++){
		for(int x = 0; x <= 30; x++){
			for(int y = 0; y <= ceil((double)f/c); y++){
				for(int z = 0; z <= ceil((double)f/d); z++){
					int water_weight = a*w+b*x, sugar_weight = c*y+d*z;
					int total = 100*water_weight + sugar_weight;
					if(total <= f && sugar_weight <= water_weight*e){
						if(con < (double)sugar_weight/total){
							con = (double)sugar_weight/total;
							water = 100*water_weight;
							sugar = sugar_weight;
						}
					}
				}
			}
		}
	}
 	if(con == 0) water = 100*a;

	cout << water+sugar << " " << sugar << endl;

	return 0;
}

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

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}cerr << endl;}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 1000000007

typedef long long ll;
typedef pair<ll,ll> P;


ll A[222222];
ll B[222222];
ll v[222222];

int main(){
	
	ll L,N;cin >> L >> N;
	REP(i,N){
		cin >> v[i+1];
		A[i+1] = v[i+1];
		B[N-i] = L - v[i+1];
	}
	
	REP(i,N){
		A[i+1] += A[i];
		B[i+1] += B[i];
	}
	
	ll ans = 0;
	
	REP(i,N + 1){
		int a = i;
		int b = N - a;
		ll tmp = 0;
		if(a > b){
			tmp += 2 * B[b];
			tmp += 2 * (A[a] - A[a-b-1]) - (A[a] - A[a-1]);
			
			if(b > 0){
				ll hoge = 0;
				hoge += 2 * B[b] - (B[b] - B[b-1]);
				hoge += 2 * (A[a] - A[a-b]);
				tmp = max(tmp,hoge);
			}
		}
		else if(a == b){
			tmp += 2 * (A[a] + B[b]);
			tmp -= min((A[a] - A[a-1]),(B[b] - B[b-1]));
		}
		else {
			tmp += 2 * A[a];
			tmp += 2 * (B[b] - B[b-a-1]) - (B[b] - B[b-1]);
			
			if(a > 0){
				ll hoge = 0;
				hoge += 2 * A[a] - (A[a] - A[a-1]);
				hoge += 2 * (B[b] - B[b-a]);
				tmp = max(tmp,hoge);
			}
		}
		ans = max(ans,tmp);
	}
	
	cout << ans << endl;
	
	return 0;
}


Measured memory_bytes: 5120
#include <iostream>
#include <cmath>

using namespace std;

int main() {
  int x1, y1, x2, y2, x3, y3, x4, y4;
  cin >> x1 >> y1 >> x2 >> y2;
  x4 = -(y2-y1) + x1;
  y4 = (x2-x1) + y1;
  x3 = -(y1-y4) + x4;
  y3 = (x1-x4) + y4;

  // cout << "(x_3, y_3) = (" << x3 << ", " << y3 << ")" << endl;
  // cout << "(x_4, y_4) = (" << x4 << ", " << y4 << ")" << endl;
  cout << x3 << " " << y3 << " " << x4 << " " << y4 << endl;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <queue>
#include <stack>
#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 mem( f, x ) memset( f, x, sizeof( f ) )
#define ll long long
#define pii pair<int, int>
#define fi first
#define se second
#define MOD 1000000007
#define INF 0x3f3f3f3f
#define e 2.71828
using namespace std;
const int N = 105;
const int M = 1e6+5;
const int MAX = 5;
const ll inv = 500000004;
const double g = 9.80;
const double PI = acos( -1.0 );
ll a[N], b[N], x, y, m, n;

int main( ){
    while( scanf( "%lld %lld %lld %lld", &n, &m, &x, &y ) != EOF ){
        ll mi = INF, ma = -INF;
        rep( i, 1, n + 1 ){
            scanf( "%lld", a + i );
            if( ma < a[i] ) ma = a[i];
        }
        rep( i, 1, m + 1 ){
            scanf( "%lld", b + i );
            if( mi > b[i] ) mi = b[i];
        }
        //cout << "error" << endl;
        //bool flag = 0;
        if( ma >= mi || x >= y ){
            printf( "War\n" );
            //cout << "ok" << endl;
            continue;
        }
        ma = max( ma, x ), mi = min( mi, y );
        if( ma < mi )
            printf( "No War\n" );
        else
            printf( "War\n" );
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(int (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(int (i)=(n-1);(i)>=0;(i)--)
#define INF (1ll<<60)
#define all(x) (x).begin(),(x).end()
typedef long long lint;
const lint MOD =1000000007;
const lint MAX = 10000000;
using Graph =vector<vector<lint>>;
typedef pair<lint,lint> P;

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

void COMinit() // 二項係数を求める時は前処理としてCOMinit()をする
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (lint i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
// 二項係数計算
long long COM(lint n, lint k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

lint primary(lint num)
{
    if (num < 2) return 0;
    else if (num == 2) return 1;
    else if (num % 2 == 0) return 0; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return 0;
        }
    }

    // 素数である
    return 1;
}
    Graph g(100005);
    void dfs(lint to,lint from,lint distar[],lint dist){
            distar[to]=dist;
            for(lint u:g[to]){
                if(u==from)continue;
                dfs(u,to,distar,dist+1);
            }
    }
  int main(){
    lint N,u,v;
    cin>>N>>u>>v;
    --u;--v;
    lint dist1[N];
    lint dist2[N];
    rep(i,N-1){
   lint a,b;
   cin>>a>>b;
   --a;--b;
   g[a].push_back(b);
   g[b].push_back(a);
    }
     dfs(u,-1,dist1,0);dfs(v,-1,dist2,0);
     lint ans=0;
     rep(i,N){
         if(dist1[i]<dist2[i])ans=max(ans,dist2[i]);
         //cout<<dist1[i]<<" "<<dist2[i]<<endl;
     }
     cout<<ans-1;
  }


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

#define NDEBUG
#ifdef DEBUG
#include "../cout11.h"
#undef NDEBUG
#endif
#include <cassert>

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> ii;
typedef pair<ll,ll> llll;
typedef pair<double,double> dd;

typedef vector<int> vi;
typedef vector<vector<int>> vvi;
typedef vector<ii> vii;
typedef vector<vector<ii>> vvii;
typedef vector<ll> vll;

#define sz(a)  int((a).size())
#define pb  push_back
#define FOR(var,from,to) for(int var=(from);var<=(to);++var)
#define rep(var,n)  for(int var=0;var<(n);++var)
#define rep1(var,n)  for(int var=1;var<=(n);++var)
#define repC2(vari,varj,n)  for(int vari=0;vari<(n)-1;++vari)for(int varj=vari+1;varj<(n);++varj)
#define ALL(c)  (c).begin(),(c).end()
#define RALL(c)  (c).rbegin(),(c).rend()
#define tr(i,c)  for(auto i=(c).begin(); i!=(c).end(); ++i)
#define found(s,e)  ((s).find(e)!=(s).end())
#define mset(arr,val)  memset(arr,val,sizeof(arr))
#define mid(x,y) ((x)+((y)-(x))/2)
#define IN(x,a,b) ((a)<=(x)&&(x)<=(b))

#define INTSPACE 12
char _buf[INTSPACE*1000000 + 3];

int loadint() {
    if (fgets(_buf, INTSPACE+3, stdin)==NULL) return 0;
    return atoi(_buf);
}
int loadvec(vector<int>& v, int N=-1) {
    if (N == -1) {
        N = loadint();
        if (N==0) return 0;
    }
    int bufsize = INTSPACE*N + 3;
    if (fgets(_buf, bufsize, stdin)==NULL) return 0;
    v.resize(N);

    int i=0;
    bool last = false;
    for (char *p=&_buf[0]; ;) {
        char *q = p;
        while (*q > ' ') ++q;
        if (*q == 0x0D || *q == 0x0A) last = true;
        *q = 0;
        v[i++] = atoi(p);
        if (last || i == N) break;
        p = q+1;
    }
    // assert(i <= N);
    return i;
}

bool solve(int N, vi& a) {
    // o-4-o
    // 2-2-2-2 偶数は隣接すればOK
    // 4-奇数-4 奇数は4の倍数で挟むか
    int c4=0, c2=0, c1=0;
    for (int ai:a) {
        if (ai % 4 == 0) ++c4;
        else if (ai % 2 == 0) ++c2;
        else ++c1;
    }
    if (c1 <= c4) return true;
    else if (c1 == c4+1) return c2==0;
    else return false;
}

int main() {
    vi a;
    int N = loadvec(a);
    cout << (solve(N,a) ? "Yes" : "No") << endl;
    return 0;
}


Measured memory_bytes: 1664
#include <iostream>
#include <vector>
#include <queue>
#include <deque>
#include <math.h>
#include <stdlib.h>
#include <algorithm>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

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

//INT_MAX	2,147,483,647 = 2*1.0e9

const int mod = 1000000007;


int main(){
  string S; cin >> S;
  int n = S.length();
  ll dp[100050][13];
  dp[0][0] = 1;

  for(int i = 0; i < n; i++){
    if(S[i] == '?'){
      for(int j = 0; j < 10; j++){
        for(int k = 0; k < 13; k++){
          dp[i+1][(k*10 + j)%13] += dp[i][k];
          dp[i+1][(k*10 + j)%13] %= mod;
        }
      }
    } else {
      int c =S[i] -'0';
      for(int k = 0; k < 13; k++){
        dp[i+1][(k*10 + c)%13] += dp[i][k];
        dp[i+1][(k*10 + c)%13] %= mod;
      }
    }
  }

  cout << dp[n][5] << endl;


  return 0;
}



Measured memory_bytes: 10688
#include <iostream>
#include <algorithm>
#include <stack>
#include <string>
#include <queue>
#include <cstdlib>
#include <cstdio>
#include <vector>
#include <list>
#include <string.h>
#define _USE_MATH_DEFINES
#include <math.h>

using namespace std;

struct node{ int parent, left, right;};
node t[100000];
int n, NIL = -1, d[100000];

void print(int u) {
	int c;
	cout << "node " << u << ": parent = " << t[u].parent;
	cout << ", depth = " << d[u] << ", ";
	
	if(t[u].parent == NIL) cout <<"root, ";
	else if (t[u].left == NIL) cout << "leaf, ";
	else cout << "internal node, ";

	cout << "[";

	for(int i = 0, c = t[u].left; c != NIL; i++, c = t[c].right) {
		if(i) cout << ", ";
		cout << c;
	}
	cout << "]" <<endl;
}

void rec(int u, int p) {
	d[u] = p;
	if( t[u].right != NIL) rec(t[u].right, p);
	if( t[u].left != NIL) rec(t[u].left, p+1);
}

int main(){
	int d, v, c, l, r;
	int n; cin >> n;
	for( int i = 0; i < n; i++) t[i].left = t[i].parent = t[i].right = NIL;
	for( int i = 0; i < n; i++) {
		cin >> v >> d;
		for( int j = 0; j < d; j++) {
			cin >> c;
			if( j == 0) t[v].left = c;
			else t[l].right = c;
			l = c;
			t[c].parent = v;
		}
	}
	for( int i = 0; i < n; i++) {
		if( t[i].parent == NIL) r = i;
	}

	rec(r, 0);

	for(int i = 0; i < n; i++) print(i);

	return 0;
}

Measured memory_bytes: 5844
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define BIG 1000000010
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
typedef long long int ll;


int main(){
int a,b;
  cin>>a>>b;
  cout<<(a+b)%24<<endl;

  return 0;
}







Measured memory_bytes: 256
N = int(input())
a = [[ i*(i+1)//2 + j + 1 for j in range(i+1)] for i in range(540)]

k = 1
while k*(k-1)//2 < N:
    k += 1

if k*(k-1)//2 == N:
    print('Yes')
    print(k)
    for i in range(k-1):
        print(str(k-1), end='')
        for j in range(i+1):
            print(' '+str(a[i][j]), end='')
        for j in range(i+1, k-1):
            print(' '+str(a[j][i]), end='')
        print('')
    print(str(k-1), end='')
    for i in range(k-1):
        print(' '+str(a[i][i]), end='')
    print('')
else :
    print('No')

Measured memory_bytes: 10384
#include <iostream>
#include <algorithm>
using namespace std;
int n;
int a[100100];
int main(){
	cin>>n;
	for(int i=1;i<=n;++i){
		cin>>a[i];
	}
	sort(a+1,a+n+1);
	int l=n/2;
	cout<<a[l+1]-a[l]<<endl;
	return 0;
}

Measured memory_bytes: 640
a, b = map(int, input().split())

def xor_sum(n):
    if (n+1) % 2 == 0:
        if (n+1) % 4 == 0:
            return 0
        else:
            return 1
    elif (n+1) % 2 != 0:
        if n % 4 == 0:
            return 0^n
        else:
            return 1^n

ans = xor_sum(b)^xor_sum(max(0, a-1))
print(ans)

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

const string MCXI = "ixcm";

int MCXI2Int(string s)
{
  int res = 0, tmp = 1;
  for (unsigned int i = 0; i < s.size(); ++i) {
    if (isdigit(s[i])) {
      tmp = s[i]-'0';
    } else {
      if (s[i] == 'm') {
	res += tmp * 1000;
      } else if (s[i] == 'c') {
	res += tmp * 100;
      } else if (s[i] == 'x') {
	res += tmp * 10;
      } else {
	res += tmp;
      }
      tmp = 1;
    }
  }
  return res;
}

string Int2MCXI(int n)
{
  stringstream ss;
  ss << n;
  string res = ss.str();
  reverse(res.begin(), res.end());
  unsigned int t = 0;
  for (string::iterator it = res.begin(); it != res.end(); ) {
    if (*it == '0') {
      it = res.erase(it);
      ++t;
    } else if (*it == '1') {
      *it = MCXI[t++];
      ++it;
    } else {
      it = res.insert(it, MCXI[t++]);
      it += 2;
    }
  }
  reverse(res.begin(), res.end());
  return res;
}

int main()
{
  int n;
  cin >> n;
  for (int i = 0; i < n; ++i) {
    string s, t;
    cin >> s >> t;
    cout << Int2MCXI(MCXI2Int(s) + MCXI2Int(t)) << endl;
  }

  return 0;
}

Measured memory_bytes: 0
#include<iostream>
#include<string>
using namespace std;
int main(){
    string str;
    int ab[26]={};
    int i;
    while(getline(cin,str)){
        for(i=0;i<str.size();i++){
            if(str[i]>='a'&&str[i]<='z') ab[str[i]-'a']++;
            else if(str[i]>='A'&&str[i]<='Z') ab[str[i]-'A']++;
        }
        //cout << str << endl;
    }
    for(i=0;i<26;i++){
        cout << (char)('a'+i) << " : " << ab[i] << endl;
    }
    return 0;
}


Measured memory_bytes: 3220
#include<stdio.h>
int main(void)
{
	int r, c,i,j,sum=0,amount=0;
	scanf("%d %d", &r, &c);
	int graf[100][100];
	for (i = 0; i < r; i++)
	{
		for (j = 0; j < c; j++)
		{
			scanf("%d", &graf[i][j]);
		}
	}

	for (i = 0; i < r; i++)
	{
		for (j = 0; j < c; j++)
		{
			printf("%d ", graf[i][j]);
			sum += graf[i][j];
		}
		printf("%d\n", sum);
		sum = 0;
	}
	
	for (j = 0; j < c; j++)
	{
		for (i = 0; i < r; i++)
		{
			sum += graf[i][j];
		}
		printf("%d ", sum);
		amount += sum;
		sum = 0;
	}
	printf("%d\n", amount);
	return 0;
}


Measured memory_bytes: 2044
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <algorithm>
#include <sstream>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <numeric>
#include <cmath>
#include <climits>
#include <limits>
#include <cfloat>
#include <fstream>
using namespace std;

struct GCD{
	int gcd;
	int step;
};

GCD calc_gcd (int a, int b )
{
	GCD res;
	
	int step = 0;

	while(1){
		++step;
		if (a % b == 0){
			break;
		} // end if
		a = a % b;
		if (a < b ){
			swap (a, b );
		} // end if
//		cout << "a: " << a << " b: " << b << endl;
	} // end while

	res.gcd = b;
	res.step = step;

	return res;
}	

int main()
{
//	cut here before submit 
//	freopen("testcase.ea", "r", stdin);
	string str = "";

	while (getline (cin, str ) ){
		int a, b;
		stringstream ss (str );
		ss >> a >> b;

		if (a == 0 && b == 0){
			break;
		} // end if
		GCD res;

//		cout << "a: " << a << " b: " << b << endl;

		if (a < b ){
			swap (a, b );
		} // end if

		res = calc_gcd (a, b );
		cout << res.gcd << ' ' << res.step << endl;

	} // end loop

		
	return 0;
}

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

using ll = long long;
#define FOR(i, m, n) for (int i = (m); i < (n); i++)
#define REP(i, n) FOR(i, 0, n)
#define ALL(c) (c).begin(), (c).end()
template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
const int MOD = 1000000007;

int main() {
    int n, x, y, h, b;
    cin >> n;
    vector<tuple<int, int, int>> v;
    REP(i, n) {
        cin >> x >> y >> h;
        v.emplace_back(x, y, h);
        if (h > 0) {
            b = i;
        }
    }

    REP(i, 101) {
        REP(j, 101) {
            tie(x, y, h) = v[b];
            int c = h + abs(x - i) + abs(y - j);
            bool ok = true;
            REP(k, n) {
                tie(x, y, h) = v[k];
                if (h != max(0, c - abs(x - i) - abs(y - j))) {
                    ok = false;
                    break;
                }
            }
            if (ok) {
                cout << i << " " << j << " " << c << endl;
                return 0;
            }
        }
    }
}


Measured memory_bytes: 256
import std.stdio, std.string,std.range, std.conv, std.array, std.algorithm, std.math, std.typecons, std.container, std.datetime;

void main() {
  auto a = readln.chomp.to!int;
  auto b = readln.chomp.to!int;
  auto h = readln.chomp.to!int;

  writeln((a+b)*h/2);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#define fastio() ios_base::sync_with_stdio(false)
#define rmod(x, y) ((((x)%(y))+(y))%(y))
using namespace std;
using namespace __gnu_pbds;
typedef long long ll;
typedef long double ld;
template<typename T, typename R = null_type, typename C = less<T>>
tree<T, R, C, rb_tree_tag, tree_order_statistics_node_update> ordered_set(){
    return tree<T, R, C, rb_tree_tag, tree_order_statistics_node_update>();
}


int main(){
	int n, m; scanf("%d %d", &n, &m);
	int ans = (n*(n-1))/2;
	ans += (m*(m-1))/2;
	printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 256
//Twitter@KonoLv1 2020年春からエンジニア見習いデビュー！
 
#include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
 
int main(void){
    int i,j;            //  ループ文に使用
    int x,y,z;
    int count1,count2,count;   //  カウント用に使用
    int box[100000] = {};
    int boxb[1024] = {};
    char s[200001] = {};        //  文字列
    char s2[200001] = {};        //  文字列
    int a,b,c,h,w;
    int n,k;
    a = b = c = i = 0;
    int mode = 0;
    count = count1 = count2 = 0;
 
    //  入力処理
    
    scanf("%d",&n);
    for (i = 1; i <= n; i++){
        scanf("%d",&x);
        box[x] = i;
    }
 

    //  計算処理
    
 
 
    //  出力処理
 

     for (i = 1; i <= n; i++){
        printf("%d ",box[i]);
    }
 
 
}

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

using namespace std;
typedef long long ll;
typedef long int li;
typedef long double lb;
#define rep(i,j,n) for (ll i = j; i < (n); i++)
#define repr(i,j,n) for(ll i = j; i >= (n); i--)
#define all(x) (x).begin(),(x).end()
#define CLR(mat,f) memset(mat, f, sizeof(mat))
#define IN(a, b, x) (a<=x&&x<b)
#define out(ans) cout << ans << endl
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
typedef pair<ll,ll>P;
const ll mod=1e9+7;
const ll INF = 1LL<<60;

int main(){

  string p;cin>>p;
  string w;
  ll ans=0;
  while(cin>>w){
    if(w=="END_OF_TEXT")break;
    transform(all(p),p.begin(),::tolower);
    transform(all(w),w.begin(),::tolower);
    if(p==w)ans++;

  }

  out(ans);

  return 0;
}



Measured memory_bytes: 3176
#include<bits/stdc++.h>
#define pb push_back
using namespace std;
const int N=1e5+100;
long long M=1e15;
long long dp[N],h[N];



int main(){
    int n,k;
    cin >> n >> k;
    for (int i=0 ; i<n ; i++){
        cin >> h[i];
        dp[i]=M;
    }
    dp[0]=0;
    dp[1]=abs(h[1]-h[0]);
    for (int i=2 ; i<k ; i++){
        for (int j=0 ; j<i ; j++){
            dp[i]=min(dp[i],dp[j]+abs(h[i]-h[j]));
        }
    }
    for (int i=k ; i<n ; i++){
        for (int j=i-k ; j<i ; j++){
            dp[i]=min(dp[i],dp[j]+abs(h[i]-h[j]));
        }
    }
    cout << dp[n-1];

}







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

int p[11], q[11], a[11], n;

bool same_with_p(void)
{
	int i;

	for (i = 0; i < n; i++)
		if (p[i] != a[i])
			return false;
	return true;
}

bool same_with_q(void)
{
	int i;

	for (i = 0; i < n; i++)
		if (q[i] != a[i])
			return false;
	return true;
}

int main(void)
{
	int i, ansp, ansq, cnt = 0;

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

	do {
		++cnt;

		if (same_with_p())
			ansp = cnt;
		if (same_with_q())
			ansq = cnt;

	} while (next_permutation(a, a + n));

	printf("%d " ,abs(ansp - ansq));
	return 0;
}

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

typedef long long ll;
#define inf 1e9+7

int f[200],d[200];
bool table[200][200];
int cou;

void init(){
    for(int i=0;i<200;i++){
        f[i]=d[i]=-1;
    }
}

void dfs(int n,int itr){
    cou++;
    if(d[itr]<0)d[itr]=cou;
    for(int i=0;i<n;i++){
        if(d[i]<0&&table[itr][i]) dfs(n,i);
    }
    cou++;
    f[itr] = cou;
}

void solve(int n){
    for(int i=0;i<n;i++){
        if(d[i]<0)dfs(n,i);
    }
}

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


    init();
    int u,k,v;
    int n;
    cin >> n;
    for(int i=0;i<n;i++){
        cin >> u >> k;
        for(int j=0;j<k;j++){
            cin >> v;
            table[u-1][v-1]=true;
        }
    }

    solve(n);

    for(int i=0;i<n;i++){
        cout << i+1 << " " << d[i] << " " << f[i] << endl;
    }

    return 0;
}



Measured memory_bytes: 3216
#include <algorithm>
#include <iostream>
#include <vector>
#include <math.h>
#include <set>
#include <map>
#include <string>
#include <stack>
#include <queue>
#include <iomanip>
#include <numeric>
#include <tuple>
#define _USE_MATH_DEFINES
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> plglg;
typedef tuple<int, int, int> tiii;
typedef tuple<ll, ll, ll> tlglglg;
int dx[4] = {1, 0, -1, 0};
int dy[4] = {0, 1, 0, -1};
double pi = 3.141592653589793;
ll mod = 1000000007;
int intmax = 2147483647;
int intmin = -2147483648;
ll llmax = 9223372036854775807;
ll llmin = -9223372036854775807;

struct edge {
    int to, cost;
};

int H, W;
bool marked[100][100];
int sum;

void BFS(pii st) {
    queue<pii> que;
    que.push(st);
    sum++;
    marked[st.first][st.second] = false;
    while (que.size() > 0) {
        pii base = que.front();
        que.pop();
        int basex = base.first;
        int basey = base.second;
        for (int i = 0; i < 4; i++) {
            int x = basex + dx[i];
            int y = basey + dy[i];
            if (x >= 0 && x < H && y >= 0 && y < W) {
                if (marked[x][y]) {
                    que.push(pii(x, y));
                    sum++;
                    marked[x][y] = false;
                }
            }
        }
    }
}

int main() {
    while (true) {
        cin >> W >> H;
        if (W == 0) {
            break;
        }
        for (int i = 0; i < H; i++) {
            fill(marked[i], marked[i] + W, true);
        }
        pii st;
        for (int i = 0; i < H; i++) {
            string s;
            cin >> s;
            for (int j = 0; j < W; j++) {
                if (s[j] == '#') {
                    marked[i][j] = false;
                } else if (s[j] == '@') {
                    st = pii(i, j);
                }
            }
        }
        sum = 0;
        BFS(st);
        cout << sum << endl;
    }
}



Measured memory_bytes: 2992
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.HashMap;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.Set;
import java.util.StringTokenizer;
import java.util.TreeMap;
import java.util.TreeSet;

public class Main {
	
	public static int partition(int[] A, int p, int r){
		final int x = A[r];
		
		int i = p - 1;
		for(int j = p; j < r; j++){
			if(A[j] <= x){
				i++;
				
				int tmp = A[i];
				A[i] = A[j];
				A[j] = tmp;
			}
		}
		
		int tmp = A[i + 1];
		A[i + 1] = A[r];
		A[r] = tmp;
		
		return i + 1;
	}
	
	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		
		final int n = sc.nextInt();
		int[] array = new int[n];
		for(int i = 0; i < n; i++){
			array[i] = sc.nextInt();
		}
		
		final int ret = partition(array, 0, n - 1);
		
		StringBuilder sb = new StringBuilder();
		for(int i = 0; i < n; i++){
			sb.append(i == 0 ? "" : " ");
			sb.append(i == ret ? "[" : "");
			sb.append(array[i]);
			sb.append(i == ret ? "]" : "");
		}
		System.out.println(sb.toString());
	}
	
	public static class Scanner {
	    private BufferedReader br;
	    private StringTokenizer tok;

	    public Scanner(InputStream is) throws IOException {
	        br = new BufferedReader(new InputStreamReader(is));
	    }

	    private void getLine() throws IOException {
	        while (!hasNext()) { tok = new StringTokenizer(br.readLine()); }
	    }

	    private boolean hasNext() {
	        return tok != null && tok.hasMoreTokens();
	    }

	    public String next() throws IOException {
	        getLine(); return tok.nextToken();
	    }

	    public int nextInt() throws IOException {
	        return Integer.parseInt(next());
	    }
	    
	    public long nextLong() throws IOException {
	    	return Long.parseLong(next());
	    }
	    
	    public void close() throws IOException {
	        br.close();
	    }
	}

}

Measured memory_bytes: 33804
#include <bits/stdc++.h>
using namespace std;
#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 all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define bit(k) (1LL<<(k))
typedef long long ll;

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

const int INF = 1e9;
const ll INFLL = 1e18;
const ll MOD = 1e9+7;
const double PI = acos(-1.0);

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

/*------------------------------------/
for library*/

/*------------------------------------*/

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    string S,T;cin>>S>>T;cout<<T<<S<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <cmath>
#include <climits>
#include <iomanip>
#include <set>
#include <map>
using namespace std;
typedef long long ll;
int main(){
  ll n = 0;
  cin >> n;
  cout << n * 800 - (n / 15) * 200 << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define ll long long
#define P pair<int,int>
#define fi first
#define se second
#define rep(i,n) for(int i=0;i<n;i++)
#define all(v) v.begin(),v.end()
#define pb push_back
template<class T>void chmax(T &a,T b){if(a<b)a=b;}
template<class T>void chmin(T &a,T b){if(a>b)a=b;}
constexpr int INF=1000000000000000000;
constexpr int mod=1000000007;
int dx[]={0,1,0,-1},dy[]={1,0,-1,0};
int kaijo[2000010];
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
int lcm(int a,int b){
    return a/gcd(a,b)*b;
}
bool prime(int a){
    if(a==1)return false;
    for(int i=2;i*i<=a;i++){
        if(a%i==0)return false;
    }
    return true;
}
void init_fact(){
    kaijo[0]=1;
    for(int i=1;i<=2000000;i++){
        kaijo[i]=kaijo[i-1]*i;
        kaijo[i]%=mod;
    }
}
int modpow(int a,int b){
    if(b==0)return 1;
    if(b%2)return modpow(a,b-1)*a%mod;
    int memo=modpow(a,b/2);
    return memo*memo%mod;
}
int comb(int a,int b){
    if(!kaijo[0])init_fact();
    return kaijo[a]*modpow(kaijo[a-b],mod-2)%mod*modpow(kaijo[b],mod-2)%mod;
}
int inv(int x){
    x=modpow(x,mod-2);
    return x;
}
bool kosa(double ax,double ay,double bx,double by,double cx,double cy,double dx,double dy){
    double ta=(cx-dx)*(ay-cy)+(cy-dy)*(cx-ax);
    double tb=(cx-dx)*(by-cy)+(cy-dy)*(cx-bx);
    double tc=(ax-bx)*(cy-ay)+(ay-by)*(ax-cx);
    double td=(ax-bx)*(dy-ay)+(ay-by)*(ax-dx);
    return tc*td<0&&ta*tb<0;
}
int n,ans,dp[20][20];
string s,t,st;
void init_table(){
	rep(i,20){
		rep(j,20){
			dp[i][j]=0;
		}
	}
	dp[0][0]=1;
}
signed main(){
	cin>>n>>st;
	s=st.substr(0,n);
	t=st.substr(n,n);
	reverse(all(t));
	rep(I,(1<<n)){
		string a="",b="";
		rep(j,n){
			if((I>>j)&1)a.pb(s[j]);
			else b.pb(s[j]);
		}
		init_table();
		rep(i,a.size()+1){
			rep(j,b.size()+1){
				if(i==a.size()&&j==b.size())continue;
				if(dp[i][j]==0)continue;
				if(t[i+j]==a[i])dp[i+1][j]+=dp[i][j];
				if(t[i+j]==b[j])dp[i][j+1]+=dp[i][j];
			}
		}
		ans+=dp[a.size()][b.size()];
	}
	cout<<ans<<endl;
    return 0;
}


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

#ifndef ULLONG
typedef unsigned long long ULLONG;
#endif
#ifndef LLONG
typedef long long LLONG;
#endif
template <class _T> static _T tp_abs(const _T& a) {
	return ((a < 0) ? (a * -1) : a);
}
template <class _T> static _T tp_min(_T a, _T b) {
	return a < b ? a : b;
}
template <class _T> static _T tp_max(_T a, _T b) {
	return a > b ? a : b;
}
template<class _T> static void get1int(_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 get2int(_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 get3int(_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 const LLONG Dmod = 1000000007;

static void D_task();

int main()
{
	D_task();
	
	fflush(stdout);
	return 0;
}


template <class _Ty> class PermComb
{
protected:

	_Ty _maxNum = 0;
	_Ty _use_mod = 0;
	_Ty* _fact = 0;
	_Ty* _inv = 0;
	_Ty* _finv = 0;

	PermComb() {}

public:
	PermComb(_Ty maxNum, _Ty use_mod = 0) {
		_maxNum = maxNum;
		_use_mod = use_mod;
		_fact = new _Ty[(unsigned int)maxNum + 1];
		_fact[0] = _fact[1] = 1;

		if (_use_mod) {
			_inv = new _Ty[(unsigned int)maxNum + 1];
			_finv = new _Ty[(unsigned int)maxNum + 1];
			_inv[0] = _inv[1] = 1;
			_finv[0] = _finv[1] = 1;
		}

		for (_Ty i = 2; i <= maxNum; i++) {
			_fact[i] = _fact[i - 1] * i;
			if (_use_mod) {
				_fact[i] %= _use_mod;
				_inv[i] = _use_mod - _inv[_use_mod % i] * (_use_mod / i) % _use_mod;
				_finv[i] = _finv[i - 1] * _inv[i] % _use_mod;
			}
		}
	}

	//	get permutation value
	virtual _Ty GetPermAns(int n, int k) {
		if ((k > _maxNum) || (n > _maxNum) || (k > n) || (k < 0) || (n < 0)) {
			return 0;
		}
		return(_fact[n] / _fact[n - k]);
	}

	//	get combination value
	virtual _Ty GetCombAns(int n, int k) {
		_Ty ans = 0;
		if ((k > _maxNum) || (n > _maxNum) || (k > n) || (k < 0) || (n < 0)) {
			ans = 0;
		}
		else if (_use_mod == 0) {
			ans = GetPermAns(n, k);
			ans /= _fact[k];
		}
		else {
			ans = _fact[n] * (_finv[k] * _finv[n - k] % _use_mod) % _use_mod;
		}
		return ans;
	}

	//	destructor
	~PermComb() {
		delete[] _fact;
		delete[] _inv;
		delete[] _finv;
	}
};

static void D_task()
{
	int N, K;
	get2int(N, K);

	PermComb<LLONG> cmb(2000, Dmod);

	for (int i = 1; i <= K; i++) {
		printf("%lld\n", cmb.GetCombAns(N - K + 1, i) * cmb.GetCombAns(K - 1, i - 1) % Dmod);
	}
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include<algorithm>
#include<string>
#include<stdio.h>
#include<map>
#include<math.h>
#include<queue>
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int MOD = 1000000007;
const int mod = 1000000007;
const int INF = 1000000001;
const long long LINF = 1e18;
const int MAX = 510000;

int main() {
	long long int n, k,ans;
	cin >> n >> k;
	ans = k;
	for (int i = 0; i < n - 1; i++) {
		ans *= k - 1;
	}
	cout << ans << endl;
		return 0;
	}


Measured memory_bytes: 3572
import std.stdio,std.math,std.string,std.conv,std.typecons,std.format;
import std.algorithm,std.range,std.array,std.numeric;
 
T[] readarr(T=long)(){return readln.chomp.split.to!(T[]);}
void scan(T...)(ref T args){auto input=readln.chomp.split;foreach(i,t;T)args[i]=input[i].to!t;}
struct Queue(T){T[]e;auto enq(T t){e~=t;}auto enq(T[]ts){e~=ts;}T deq(){T tp=e[0];e=e.length>1?e[1..$]:[];return tp;}}
struct Stack(T){T[]e;auto push(T t){e~=t;}auto push(T[]ts){e~=ts;}T pop(){T tp=e[$-1];e=e.length>1?e[0..$-1]:[];return tp;}}
 
//END OF TEMPLATE

void main(){
    long[long] card;
    bool[9] panch;
    3.iota.each!((i){
            auto a=readarr;
            3.iota.each!(j=>card[a[j]]=i*3+j);
            });
    long n;
    n.scan;
    auto b=n.iota.map!(i=>readln.chomp.to!long);
    foreach(x;b){
        if(x in card)
            panch[card[x]]=true;
    }   
    auto lines=3.iota.map!(r=>3.iota.map!(c=>panch[r*3+c]).array).array;
    lines~=3.iota.map!(c=>3.iota.map!(r=>panch[r*3+c]).array).array;
    lines~=3.iota.map!(x=>panch[x*3+2-x]).array;
    lines~=3.iota.map!(x=>panch[x*3+x]).array;
    (lines.filter!(l=>l==[true,true,true]).array.length>0?"Yes":"No").writeln;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define optimizator ios_base::sync_with_stdio(0);
#define ll long long
using namespace std;
int main(){
	optimizator;
	int n,cnt=0;
	cin>>n;
	string a;
	cin>>a;
	for(int i=0; i<n; i++){
		if(a[i]!=a[i+1]){
			cnt++;
		}
	}
	if(cnt==0){
		cout<<1;
		return 0;
	}
	cout<<cnt;	
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <string>
#include <queue>
#include <fstream>
#include <string>
#include <math.h>
#include <set>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
//typedef pair<ll, P> T;

#define rep(i, n) for (ll i = 0; i < (n); i++)
#define revrep(i, n) for (ll i = (n) - 1; i >= 0; i--)
#define f first
#define s second
#define pb push_back

ll mod = 1000000007;
const ll INF = 100000000000010000;

//ll bit[200010];
//ll kai[3010];

//void pres(double A, ll x = 20) { printf("%.20f\n", x); }

/*ll sum(ll i)
{
	i += 1;
	ll t = 0;
	while (i > 0)
	{
		t += bit[i];
		i -= i & -i;
	}
	return t;
}

void update(ll i, ll x)
{
	i += 1;
	while (i <= 200005)
	{
		bit[i] += x;
		i += i & -i;
	}
}*/

/*`ll SAIKI(ll S) {
	for (ll T = S; ; T = (T - 1) & S) {

	}
}*/

void test() {
	cout << "888888888888888888888888" << endl;
}

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

ll pow_mod(ll x, ll y) {
	if (y == 0) return 1;
	if (y % 2 == 1) {
		return x * pow_mod(x, y - 1) % mod;
	}
	else {
		ll half = pow_mod(x, y / 2);
		return half * half % mod;
	}
}

ll div_mod(ll x) {
	return pow_mod(x, mod - 2);
}

/*ll com(ll x, ll y) {
	return kai[x] * div_mod(kai[y] * kai[x - y] % mod) % mod;
	//毎回オーダーlog(n)かかる
}*/

/*void kaijo() {
	kai[0] = 1;
	for (ll i = 1; i <= 3004; i++) {
		kai[i] = kai[i - 1] * i % mod;
	}
}*/

string S;

void solve() {
	cin >> S;
	if (S == "Sunny") {
		cout << "Cloudy" << endl;
	}
	else if (S == "Rainy") {
		cout << "Sunny" << endl;
	}
	else {
		cout << "Rainy" << endl;
	}
}

int main() {
	cin.tie(0);
	ios::sync_with_stdio(false);
	solve();
	ll N;
	cin >> N;
}


Measured memory_bytes: 256
#pragma GCC optimize ("O2")
#pragma GCC diagnostic ignored "-Wunused-variable"
#pragma GCC diagnostic ignored "-Wunused-result"
#pragma GCC diagnostic ignored "-Wunused-label"

#define DEBUG 1
#define dd if (DEBUG)

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

#define rep(i, a, b) for (int i = (a); i < (b); ++i)
#define trav(a, A) for (auto & a : A)
#define all(a) (a).begin (), (a).end ()
#define rall(a) (a).rbegin (), (a).rend ()
#define sz(a) (int) (a).size ()
#define szl(a) (int) (a).length ()
#define FASTIO cin.sync_with_stdio (0); cin.tie (0); cin.exceptions (cin.failbit);

typedef long long ll;
typedef pair <int, int> pii;
#define f first
#define s second
#define mp(a, b) make_pair((a), (b))
typedef vector <int> vi;
typedef vector <vi> mi;
typedef vector <ll> vll;
typedef vector <vll> mll;
#define pb(a) push_back ((a))

const ll MOD = 1e+9+7;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int INFi = 0x3f3f3f3f;
const ll MAXN = 1e+6+7;

int main ()
{
    FASTIO;
    int i, j, n;
    char c;
    cin >> c;
    cout << (char)(c + 1) << '\n';

    return 0;
}




Measured memory_bytes: 256
import sys
import bisect
N = int(input())
L = [i for i in map(int, input().split())]
ans = 0

L.sort()
#print(L)
if N == 3:
    if L[0] + L[1] > L[2]:
        print("1")
        sys.exit()

for i in range(len(L)-2):
    for j in range(i+1,len(L)-1):
        index = bisect.bisect_left(L,L[i]+L[j],j+1)
        #print(index)
        ans += index  - (j + 1) 
print(ans)

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

int main() {
    int a, b, count=0;
    cin >> a >> b;
    
    for(int i=1; i<=a; i++){
        if(i<a){
            for(int j=1; j<=31; j++){
                if(i == j) count++;
            }
        }
        else{
            for(int j=1; j<=b; j++)
                if(i == j) count++;
        }
    }
    cout << count << endl;
}

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

int main() {
  int n;
  scanf("%d", &n);
  
  vector<string> normal_forms = {"a"};
  for (int i = 1; i < n; i++) {
    vector<string> t;
    for (int j = 0; j < normal_forms.size(); j++) {
      char mx = 'a';
      for (int k = 0; k < normal_forms[j].length(); k++)
        if (mx < normal_forms[j][k])
          mx = normal_forms[j][k];
        
      for (char c = 'a'; c <= mx + 1; c++)
        t.push_back(normal_forms[j] + c);
    }
    normal_forms = t;
  }

  for (string normal_form : normal_forms)
    cout << normal_form << endl;

  return 0;
}

Measured memory_bytes: 10908
#"""
import sys
input = sys.stdin.readline
#"""

N,M = map(int,input().split())
ST = [list(map(int,input().split())) for _ in [0]*M]

Ef = [[] for _ in [0]*N]
Eb = [[] for _ in [0]*N]

for s,t in ST:
    s -= 1
    t -= 1
    Ef[s].append(t)
    Eb[t].append(s)

V = [0]*N
for i in range(N-2,-1,-1):
    tmp_sum = 0
    tmp_num = 0
    for j in Ef[i]:
        tmp_num += 1
        tmp_sum += V[j]
    V[i] = tmp_sum/tmp_num + 1.0

bq = []
for bi in range(i,N-1):
    if len(Ef[bi]) <= 1:
        continue
    bj = 0
    tmp = 0
    for j in Ef[bi]:
        if tmp<V[j]:
            tmp = V[j]
            bj = j
    bq.append((bi,bj))

ans = V[0]
for bi,bj in bq:
    V2 = [0]*N
    for i in range(N-2,-1,-1):
        tmp_sum = 0
        tmp_num = 0
        for j in Ef[i]:
            if i==bi and j==bj : continue
            tmp_num += 1
            tmp_sum += V2[j]
        V2[i] = tmp_sum/tmp_num + 1.0
    ans = min(ans,V2[0])
print(ans)

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

#define REP(i, start, count) for(int i=(start); i<(int)(count); ++i)
#define rep(i, count) REP(i, 0, count)
#define ALLOF(c) (c).begin(), (c).end()

typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> veci;
typedef vector<long long> vecll;
typedef vector<unsigned long long> vecull;

constexpr ll MOD = 1000000007;

int N;

int main(void) {
    cin >> N;

    veci nums(N, 0);

    rep(i, N) {
        int a;
        cin >> a;
        nums[a]++;
    }

    bool flag = true;

    ll ans;

    if (N % 2 == 0) {
        ans = 2;
        if (nums[1] != 2) {
            flag = false;
        }
    }
    else {
        ans = 1;
        if (nums[0] != 1) {
            flag = false;
        }
    }

    if (!flag) {
        cout << 0 << endl;
        return 0;
    }


    for (int i = (N - 1) % 2 + 2; i <= N - 1; i += 2) {
        if (nums[i] != 2) {
            ans = 0;
            break;
        }

        ans = (ans * 2) % MOD;
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 640
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long[] ans = new long[3];
        ans[0] = sc.nextLong();
        ans[1] = sc.nextLong();
        ans[2] = sc.nextLong();
        int N = sc.nextInt();

        long max = 0;
        for (int i = 0; i < 2; i++) {
            max = Math.max(ans[i], ans[i + 1]);
        }

        int maxIndex = 0;
        for (int i = 0; i < 3; i++) {
            if (ans[i] == max) {
                maxIndex = i;
            }
        }

        while (N > 0) {
            max = max * 2;
            N--;
        }

        long res = 0;
        for (int i = 0; i < 3; i++) {
            if (maxIndex == i) {
                res += max;
            } else {
                res += ans[i];
            }
        }

        System.out.println(res);
    }
}


Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
const long long INF=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long,long>> vpll;
typedef vector<pair<int,int>> vpii;
int main() {
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	ini(n);
	ini(n1);
	int total = 0;
	int a[10000];
	FOR(i,0,n){
		a[i] = i+1;
		total += i+n1;
	}
	int min1 = 10000;
	int tmp = 0;
	FOR(i,0,n){
		if (a[i] - 1 + n1 > 0) {
			min1 = min(min1, abs(a[i] - 1 + n1));
			tmp = 0;
		}
		else {
			min1 = min(min1, abs(a[i] - 1 + n1));
			tmp = 1;
		}
	}
	int x;
	if(tmp)x = total + min1;
	else x = total - min1;
	out(x);
	return 0;
}

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

int main()
{
  string r, g, b;
  cin >> r >> g >> b;
  string s = "";
  s += r+g+b;
  if(stoi(s)%4 == 0) cout << "YES" << endl;
  else cout << "NO" << endl;
}

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

int main(){
    string s; cin >>s;
    string before="";
    string tmp="";
    before = s.at(0);
    int count =1;
    for(int i=1; i<s.length(); i++){
        if(tmp == ""){
            tmp = s.at(i);
            if(tmp != before){
                before = tmp; count++;
                tmp ="";
            }
        }else{
            tmp = tmp + s.at(i);
            if(tmp != before){
                before = tmp; count++;
                tmp="";
            }
        }
    }
    cout << count << endl;
    return 0;
}

Measured memory_bytes: 3736
#include <iostream>
#include <map>

using namespace std;

int main() {
    map<int, int> mp;
    int N;
    cin >> N;
    
    for(int n=0; n<N; n++) {
        int a;
        cin >> a;
        
        mp[a/400]++;
    }
    
    int ans=0;
    int tans=0;
    for(auto itr=mp.begin(); itr!=mp.end(); itr++) {
        if(itr->first>7) {
            tans+=itr->second;
            continue;
        }
        if(itr->second>0) ans++;
    }
    
    if(ans==0 && tans!=0) {
        cout << 1 << " " << tans << endl;
    } else {
        cout << ans << " " << ans+tans << endl;
    }


    return 0;
    
}

Measured memory_bytes: 256