akhauriyash/Code-Regression huggingface dataset:
/*MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWO:,'..'xXWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMO. .:kOo.,kNMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMO. .lNWWo..lXMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM
MNOxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxMMMMWKxoloxKWNc  .:xxd;  ,dxxxkXMXkxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxMM
MKc''''''''''''''''.  ..'''''.   .''''.  .''MMMWx..,:. .xXo''.  .''.  ..'';kMk;'''''.  .'.''.  .''''''.  ..''.   .''MM
MWNXNNNNNNNNNNNNNNNO' ;KNNNNNKo. cKNNNd. lXNMMMK; ,0Wx. :NWXXl .dNNO' ;KNNNWMWNNNNNXc .kNNNNx. cXNNNNNO' ;KNN0; 'ONNMM
MMMMMMMMMMMMMMMMMWM0' :NMMMMWMX: .OMWWx. oWMMMMWx. ';. .dNMWWo .xMM0' :NWWMMMMMMMMWWl .OMMMWk. lWWMMWM0' ;XMMX: ,KMMMM
MMMMMMWMWkccccccccc;. :NMWNNNKd. :XMMWx. oWMMMWKo. .',. .,ldx; .dMM0' :NMMMMMMMNNWMWl .OMMMWk. lWMMMMM0' ;XMMX: ,0MMMM
MMWXKNWMWxcc,. .;cc;. :XMk,''..'lKWMMWx. oWMNx:. .lONNKxl.     .xMM0' :NMMMMMM0:,oKO' ,KMMMMk. lWWNkoc,. .;::;. ,KMMMM
MMXc.lXMMWWWNd..xWM0' :NM0;  ;kXWMMMWNl  oWMK:.;xXWWMWXx:. ,c' .dMM0' :NMMMMMMKc. ...;kWMMMMk. lWWc .:;. .clc:. ,KMMMM
MWWx. lXMWMMMK, lWM0' :NMMNx'.,ldxxoc'   oWMWNKNWWWN0o' .:kNWo .dMM0' :NMMMMMMMNO;  ,OWWWMMMk. lWM' lXx. lNMMX: ,KMMMM
MMMWk'.,xKNX0c..kWM0' :NMMMMNkl;,'',:l:  oWMMMMMWMWO' 'l0WMWWo .xMM0' :NMMMMMMMMMNd. .oXWMMMk. lWMd.....;0WMMX: ,KMMMM
MMMMWKo'...'..:kWMM0' :NMMMMMMMWWNNWWWx. oWMMMMMMMMWOxXWMWMWWo .xMM0' :NMMMMMMMMMMMKl. ,kNMMk. lWMWKkxx0NMWMMX: ,KMMMM
MMMMMMMN0kxk0XNWMMWKl;xNMMMMMMMMMMMMWM0c;kWMMMMMMMMMMMWWMMMMWk;:OMMXl,dNMMMMMMMMMMMMWO; .dNM0c;kWWMMMMMMMMMMMNd,oXMMMM
MMMMMMMMWWMWMMMMMMMMMWWMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMWWMMWWMMWMMMMMMMMMMMMMMNkxKWMMWWMMMMMMMMMMMMMMWMMWMMMMM
MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMMM*/

//             Author: Udit "luctivud" Gupta @ (https://www.linkedin.com/in/udit-gupta-1b7863135/)                  //


#include <bits/stdc++.h>
#pragma GCC optimize "trapv"

using namespace std;

typedef long long int lld;
typedef unsigned long long int llu;

#define         TESTCASES()    cin >> (T3X0); T353 = T3X0; while(T3X0--)
#define         _input(V3C)    for(auto &V3C_I7 : (V3C)) cin >> (V3C_I7)
#define   mems(A77AY, V4LU)    memset((A77AY), (V4LU), sizeof((A77AY)))
#define    CH3K(I7, E4, S7)    (((S7)<0) ? (I7)>(E4) : (I7)<(E4))
#define   for4(I7,S4,E4,S7)    for(auto I7=(S4); CH3K(I7,E4,S7); (I7)+=(S7))
#define              len(v)    ((int)((v).size()))
#define              all(x)    (x).begin(), (x).end()
#define             rall(x)    (x).rbegin(), (x).rend()
#define             deb1(x)    cout << #x << "=" << (x) << "\n";
#define             deb2(x)    cout << #x << "=" << (x) << " ";



void solveEachTest(lld T35TC453N = 1) {
	lld n, x, t; cin >> n >> x >> t;
	cout << ((n + x - 1) / x)*t;

	cout << "\n";

	return;
}


signed main() {
	ios_base::sync_with_stdio(false); cin.tie(0); cout.precision(10);

	lld T3X0 = 0, T353 = 1;

	// TESTCASES()
	solveEachTest(T353 - T3X0);
	return 0;
}
// Random Thought :  null

Measured memory_bytes: 3608
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        Scanner scn = new Scanner(System.in);
        int r = scn.nextInt();
        int c = scn.nextInt();
        int[][] a = new int[r + 1][c + 1];
        int sum = 0;

        for (int i = 0; i < r; i++) {
            for (int j = 0; j < c; j++) {
                a[i][j] = scn.nextInt();
            }
        }

        for (int i = 0; i < r; i++) {
            a[i][c] = 0;
            for (int j = 0; j < c; j++) {
                a[i][c] += a[i][j];
            }
        }
        for (int i = 0; i <= c; i++) {
            a[r][i] = 0;
            for (int j = 0; j < r; j++) {
                a[r][i] += a[j][i];
            }
        }

        for (int i = 0; i <= r; i++) {
            System.out.printf("%d",a[i][0]);
            for (int j=1; j <= c; j++) {
                System.out.printf(" %d",a[i][j]);
            }
            System.out.printf("%n");
        }

        scn.close();
    }

}


Measured memory_bytes: 53196
#include <stdio.h>

int main(void){
    long n;
    long a[200000];
    
    scanf("%d", &n);
    for (int i=0; i<n; i++){        
        scanf("%ld", &a[i]);
    }
    
    printf("%d", a[n-1]);
    for (int i=n-3; i>=0; i-=2){
        printf(" %ld", a[i]);
    }
    for (int i=n%2; i<n; i+=2){
        printf(" %ld", a[i]);
    }
    puts("");
    
    return 0;
}

Measured memory_bytes: 3712
#include<stdio.h>
#include<string.h>
int main(){
  int i=0,n;
  double x2=0.0,x3=0.0;
  scanf("%d",&n);
  double x;
  char u[n][4];
  for(;i<n;i++){
    scanf("%lf %s",&x,u[i]);

    if(u[i][0]=='J'){
      x2=x;
 
    }
    else
      if(u[i][0]=='B'){
        x2=380000*x;
  
      }
    x3+=x2;
  }
  printf("%f\n",x3);
  return 0; 
}

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

typedef unsigned long long		ull;
typedef long long				ll;
typedef long double				ld; // GCC - long double, but VS - double

template<typename T> using vv	= vector<vector<T>>;
template<typename T> using pp   = pair<T, T>;

#define fr(i, n)                for(int i = 0; i < n; ++i)
#define rep(i, a, b)            for(int i = a; i <= b; ++i)
#define all(a)                  a.begin(), a.end()
#define rall(a)                 a.rbegin(), a.rend()
#define pb                      push_back
#define nl                      '\n'
#define file(name1, name2)      freopen(name1, "r", stdin); freopen(name2, "w", stdout);
#define zp_v(v)                 for(int i = 0; i < v.size(); ++i) cin >> v[i]
#define zp_vv(v)                fr(i, v.size())fr(j, v[i].size()) cin >> v[i][j];
#define print_v(v)              for (auto& u : v){ cout << u << ' '; }
#define print_vv(v)             for (auto& u : v){ for (auto& q : u) cout << q << ' '; cout << nl;}
#define int ll

const int INF = 1e9;

signed main()
{
#ifdef LOCAL_DEBUG
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif	
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	int n, k;
	cin >> n >> k;

	vector<int> v(n + k + 1);
	vector<int> dp(n + k + 1, INF);
	dp[k + 1] = 0;

	rep(i, k + 1, v.size() - 1)
		cin >> v[i];

	rep(i, k + 2, v.size() - 1)
	{
		for (int j = i - k; j < i; ++j)
			dp[i] = min(dp[i], abs(v[i] - v[j]) + dp[j]);
	}
	cout << dp.back();
	
	return 0;
}

Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define vi vector<int>
#define vvi vector<vector<int>>
const int MOD = 1e9+7,mxN = 50,INF = 1e9;
int n;
void fastscan(int &number);

int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    fastscan(n);
    int a[n];
    for(int i=0;i<n;i++)
        fastscan(a[i]);
    int best = 1;
    for(int i=0;i<n-1;i++)
    {
        int j=i+1;
        while(j<n&&a[j]<=a[j-1])
            j++;
        if(j-i>best)
            best = j-i;
    }
    cout << best-1;
    
}

void fastscan(int &number) 
{ 
    bool negative = false; 
    register int c; 
    number = 0; 
    c = getchar_unlocked(); 
    if (c=='-') 
    { 
        negative = true; 
        c = getchar_unlocked(); 
    } 
    for (; (c>47 && c<58); c=getchar_unlocked()) 
        number = number *10 + c - 48; 
    if (negative) 
        number *= -1; 
} 

Measured memory_bytes: 4008
import java.util.Scanner;

public class Main{

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = Integer.parseInt(sc.next());
		int b = Integer.parseInt(sc.next());
		sc.close();
		String str = String.valueOf(a) + String.valueOf(b);
		int num = Integer.valueOf(str);

		double check = Math.sqrt(num);

		if(check == Math.floor(check)) {
			System.out.println("Yes");
		}else {
			System.out.println("No");
		}
	}

}

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

int main() {
  int n; cin >> n;
  vector<string> words(n);
  for (auto &str : words) cin >> str;
  bool rule = true;
  for (int i=0; i<n-1; ++i) {
    if (words[i].back() != words[i+1].front()) {
      rule = false;
      break;
    }
  }
  if (rule) {
    set<string> s;
    for (auto &str : words) s.insert(str);
    if (s.size() != n) {
      rule = false;
    }
  }
  cout << (rule ? "Yes\n" : "No\n");
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
    int h1,h2,k1,k2,a,b,c,d,E,F;
    cin>>h1>>h2;
    cin>>k1>>k2;
    cin>>a>>b>>c>>d;
    E=c*(h1/10)+a*(h1)+d*(h2/20)+b*(h2);
    F=c*(k1/10)+a*(k1)+d*(k2/20)+b*(k2);
    if(E>F){
        cout<<"hiroshi"<<endl;
    }else if(F>E){
        cout<<"kenjiro"<<endl;
    }else{
        cout<<"even"<<endl;
    }
    return 0;
}


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

int main()
{
    int n;  cin >> n;
    int p[n];

    rep(i,n)  cin >> p[i];

    int a = 0, b = 1, ans = 0;

    rep(i,n) {
        if (p[i] != i+1) {
            if (p[i] > i) {
                a = p[i] - (i+1);
            } else {
                b = (i+1) - p[i];
            }
            ans++;
        }
    }

    if (ans == 0)  cout << "YES" << endl;
    else if (a == b)  cout << "YES" << endl;
    else  cout << "NO" << endl;
}

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

#define mod 1000000007
#define INF (ll)9999999999999999

#define add emplace
#define pb emplace_back
#define eb emplace_back
#define all(x) begin(x), end(x)
#define len(x) ((int)(x).size())
#define exist(a, x) (a.find(x) != end(a))
#define log(x) cout << (x) << endl
#define rep(i, n) for (int i = 0; i < (int)n; ++i)
#define rrep(i,a,b) for (int i = (int)a; i >= (int)b; --i)
#define loop(i,a,b) for(int i = (int)(a); i < (int)(b); ++i)

using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using pi = pair<int,int>;
using vpi = vector<pi>;
using vstr = vector<string>;


int main() {
	int k;
	string s;
	cin>>s>>k;

	vstr vs;
	rep (i, s.size()) {
		loop(j, 1, k+1) {
			vs.pb(s.substr(i,j));
		}
	}

	sort(all(vs));
	unique(all(vs));

	log(vs[k-1]);

	return 0;
}





Measured memory_bytes: 1660
#include <iostream>
#include <vector>
using namespace std;
const int MOD = 1000000007;
 
int N, M;
vector<bool> issafe; // issafe[v] := v が壊れていないかどうか
 
int main() {
    cin >> N >> M;
    issafe.assign(N+1, true);
    for (int i = 0; i < M; ++i) {
        int a; cin >> a;
        issafe[a] = false; // a 段目は壊れてる
    }
  
  vector<int> dp(N+1, 0);
  
  dp[0] = 1;
  if(issafe[1]) dp[1] = 1;
  
  for(int n=2; n<N+1; n++){
    if(issafe[n-1]) dp[n] += dp[n-1];
    if(issafe[n-2]) dp[n] += dp[n-2];
    dp[n] %= MOD;
  }
  
  cout << dp[N] << endl;
}

Measured memory_bytes: 640
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <math.h>
#include <time.h>
#include <string>
#include <tuple>
#include <vector>
#include <map>
#include <list>
#include <set>
#include <stack>
#include <queue>
#include <cstdlib>
#include <algorithm>
#include <random>
#include <cassert>
using namespace std;
#define LL long long
#define MP(a, b) make_pair(a, b)
#define MMP(a, b, c) make_pair(make_pair(a, b), c)
#define MAX 1000000000
#undef INT_MIN
#undef INT_MAX
#define INT_MIN -2147483648
#define INT_MAX 2147483647
#define LL_MIN -9223372036854775808
#define LL_MAX 9223372036854775807
#define PI 3.14159265359

int main(){
    iostream::sync_with_stdio(false);

    int N;
    cin >> N;
    string S = to_string(N);
    int sum = 0;
    for(int i=0; i<S.size(); i++){
        sum += (S[i] - '0');
    }
    if(N % sum == 0) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] x = new int[n];
		for (int i = 0; i < x.length; i++) {
			x[i] = sc.nextInt();
		}
		sc.close();

		int ans = Integer.MAX_VALUE;
		for (int i = 1; i <= 100; i++) {
			int sum = 0;
			for (int j = 0; j < x.length; j++) {
				int val = x[j] - i;
				sum += val * val;
			}
			ans = Math.min(ans, sum);
		}
		System.out.println(ans);
	}
}


Measured memory_bytes: 23892
n = int(input())
A = list(map(int, input().split()))
A.sort()
A_max = A[-1]
dp = [1] * (A_max + 1)
ans = 0

for i in range(len(A)-1):
    p = A[i]
    if dp[A[i]] == 1:
        for j in range(A_max // p + 1):
            dp[j*p] = 0
        if A[i] != A[i+1]:
            ans += 1
            
if dp[A_max] == 1:
    ans += 1

print(ans)

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

int main() {
  int a,b;
  string s;
  cin>>a>>b>>s;
  bool ans=true;
  rep(i,a){
    if(s[i]=='-'){
      ans=false;
    }
  }
  if(s[a]!='-'){
    ans=false;
  }
  for(int i=a+1; i<a+b+1; i++){
    if(s[i]=='-'){
        ans=false;
    }
  }
  if(ans){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
}

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

int main() {

  int N; cin >> N;
  string S; cin >> S;
  int X = 0;
  int mx = 0;
  for (int i = 0; i < N; i++) {
    if (S.at(i) == 'I') {
      X++;
    }
    else {
      X--;
    }
    
    if (X > mx) {
      mx = X;
    }
  }
  cout << mx << endl;
        
    
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<(n); i++)
#define rep2(i,x,n) for(int i=x; i<(n); i++)
#define pb push_back
#define ALL(v) v.begin(),v.end()
const long long INF = 1LL << 60; // 仮想的な無限大の値;
using namespace std;
using ll = long long;
using P = pair<int, int>;
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; }
using Graph = vector<vector<int>>;
ll gcd(ll a, ll b)
{
    if(b ==0) return a;
    return gcd(b, a%b);
}
//ABC148 C Snack
int main()
{
    ll A, B;
    cin >> A >> B;
    ll X = gcd(A, B);
    cout << A*B/X << endl;
    return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <vector>
using namespace std;


int main(){
	/*input*/
	int s;
	cin >> s;

	/*calc*/
	int ans = 0;
	/*1,2の例外処理*/
	if(s == 1 || s == 2){
		cout << 4 <<endl;
		return 0;
	}
	int fn = s;
	while(fn > 1){
		if(fn % 2 == 0) fn /= 2;
		else{
			fn = 3*fn + 1;
		}
		ans++;
	}
	ans += 2;
    /*output*/
	cout<< ans <<endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
 
using namespace std;
 
int main()
{
  int N;
 
  cin >> N;
 
  int such[7];
  such[0] = 1;
  for(int i = 1; i < 7; i++) such[i] = such[i - 1] * 26;
 
  set< string > st[6];
 
  for(int i = 0; i < N; i++) {
    string S;
    cin >> S;
    for(int k = 0; k < S.size(); k++) {
      string FF;
      for(int l = 0; l < 5; l++) {
        if(k + l >= S.size()) break;
        FF += S[k + l];
        if(FF.size() == such[FF.size()]) continue;
        st[FF.size()].insert(FF);
      }
    }
  }
 
 
  for(int i = 1; i < 7; i++) {
    if(st[i].size() < such[i]) {
      string minimum = string(i, 'a');
      for(auto &s : st[i]) {
        if(minimum == s) {
          for(int j = minimum.size() - 1; j >= 0; j--) {
            minimum[j] = (minimum[j] - 'a' + 1) % 26 + 'a';
            if(minimum[j] != 'a') break;
          }
        } else {
          cout << minimum << endl;
          return (0);
        }
      }
      cout << minimum << endl;
      return (0);
    }
  }
}

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

int main(){
	int a,b;
	string s1,s2;
	cin>>s1>>s2;
	cin>>a>>b;
	cin>>s1;
	if(s1==s2){
		cout<<a<<" "<<b-1;
	}else{
		cout<<a-1<<" "<<b;
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include <string> 
using namespace std;
#define LL long long
const long long INF = 1LL << 60;
int main()
{

  LL N;
  LL A[100010];
  LL DP[100010];
  LL ans;
  cin>>N;
  for(int i=0;i<N;i++){
    cin>>A[i];
  }
  for(int i=0;i<N+2;i++){
    DP[i]=INF;
  }
  DP[0]=0;

  DP[1]=abs(A[1]-A[0]);
  for(int i=0;i<N;i++){
    DP[i+2]=min(DP[i+2],abs(A[i+2]-A[i])+DP[i]);
    DP[i+2]=min(DP[i+2],abs(A[i+2]-A[i+1])+DP[i+1]);
  }
  cout<<DP[N-1] << endl;
  return 0;
}


Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std;
const int N=4e5+10;
int gi() {
    int x=0,o=1;char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-') ch=getchar();
    if(ch=='-') o=-1,ch=getchar();
    while(ch>='0'&&ch<='9') x=x*10+ch-'0',ch=getchar();
    return x*o;
}
struct edge { int to,w,nxt; } e[N<<1];
int tot=0,h[N];
void adde(int u,int v,int w) {
    e[++tot]=(edge){v,w,h[u]};h[u]=tot;
    e[++tot]=(edge){u,w,h[v]};h[v]=tot;
}
int n,x,y,d[N][2],dis[N];
int fa[N],son[N],siz[N],dep[N],top[N];
bool win[N],vis[N];
void dfs(int u) {
    siz[u]=1;
    for(int i=h[u];i;i=e[i].nxt) {
        int v=e[i].to; if(v==fa[u]) continue;
        fa[v]=u; dep[v]=dep[u]+1; dfs(v);
        siz[u]+=siz[v]; if(siz[son[u]]<siz[v]) son[u]=v;
    }
}
void dfs2(int u,int tp) {
    top[u]=tp; if(son[u]) dfs2(son[u],tp);
    for(int i=h[u];i;i=e[i].nxt) {
        int v=e[i].to; if(v==fa[u]||v==son[u]) continue;
        dfs2(v,v);
    }
}
int lca(int u,int v) {
    while(top[u]!=top[v]) {
        if(dep[top[u]]<dep[top[v]]) swap(u,v);
        u=fa[top[u]];
    }
    return dep[u]<dep[v]?u:v;
}
int dist(int u,int v) { return dep[u]+dep[v]-2*dep[lca(u,v)]; }
void bfs() {
    queue<int> q;
    q.push(x);vis[x]=1;
    while(!q.empty()) {
        int u=q.front();q.pop();
        for(int i=h[u];i;i=e[i].nxt) {
            if(e[i].w==1||vis[e[i].to]) continue;
            int v=e[i].to; dis[v]=dis[u]+1;
            if(dis[v]<dep[v]) vis[v]=1,q.push(v);
        }
    }
}
int main() {
    cin>>n>>x>>y;
    for(int i=1;i<n;i++) d[i][0]=gi(),d[i][1]=gi();
    for(int i=1,u,v;i<n;i++) u=gi(),v=gi(),adde(u,v,1);
    dfs(y);dfs2(y,y);
    for(int i=1;i<n;i++) {
        int u=d[i][0],v=d[i][1];
        if(dist(u,v)>2) win[u]=win[v]=1;
        else adde(u,v,0);
    }
    bfs();
    int ans=0;
    for(int i=1;i<=n;i++)
        if(vis[i]) {
            if(win[i]) return puts("-1"),0;
            ans=max(ans,dep[i]*2);
        }
    printf("%d\n",ans);
    return 0;
}
//orzgzy
//鸡贼明年进队超稳


Measured memory_bytes: 31488
#include <iostream> 
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<iomanip>
#include<sstream>
#include<cmath>
//#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main() {
    int n, m;string s;
    cin >> n >> s >> m;
    rep(i, n) {
        if (s[i] != s[m - 1])
            s[i] = '*';
    }
    cout << s << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_map>
#include <functional>
#include <cstring>
#include <cmath>
#include <ctime>
#include <cstdlib>

using namespace std;
typedef long long llong;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<llong, llong> pll;

int h, w;
char grid[500][501];
char red[500][501];
char blue[500][501];
int main() {
    scanf("%d%d", &h, &w);
    for (int i = 0; i < h; ++i) {
        scanf("%s", grid[i]);
        for (int j = 0; j < w; ++j) {
            if (grid[i][j] == '#') {
                red[i][j] = '#';
                blue[i][j] = '#';
            }
            else {
                if (i == 0) red[i][j] = '#', blue[i][j] = '.';
                else if (i == h - 1) red[i][j] = '.', blue[i][j] = '#';
                else if (j % 2) red[i][j] = '#', blue[i][j] = '.';
                else red[i][j] = '.', blue[i][j] = '#';
            }
        }
    }
    for (int i = 0; i < h; ++i) printf("%s\n", red[i]);
    printf("\n");
    for (int i = 0; i < h; ++i) printf("%s\n", blue[i]);
	return 0;
}


Measured memory_bytes: 1408
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;
using vl = vector<ll>;
#define rep(i, n) for(ll i = 0;i < n;i++)
#define all(i) i.begin(), i.end()
template<class T, class U> bool cmax(T& a, U b) { if (a<b) {a = b; return true;} else return false; }
template<class T, class U> bool cmin(T& a, U b) { if (a>b) {a = b; return true;} else return false; }

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

  int n;
  cin >> n;
  vl h(n);
  rep(i, n) {
    cin >> h[i];
  }

  int ans = 0;
  int cnt = 1;
  rep(i, n-1) {
    if (h[i+1] <= h[i]) {
      cnt++;
    } else {
      cmax(ans, cnt);
      cnt = 1;
    }
  }
  cmax(ans, cnt);

  cout << ans-1 << endl;
}


Measured memory_bytes: 1024
#ifndef DEBUG
#    pragma GCC optimize("O3,no-stack-protector")
#    pragma GCC optimize("unroll-loops")

#    if __cplusplus < 201703L
#        pragma GCC target("avx")
#    else
#        pragma GCC target("avx2")
#    endif

#endif

#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define dump(x) cout << x << endl
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for (int i = 0, i##_len = (n); i < i##_len; ++i)
#define REP(i, n) for (int i = 0, i##_len = (n); i <= i##_len; ++i)
#define rep3(i, l, r) for (int i = l, i##_len = (r); i < i##_len; ++i)
#define REP3(i, l, r) for (int i = l, i##_len = (r); i <= i##_len; ++i)
#define UNIQUE(v) v.erase(unique(v.begin(), v.end()), v.end());
typedef int64_t Int;
typedef long double Ld;

using namespace std;
using Graph = vector<vector<Int>>;

const Ld pi = M_PI;
const Int MOD = 1000000007;
const Int INF = 1LL << 62;

Int Floor(Int a, Int b) {
    return (a - (a % b)) / b;
}

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

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

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

    string s, t;
    cin >> s >> t;

    int ss, tt;
    ss = s.size();
    tt = t.size();

    int ro = ss - tt + 1;
    int ans = 1 << 30;
    for (int i = 0; i < ro; i++) {
        int tem = 0;
        for (int j = 0; j < tt; j++) {
            if (t[j] != s[j + i]) {
                tem++;
            }
        }

        chmin(ans, tem);
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3648
#include <vector>
#include <math.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <queue>
#include <iomanip>
#include <deque>
#include <cctype>

using namespace std;
using uint = unsigned int;
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<long, long>;
template <class T> using V = vector<T>;
template <class T> using VV = V<V<T>>;
#define rep(i, n) for(int i = 0; i<n; i++)
#define rep_s(i, start, n) for(int i= start;  i<n; i++)
#define ALL(a) (a).begin(), (a).end()
#define ALL_str(a) (a).cbegin(), (a).cend()

string alphabet_upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";
string alphabet_lower  = "abcdefghijklmnopqrstuvwxyz";
string numbers = "0123456789";

/*
using edge = struct {int to; ll cost;};
vector<edge> tree[limit];
ll depth[limit];

void dfs(int v, int p, ll d){
  depth[v] = d;
  //cout <<"v: " << v << endl;
  for (auto &e: tree[v]){
    //cout << "e.to: " << e.to << endl;
    if (e.to == p) continue;
    dfs(e.to, v, d+e.cost);
  }
}
*/
int keta_sum(int num){
  int dig, sum = 0;
  while(num){
    dig = num % 10;
    sum = sum + dig;
    num = num / 10;
  }
  return sum;
}

ll binary_search(ll left_key, ll border, ll low, ll high) {
     // 配列 a の左端と右端
    ll mid = (low+high)/2;
    while (high > low+1) {
       mid = (low+high)/2;
        if (left_key*mid>border) high = mid;
        else if (left_key*mid<border) low = mid;
        else {
          mid =mid-1;
          break;
        }
    }
    return mid;
}


int main(void){
  ll N, A, B, W, H, C, D, Q, X, Y;
  string S, T;
  cin >> N;
  cout << N/3 << endl;

}


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

int main(){

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

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

ll dp[n][n]={{0}};

for(int i=n-1;i>=0;i--){
   for(int j=i;j<n;j++){
   	if(i==j){
   		dp[i][j]=arr[i];
   	}else{
   		dp[i][j] = max( arr[i] - dp[i+1][j] , arr[j] - dp[i][j-1] );
   	}
   }
}
cout<<dp[0][n-1];

}

Measured memory_bytes: 70656
//include
//------------------------------------------
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

#define SORT(c) sort((c).begin(),(c).end())
#define ANS(ans) cout<<(ans)<<endl;


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


int main() {
	
	int k, s;
	cin >> k >> s;

	int ans = 0;

	REP(x, k+1) {
		REP(y, k+1) {
			int z = s - x - y;
			if (0 <= z && z <= k) {
				ans++;
			}
		}
	}

	ANS(ans);


	return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>

void strReplace(std::string& str){
	const std::string wrong_word = "Hoshino";
	const std::string correct_word = "Hoshina";
	
	std::string::size_type pos = str.find(wrong_word, 0);
	
	while(pos != std::string::npos){
		str.replace(pos, wrong_word.length(), correct_word);
		pos = str.find(wrong_word, pos+correct_word.length());
	}
}

int main(){
	int n;
	std::cin >> n;
	std::cin.ignore();
	
	for(int i=0; i<n; ++i){
		std::string str;
		std::getline(std::cin, str);
		strReplace(str);
		std::cout << str << std::endl;
	}
	
	return 0;
}

Measured memory_bytes: 1220
#include <bits/stdc++.h>
#define mod 1000000007
#define ll long long int
using namespace std;
 
int main(){
    ios_base::sync_with_stdio(false);
    string s,t;
    cin >>s>>t;
    int i,ans=INT_MAX,n=s.size(),m=t.size();
    for(i=0;i<n-m+1;i++){
        int cng=0;
        for(int j=0;j<m;j++){
            if(s[i+j]!=t[j]) cng++;
        }
        ans=min(cng,ans);
    }
    cout <<ans<<endl;
}   

Measured memory_bytes: 3644
#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
using namespace std;
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1e9;
const ll MOD = 1e9 + 7;
const double PI = acos(-1);


int main(){
    double a, b, x;
    cin >> a >> b >> x;
    x /= a*a;
    double y = 2*x - b;
    double t = (b - y) / a;
    if(y <= 0){
        double s = x*a;
        y = (2*s) / b;
        t = b/y;
    }
    double ans = atan(t) * 180.0 / PI;
    cout << fixed<< setprecision(9) << ans << endl;
}

Measured memory_bytes: 384
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
#include <complex>
#include <map>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8
#define F first
#define S second

static const double PI=6*asin(0.5);
typedef long long ll;
typedef complex<double> CP;
typedef pair<long long,int> P;
static const int INF=1<<24;
int main(){
	int r,c;
	while(cin>>r>>c,!(r==0&&c==0)){
		if(r%2==0||c%2==0) cout<<"yes\n";
		else cout<<"no\n";
	}
	return 0;
}

Measured memory_bytes: 1116
#include <stdio.h>
int N;

void Process(int A[ ], int n){
	int i;
	for(i=0;i<n-1;i++)
		printf("%d ",A[i]);
	/*while(n>1){
		printf("%da", *A++);
	n--;
}*/
	printf("%d\n",A[i]);
}

void InsertionSort(int A[ ], int n){
	int i,j,v;
	for(i=1;i<n;i++){
		v = A[i];
		for(j = i; j > 0 && A[j-1] > v; j--)
			A[j] = A[j-1];
		A[j] = v;
		Process(A, N);

	}
}



int main(void){
	int i;
	scanf("%d",&N);
	int A[100];
	for(i=0;i<N;i++)
		scanf("%d",&A[i]);
	Process(A, N);
	InsertionSort(A, N);
	
	
	return 0;


}

Measured memory_bytes: 1796
#include<stdio.h>
int main(void){
int i,n;
int number;
long long int sum=0;
int min=0;
int max=0;

scanf("%d",&n);

for(i=0;i<n;i++){
scanf("%d",&number);

if(i==0){
min = number;
max = number;
}
if(number<min) min = number;
if(number>max) max = number;

sum += number;
}
printf("%d %d %lld\n",min,max,sum);

return 0;
}

Measured memory_bytes: 600
#include<stdio.h>
int main(void)
{
    int H,W,i,j;
    while(1){
        scanf("%d %d",&H ,&W);
        if(H == 0 && W == 0){
            break;
        }
    for(i=1;i<=H;i++){
        for(j=1;j<=W;j++){
          if((i+j) % 2 == 0)
        {
             printf("#");
        }else {
             printf(".");
        }
                }
      printf("\n");
    }
  printf("\n");
     
       }
  return 0;
    }



Measured memory_bytes: 2148
#include <bits/stdc++.h>
using namespace std;
int h,w;
int c[1410][1410];

int max_side = 0; //見つかっている最大の正方形の1辺
int sum[1410][1410]; //(0, 0)と(i, j)を対角の頂点とする長方形に含まれる汚れたタイルの個数.

int calc(int i,int j){ //(i, j)から右下に進んでいく.
	
	for(int k = max_side; i + k + 1 <= h and j + k + 1 <= w; k++){
		
		if(sum[i + k + 1][j + k + 1] - sum[i + k + 1][j] - sum[i][j + k + 1] + sum[i][j] >= 1) break;
		//包除原理で汚れたタイルがあるかを確認, あったら1以上になるので更新をやめる.
		
		max_side += 1;
		//汚れたタイルがないのでmax_sideを更新
	}
	
	return 0;
}

int main(){
	//入力
	cin >> h >> w;
	for(int i=0;i<h;i++) for(int j=0;j<w;j++) cin >> c[i][j];

	//累積和
	for(int i=0;i<h;i++) for(int j=0;j<w;j++) sum[i + 1][j + 1]	= c[i][j];
	for(int i=0;i<h;i++) for(int j=0;j<=w;j++) sum[i + 1][j] += sum[i][j];
	for(int i=0;i<=h;i++) for(int j=0;j<w;j++) sum[i][j + 1] += sum[i][j];
	
	//探索
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			if(c[i][j] == '1') continue; //汚れているので
			calc(i, j);
		}
	}
	
	//出力
	cout << max_side * max_side << endl;
	return 0;
}



Measured memory_bytes: 18532
<?php
$a = [];
fscanf(STDIN, "%d", $N);
fscanf(STDIN, "%d", $a[]);
fscanf(STDIN, "%d", $a[]);
fscanf(STDIN, "%d", $a[]);
fscanf(STDIN, "%d", $a[]);
fscanf(STDIN, "%d", $a[]);
$min = min($a);
echo intdiv($N, $min) + ($N % $min !== 0) + 4;


Measured memory_bytes: 4728
s = input()
y, m, d = map(int, s.split('/'))
f = False
(
    Heisei,
    TBD,
)= (
    'Heisei',
    'TBD',
)
if y < 2019:
    print(Heisei)
elif y == 2019:
    if(m < 4):
        print(Heisei)
    elif m == 4:
        if(d <= 30):
            print(Heisei)
        else :
            print(TBD)
    else :
        print(TBD)
else :
    print(TBD)

Measured memory_bytes: 3064
import sys, os

f = lambda:list(map(int,input().split()))
if 'local' in os.environ :
    sys.stdin = open('./input.txt', 'r')

def solve():
    a,b = f()
    if a == b:
        print("Draw")
    elif a == 1:
        print("Alice")
    elif b == 1:
        print("Bob")
    elif a>b:
        print("Alice")
    else:
        print("Bob")

solve()


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

int main() {
  int ans=0,c=0,temp=0,n=0;
  string S,T;
  cin >> S >> T;
  int s=S.size(),t=T.size();

  n = s-t+1;
  ans = t;
  int i,j;
  while(n){
    n--;
    i=c;
    c++;
    j=0;

    temp=0;
    for(i;i<s;i++){
      for(j;j<t;j++){
        if(S.at(i) == T.at(j)){
          break;
        }else{
          temp++;
          break;
        }
      }
      j++;
    }

    ans = min(ans,temp);
  }

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

Measured memory_bytes: 3660
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;
using namespace std;
typedef tree<pair<int,int>,null_type,less<pair<int,int>>,rb_tree_tag,tree_order_statistics_node_update> oset;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
	*this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
using ll = long long;

void test_case(){
	int n; cin >> n;
	int j = n%10;
	if(j==2 || j==4 || j==5 || j==7 || j==9)
		cout<<"hon";
	else if(j==0 || j==1 || j==6 || j==8)
		cout<<"pon";
	else
		cout<<"bon";
}
 
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int T=1;
	//~ cin >> T;
	while(T--){
		test_case();
	}
	return 0;
}


Measured memory_bytes: 3612
#include <bits/stdc++.h>
using namespace std;
int main() {
 
    int N;

    cin >>N;
    vector<int> vec(N);  
   
    for (int i=0;i < N;i++){
     
    cin >>vec.at(i);
    }
    
    for (int i =0;i<N;i++){
        
        if(vec.at(i)%2==0 && vec.at(i)%3 !=0 && vec.at(i)%5 !=0)
        {
       cout <<"DENIED"<< endl;
            
                  return 0; 
        }
      
          
       }
    
   
        
          cout <<"APPROVED" <<endl;
          return 0; 
           
}


Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <sstream>
#include <unordered_map>
#include <vector>


#define INF 4000000000000000000LL
#define MOD 1000000007
#define ALL(x) std::begin(x), std::end(x)


int main(int argc, char** argv)
{
  std::cin.tie(0);
  std::ios_base::sync_with_stdio(0);

  std::cout << std::fixed << std::setprecision(6);
  std::cerr << std::fixed << std::setprecision(6);

  std::string S;

  std::cin >> S;

  if (S == "Sunny") {
    std::cout << "Cloudy" << std::endl;
  }
  else if (S == "Cloudy") {
    std::cout << "Rainy" << std::endl;
  }
  else {
    std::cout << "Sunny" << std::endl;
  }
  
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define fi first
#define se second
#define pb push_back
#define mod 1000000007
#define repf(i,a,b) for(ll i=a;i<b;i++)
#define repb(i,a,b) for(ll i=a;i>=b;i--)
#define mp make_pair
#define all(v) v.begin(),v.end()
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);

using namespace std;

ll power(ll a, ll n)
{
    ll ans=1;
    while(n)
    {
        if(n&1) ans*=a;
        a*=a;
        n>>=1;
    }
    return ans;
}

ll v[301][301];

int main()
{
    IOS;
    ll n,m,l;
    cin>>n>>m>>l;
    repf(i,1,n+1)
    {
        repf(j,1,n+1)
        {
            if(i==j) v[i][j]=0;
            else v[i][j]=1e18;
        }
    }
    repf(i,0,m)
    {
        ll a,b,c;
        cin>>a>>b>>c;
        v[a][b]=v[b][a]=c;
    }
    repf(k,1,n+1)
    {
        repf(i,1,n+1)
        {
            repf(j,1,n+1)
            {
                v[i][j]=min(v[i][j],v[i][k]+v[k][j]);
            }
        }
    }
    repf(i,1,n+1)
    {
        repf(j,1,n+1) 
        {
            if(v[i][j]<=l) v[i][j]=1;
            else v[i][j]=1e18;
        }
    }
    repf(k,1,n+1)
    {
        repf(i,1,n+1)
        {
            repf(j,1,n+1)
            {
                v[i][j]=min(v[i][j],v[i][k]+v[k][j]);
            }
        }
    }
    ll q;
    cin>>q;
    while(q--)
    {
        ll s,t;
        cin>>s>>t;
        if(v[s][t]>=1e18) cout<<-1<<endl;
        else cout<<v[s][t]-1<<endl;
    }
    return 0;  
}

Measured memory_bytes: 1280
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:https://atcoder.jp/contests/abc141/tasks/abc141_a>
 問題文============================================================
 =================================================================
 解説=============================================================
 A - Weather Prediction
 
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    map<char,string> mp;
    mp['S'] = "Cloudy";
    mp['C'] = "Rainy";
    mp['R'] = "Sunny";
    
    string S; cin >> S;
    res = mp[S.front()];
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<string>() << endl;
    return 0;
}


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

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

    int DP[N+1];
    for(int i = 1; i <= N; i++) DP[i] = 0;

    vector<int> in[N+1], out[N+1], d(N+1, 0);

    int x, y;
    for(int i = 1; i <= M; i++)
    {
        cin >> x >> y;
        in[y].push_back(x);
        out[x].push_back(y);
        d[y]++;
    }

    queue<int> q;
    for(int i = 1; i <= N; i++) if(d[i] == 0) q.push(i);

    int u;
    while(!q.empty())
    {
        u = q.front();
        q.pop();

        for(int v: in[u]) DP[u] = max(DP[u], DP[v] + 1);
        for(int v: out[u])
        {
            d[v]--;
            if(d[v] == 0) q.push(v);
        }
    }

    int res = 0;
    for(int i = 1; i <= N; i++) res = max(res, DP[i]);
    cout << res << '\n';
}

Measured memory_bytes: 11904
fun main(args: Array<String>) {
    val s = readInputLine()
    println(if (isKai(s) && isKai(s.substring(0, ((s.length - 1) / 2))) && isKai(s.substring((s.length + 3) / 2 - 1, s.length))) "Yes" else "No")
}

fun readInputLine(): String {
    return readLine()!!
}

fun isKai(s: String): Boolean {
    var l = 0
    var r = s.length - 1
    while (l < r) {
        if (s[l] != s[r]) {
            return false
        }
        l++
        r--
    }
    return true
}



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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define rep3(i,m,n) for(int (i)=m;(i)<=(n);(i)++)
#define rep3rev(i,m,n) for(int (i)=m;(i)>=(n);(i)--)
#define all(a) (a.begin()),(a.end())
#define rall(a) (a.rbegin()),(a.rend())
#define fi first
#define se second
#define pb push_back
#define eb emplace_back

using ll = long long;
using vll = vector<ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using P = pair<int, int>;
using Pll = pair<ll, ll>;

void Main(){
    int n; cin >> n;
    vector<Pll> z(n);
    rep(i, n){
        cin >> z[i].fi >> z[i].se;        
    }
    sort(all(z), [&](P x, P y){
        return x.fi + x.se < y.fi + y.se;    
    });
    
    // dp[i][j] = i ⼈⽬まで⾒て j ⼈選んだときの P の和の最⼩値
    // dp[i+1][j] = min(dp[i][j], dp[i][j-1]+P[i])
    const ll INF = 1e18;
    vector<vll> dp(n+5, vll(n+5, INF));
    
    rep3(i, 0, n-1){
        rep3(j, 0, i){
            // cout << i << " " << j << endl;
            if(j == 0) dp[i][j] = 0;
            if(dp[i][j] > z[i].fi) dp[i+1][j+1] = dp[i][j+1]; 
            else dp[i+1][j+1] = min(dp[i][j+1], dp[i][j] + z[i].se);
        }
    }

    int ans = 0;
    rep(i, n+1) if(dp[n][i] != INF) ans = i;
    cout << ans << endl;
    return;
}

int main(){
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}

Measured memory_bytes: 199064
#include <bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n",(x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define isYes(x) printf("%s\n",(x) ? "Yes" : "No")
#define isIn(x,y,h,w) (x >= 0 && x < h && y >= 0 && y < w)

#define int long long
//using ll = long long;
using P = pair<int,int>;

ostream &operator<<(ostream &os,const P &p){ return os << "(" << p.first << "," << p.second << ")"; }
template<class T>
ostream &operator<<(ostream &os,const vector<T> &v){
	for(int i = 0;i < v.size();i++) os << (i ? "," : "[") << v[i];
	os << "]";
	return os;
}

template<class T> T &chmin(T &a,const T &b){ return a = min(a,b); }
template<class T> T &chmax(T &a,const T &b){ return a = max(a,b); }

const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;

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

int x,y,a,b,c,p[100010],q[100010],r[100010];

int calc(int k){
	int nx = 0,ny = 0,z = 0;
	for(int i = 0;i < a;i++){
		if(p[i] >= k) nx++;
	}
	for(int i = 0;i < b;i++){
		if(q[i] >= k) ny++;
	}
	for(int i = 0;i < c;i++){
		if(r[i] >= k) z++;
	}
	if(nx < x){
		int d = min(x - nx,z);
		z -= d; nx += d;
	}
	if(ny < y){
		int d = min(y - ny,z);
		z -= d; ny += d;
	}
	chmin(nx,x);
	chmin(ny,y);
	return nx + ny;
}

signed main(){
	cin >> x >> y >> a >> b >> c;
	for(int i = 0;i < a;i++) cin >> p[i];
	for(int i = 0;i < b;i++) cin >> q[i];
	for(int i = 0;i < c;i++) cin >> r[i];
	int ok = 0,ng = INF;
	while(ng - ok > 1){
		int mid = (ng + ok) / 2;
		if(calc(mid) >= x + y) ok = mid;
		else ng = mid;
	}
	sort(p,p + a,greater<int>());
	sort(q,q + b,greater<int>());
	sort(r,r + c,greater<int>());
	int ans = 0,nx = 0,ny = 0;
	for(int i = 0;i < x;i++){
		if(p[i] >= ok) ans += p[i],nx++;
	}
	for(int i = 0;i < y;i++){
		if(q[i] >= ok) ans += q[i],ny++;
	}
	for(int i = 0;i < x + y - nx - ny;i++){
		if(r[i] >= ok) ans += r[i];
	}
	ans += ng * (x + y - calc(ok));
	cout << ans << endl;
}


Measured memory_bytes: 2560
using System;
using System.Linq;

class Program
{
    static void Main()
    {
        int[] dts = null;
        string r = "";

        while(true)
        {
            // 0:H, 1:W
            dts = Console.ReadLine().Split(' ').Select(s => int.Parse(s)).ToArray();

            if (dts[0] == 0 && dts[1] == 0) break;

            for (int i = 0; i < dts[0]; i++)
            {
                r = "";

                for (int j = 0; j < dts[1]; j++)
                {
                    r += "#";
                }

                Console.WriteLine(r);    
            }

            Console.WriteLine("");
        }
    }
}


Measured memory_bytes: 9568
use io::*;

fn main() {

    let con = read_string();
    let mut sc = Scanner::new(&con);

    let n: usize = sc.next();
    let mut s: Vec<usize> = sc.next_vec(n);

    let mut ans: usize = 0;
    let mut flag: bool = false;
    loop {
        for i in 0..n {
            if s[i] % 2 == 0 { s[i] /= 2; }
            else {
                println!("{}", ans);
                flag = true;
                break;
            }

        }
        ans += 1;
        if flag { break; }
    }


}

pub mod io {

    use std;
    use std::str::FromStr;

    pub struct Scanner<'a> {
        iter: std::str::SplitWhitespace<'a>,
    }

    impl<'a> Scanner<'a> {
        pub fn new(s: &'a str) -> Scanner<'a> {
            Scanner {
                iter: s.split_whitespace(),
            }
        }

        pub fn next<T: FromStr>(&mut self) -> T {
            let s = self.iter.next().unwrap();
            if let Ok(v) = s.parse::<T>() {
                v
            } else {
                panic!("Parse error")
            }
        }

        pub fn next_vec_len<T: FromStr>(&mut self) -> Vec<T> {
            let n: usize = self.next();
            self.next_vec(n)
        }

        pub fn next_vec<T: FromStr>(&mut self, n: usize) -> Vec<T> {
            (0..n).map(|_| self.next()).collect()
        }
    }

    pub fn read_string() -> String {
        use std::io::Read;

        let mut s = String::new();
        std::io::stdin().read_to_string(&mut s).unwrap();
        s
    }

    pub fn read_line() -> String {
        let mut s = String::new();
        std::io::stdin().read_line(&mut s).unwrap();
        s.trim_right().to_owned()
    }
}

Measured memory_bytes: 4352
from collections import Counter
N, X, Y = map(int, input().split())
X, Y = X-1, Y-1
ans = []

for i in range(N):
    for j in range(i+1, N):
        ans.append(min(j-i, 1+abs(i-X)+abs(j-Y)))

c = Counter(ans)
for i in range(1,N):
    print(c[i])


Measured memory_bytes: 114700
#include<iostream>
#include<string>
using namespace std;
int main()
{
    string s = "Sunny";
    string c = "Cloudy";
    string r = "Rainy";
    string x;
    cin >> x;
    if(x==s)
        cout << c;
    else if(x==c)
        cout << r;
    else
        cout << s;
}


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

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

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

const double eps = 1e-10;

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

const int64 mod = 1e9+7;

using Row = vector<int64>;
using Mat = vector<Row>;

int64 N, K;
vector<int64> a;
Mat dp(110, Row(112345, 0));

int64 sum(Row& a, int32 l, int32 r){ // a[l, r)
	int64 rr = r > K ? a[K] : a[r-1];
	int64 ll = l <= 0 ? 0 : a[l-1];
	return ((rr-ll)%mod+mod)%mod;
}

int main(void){
	cin >> N >> K;
	a.resize(N);
	REP(i, N) cin >> a[i];

	dp[0][K] = 1;
	REP(i, N){
		REP(j, K){
			(dp[i][j+1] += dp[i][j]) %= mod;
		}
		REP(j, K+1){
			dp[i+1][j] = (dp[i+1][j] + sum(dp[i], j, j+a[i]+1))%mod;
		}
	}
	cout << dp[N][0] << endl;
}


Measured memory_bytes: 97920
from copy import deepcopy

HEIGHT, WIDTH, K = map(int, input().split())
CELLS = [list(input()) for i in range(HEIGHT)]

ans = 0

for maskY in range(1<<HEIGHT):
  for maskX in range(1<<WIDTH):
    black=0
    for y in range(HEIGHT):
      for x in range(WIDTH):
        if (maskY >> y & 1) == 0 and (maskX >> x & 1) == 0 and CELLS[y][x] == '#':
          black+=1
    if K == black:
      ans+=1


print(ans)


Measured memory_bytes: 9288
#include <iostream>
#include <vector>
#include <array>
#include <stack>
#include <queue>
#include <algorithm>

int main ()
{
  int A, B, C;

  std::cin >> A >> B >> C;

  if (A == B)
    {
      if (A == C)
        std::cout << "No\n";
      else
        std::cout << "Yes\n";
    }
  else
    {
      if ((A==C) || (B==C))
        std::cout << "Yes\n";
      else
        std::cout << "No\n";
    }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,c) for(int i=0;i<c;++i)
int  main(){
int a,b;
cin >> a>> b;
int count =0;
vector<int>c(a);
rep(i,a){
    cin >> c[i];
}
int d = 0;
for(int i=0;i<a+1;i++){
    if(d<=b){
      count++;
      d = d+c[i];
    }
}
cout << count << endl;
return 0;
}

Measured memory_bytes: 256