akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n;cin>>n;
  vector<int64_t>l(n);
  for(int i=0;i<n;i++){
    cin>>l.at(i);
  }
  int ans=0;
  sort(l.begin(),l.end());
  for(int i=0;i<n-2;i++){
    for(int j=i+1;j<n-1;j++){
      for(int k=j+1;k<n;k++){
        if(l.at(i)+l.at(j)>l.at(k)){
          if(l.at(i)!=l.at(j)&&l.at(j)!=l.at(k))ans++;
        }
      }
    }
  }
  cout<<ans<<endl;
}

Measured memory_bytes: 3632
package main

import "fmt"

func main(){
	var S string
	var count int
	count = 0
	fmt.Scan(&S)

	
	if S[0] == '0' {
		for i := 0 ; i < len(S) ; i++ {
			if i % 2 == 0{
				if S[i] != '0'{
					count++
				}
			}else {
				if S[i] != '1'{
					count++
				}
			}
		}
	}else {
		for i := 0 ; i < len(S) ; i++ {
			if i % 2 == 1{
				if S[i] != '0'{
					count++
				}
			}else {
				if S[i] != '1' {
					count++
				}
			}
		}
	}
	fmt.Println(count)
}

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

using namespace std;
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (n); i++)
#define chmin(x, y) (x) = min((x), (y))
#define chmax(x, y) (x) = max((x), (y))
#define endl "\n"
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

template <typename T> ostream &operator<<(ostream &os, const vector<T> &vec) {os << "["; for (const auto &v : vec) {os << v << ","; } os << "]"; return os;}
template <typename T, typename U> ostream &operator<<(ostream &os, const pair<T, U> &p) {os << "(" << p.first << ", " << p.second << ")"; return os;}

const int mod = 1e9 + 7;

void solve() {
    string s;
    cin >> s;
    int N = s.size();
    vector<vector<int>> dp(N + 1, vector<int>(13));
    dp[0][0] = 1;

    for(int i = 0; i < N; i++) {
        for(int j = 0; j < 13; j++) {
            if (s[i] == '?') {
                for (int k = 0; k < 10; k++) {
                    int nextm = (j * 10 + k) % 13;
                    dp[i + 1][nextm] += dp[i][j];
                    dp[i + 1][nextm] %= mod;
                }   
            } else {
                int nextm = (j * 10 + s[i] - '0') % 13;
                dp[i + 1][nextm] += dp[i][j];
                dp[i + 1][nextm] %= mod;
            }
        }
    }
    cout << dp[N][5] << endl;

}

int main() {
    #ifdef LOCAL_ENV
    cin.exceptions(ios::failbit);
    #endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout.setf(ios::fixed);
    cout.precision(16);
    
    solve();
}

Measured memory_bytes: 8912
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <climits>
#include <cstdlib>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define DEBUG 1
using namespace std;
constexpr int kMod = 1000000007;
typedef long long LL;
typedef pair<LL, LL> P;

int main() {
  LL N, K; cin >> N >> K;
  priority_queue<P> que;
  priority_queue<LL, vector<LL>, greater<LL>> que2;

  for (LL i = 0; i < N; ++i) {
    LL t, d; cin >> t >> d;
    que.push({d, t});
  }

  LL score = 0LL;
  set<LL> used;
  for (int i = 0; i < K; ++i) {
    auto [d, t] = que.top(); que.pop();
    score += d;
    if (used.count(t)) {
      que2.push(d);
    } else {
      used.insert(t);
    }
  }

  LL size = used.size();
  score += size * size;

  LL max_score = score;
  while (!que.empty() && !que2.empty()) {
    auto [d, t] = que.top(); que.pop();
    if (used.count(t)) continue;
    used.insert(t);

    LL d2 = que2.top(); que2.pop();
    size = used.size();
    score = score - d2 + d + size * size - (size - 1) * (size - 1);
    max_score = max(max_score, score);
  }
  cout << max_score << endl;
}


Measured memory_bytes: 8080
#include <bits/stdc++.h>
using namespace std;
#define REP(i,N) for(i=0;i<N;i++)
#define MAX_I INT_MAX //1e9
#define MIN_I INT_MIN //-1e9
#define MAX_UI UINT_MAX //1e9
#define MAX_LL LLONG_MAX //1e18
#define MIN_LL LLONG_MIN //-1e18
#define MAX_ULL ULLONG_MAX //1e19
  typedef long long ll;
  typedef pair<int,int> PII;
  typedef pair<char,char> PCC;
  typedef pair<ll,ll> PLL;
  typedef pair<char,int> PCI;
  typedef pair<int,char> PIC;
  typedef pair<ll,int> PLI;
  typedef pair<int,ll> PIL;
  typedef pair<ll,char> PLC;
  typedef pair<char,ll> PCL;

int main(void){
  int D,N; cin >> D >> N; 
  int ans = N;
  if(N==100) ans++;
  int i;REP(i,D)ans*=100;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
public class Main{
  public static long[][] memo;
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int W = sc.nextInt();
    memo = new long[N][W+1];
    for(int i = 0; i < N; i++){
      Arrays.fill(memo[i], -1);
    }
    int[] w = new int[N];
    long[] v = new long[N];
    for(int i = 0; i < N; i++){
      w[i] = sc.nextInt();
      v[i] = sc.nextLong();
    }
    System.out.println(solve(w, v, W));
  }
  
  public static long func(int W, int wn, int[] wa, long[] va, int n){
    if(n == wa.length) return 0;
    if(memo[n][wn] != -1) return memo[n][wn];
    if(wa[n] <= wn){
      long tmp = Math.max(va[n] + func(W, wn-wa[n], wa, va, n+1),
                    func(W, wn, wa, va, n+1));
      memo[n][wn] = tmp;
      return tmp;
    }
    return func(W, wn, wa, va, n+1);
  }
  
  public static long solve(int[] w, long[] v, int W){
    return func(W, W, w, v, 0);
  }
}

Measured memory_bytes: 125804
#include "bits/stdc++.h"
using namespace std;
int main() {
	long long N, Q;
	cin >> N;
	vector<long long>A(N);
	vector<long long>have(200000, 0);
	long long sum = 0;
	for (long long i = 0; i < N; i++) {
		cin >> A.at(i);
		have.at(A.at(i))++;
		sum += A.at(i);
	}
	cin >> Q;

	for (long long i = 0; i < Q; i++) {
		long long B, C; cin >> B >> C;
		sum += (C - B) * have.at(B);
		have.at(C) += have.at(B);
		have.at(B) = 0;
		cout << sum << endl;
	}
}

Measured memory_bytes: 5632
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>
#include <cstring>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define MOD 1000000007 //10^9+7
using namespace std;
using ll = long long;
using PII = pair<int, int>;
using PLL = pair<ll, ll>;
const int INF = numeric_limits<int>::max();
const ll INFL = numeric_limits<ll>::max();


// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
    long long res = val % m;
    if (res < 0) res += m;
    return res;
}

//greatest common divisor
long long gcd(ll a, ll b) 
{
    if (a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}

//least common multiple
long long lcm(ll a, ll b)
{
    return a / gcd(a, b) * b ;
}

ll factorial(ll n) {
    ll res = 1;
    for (ll i = 1; i <= n; i++) {
        res *= i;
    }
    return res;
}

bool fn_is_prime(ll n) {
    for (ll i = 2; i * i <= n; i++) {
        if (n % i == 0) return false;
    }
    return n != 1;
}

bool isOK(int index, int key, vector<ll>& a) {
    if (a[index] >= key) return true;
    else return false;
}

int binary_search(int key, vector<ll>& a) {
    int ng = -1;
    int ok = a.size();

    while (abs(ok - ng) > 1) {
        int mid = (ok + ng) / 2;

        if (isOK(mid, key, a)) ok = mid;
        else ng = mid;
    }
    return ok;
}

int main()
{
    int n; string s, t; cin >> n >> s >> t;
    
    int ans = 0;
    rep(i,n) {
        if (s.substr(i) == t.substr(0, n-i)) {
            ans = n + i;
            break;
        }
    }
    if (ans == 0)
        ans = n*2;
    cout << ans << endl;
}


Measured memory_bytes: 3636
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, s, n) for (int i = s; i < (int)(n); i++)
#define out(x) cout << x << endl
#define INF 1000000;
#include <map>
#include <math.h>
 
using ll = long long;
using namespace std;

ll n, k;
const ll mod = 1000000007;



int main(){
    int k;
    cin >> k;
    out((k/2)*((k+1)/2));
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
main()
{
   int i,j,k,l;
    while(cin>>l){
   j=l/100;
   k=l%100;
   if(j<=12&&k<=12&&j!=0&&k!=0) cout<<"AMBIGUOUS"<<endl;
   else if(j<=12&&j!=0) cout<<"MMYY"<<endl;
   else if(k<=12&&k!=0) cout<<"YYMM"<<endl;
   else  cout<<"NA"<<endl;
    } return 0;

}


Measured memory_bytes: 256
from collections import deque
N, X, Y = [int(i) for i in input().split()]
X -= 1
Y -= 1
G = [[] for _ in range(N)]
for i in range(N):
    if i!=0: G[i].append(i-1)
    if i!=N-1: G[i].append(i+1)
G[X].append(Y)
G[Y].append(X)


def bfs(G, N, s):
    dist = [-1]*N
    que = deque([s])
    dist[s] = 0
    while que:
        v = que.popleft()
        d = dist[v]
        for w in G[v]:
            if dist[w] > -1:
                continue
            dist[w] = d + 1
            que.append(w)
    return dist

res = [0]*(N+1)
for i in range(N):
    d = bfs(G, N, i)
    for j in range(i+1, N):
        res[d[j]] += 1

for i in range(1, N):
    print(res[i])

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

int main() {
    int r,c;
    int** total;

    cin >> r >> c;
    total = new int*[r+1]();
    total[r] = new int[c+1]();

    for(int i=0;i<r;i++)
    {
      int sum = 0;
      total[i] = new int[c+1]();
      for(int j=0;j<c;j++)
      {
        int x;
        cin >> x;
        total[i][j] = x;
        sum += x;
        total[r][j] += x;
      }
      total[i][c] = sum;
      total[r][c] += sum;
    }

    for(int i=0;i<r+1;i++)
    {
      for(int j=0;j<c+1;j++)
      {
          cout << total[i][j];
          if(j<c)
              cout << " ";
      }
      cout << endl;
    }

    for(int i=0;i<r+1;i++)
      delete [] total[i];

    delete [] total;
}

Measured memory_bytes: 3108
/*---------------------------------

 @Author:   Dicer
 @DateTime: 2019-01-11 19:41:55

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

#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;
#define clr(s, x) memset(s, x, sizeof(s))
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
#define debug(...) cerr<<"["<<#__VA_ARGS__":"<<(__VA_ARGS__)<<"]"<<"\n"
inline int read(){int r=0;char c=getchar();while(c<'0'||c>'9') {c=getchar();}while(c>='0'&&c<='9') {r=r*10+c-'0';c=getchar();}return r;}
inline ll readll(){ll r=0;char c=getchar();while(c<'0'||c>'9') {c=getchar();}while(c>='0'&&c<='9') {r=r*10+c-'0';c=getchar();}return r;}
inline ll qpow(ll a,ll b,ll mod){ll res=1;while(b){if(b&1)res = (res*a)%mod;a=(a*a)%mod;b>>=1;}return res;}
inline ll gcd(ll a,ll b){while(b^=a^=b^=a%=b);return a;}
const double eps = 1e-8;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
const int INF = 0x3f3f3f3f;
const int mod = 998244353;
const int MAXN = 1e5;
const int MAXM = 1e5;

int a[MAXN+7], dp[MAXN+7];
int main(int argc, char const *argv[])
{
	int n, k;
	cin >> n >> k;
	for(int i=1;i<=n;++i)	cin >> a[i];
	clr(dp, 0x3f);
	dp[1] = 0;
	for(int i=2;i<=n;++i){
		for(int j=1;j<=k && i>j;++j){
			dp[i] = min(dp[i], dp[i-j]+abs(a[i-j]-a[i]));
		}
	}
	printf("%d\n", dp[n]);
	return 0;
}

Measured memory_bytes: 1024
#include <set>
#include <map>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <bitset>
#include <string>
#include <cstdio>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <algorithm>
#define mk make_pair
#define pb push_back
#define fi first
#define se second
#define REP(i, x, y) for(int i = (int)x; i <= (int)y; i ++)
#define FOR(i, x, y) for(int i = (int)x; i <  (int)y; i ++)
#define PER(i, x, y) for(int i = (int)x; i >= (int)y; i --)
#define trace(x) cerr << #x << " " << x << endl;
#define dprintf(...) fprintf(stderr, __VA__ARGS__)
#define dln()        fprintf(stderr, "\n")
using namespace std;
typedef long long LL;
typedef long double db;
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<PII> VPI;
const	int N = 500005;
const	int P = 1e9 + 7;
const	int inf = 1e9;
const	LL Inf = 1e15;

inline int IN(){
	char ch = getchar(); int x = 0, f = 0;
	while(ch < '0' || ch > '9') ch = getchar(), f = (ch == '-');
	while(ch >= '0' && ch <= '9'){
		x = (x << 1) + (x << 3) + ch - 48;
		ch = getchar();
	}
	return f ? (-x) : x;
}

inline int Pow(int x, int y, int p){
	int an = 1;
	for(; y; y >>= 1, x = (LL)x * x % p) if(y & 1) an = (LL)an * x % p;
	return an;
}

void renew(int &x, int y){
	x += y;
	if(x < 0) x += P;
	else if(x >= P) x -= P;
}

template<typename T> inline void chkmin(T &a, const T &b) {if(a > b) a = b;}
template<typename T> inline void chkmax(T &a, const T &b) {if(a < b) a = b;}

int n, Q;
char str[N];
int nxt[N][30], fa[21][N];

int main(){
	scanf("%s", str + 1);
	n = strlen(str + 1);
	REP(i, 0, n + 1) REP(j, 0, 26) nxt[i][j] = inf;
	memset(fa, 0x3f, sizeof fa);
	PER(i, n, 1){
		int x = str[i] - 'a';
		nxt[i][x] = i + 1;
		REP(j, x + 1, 26){
			nxt[i][j] =	nxt[nxt[i][j - 1]][j - 1];
			if(nxt[i][j] == inf) break;
		}
		if(nxt[i][26] != inf){
			memcpy(nxt[i], nxt[nxt[i][26]], sizeof(int) * x);
		}
		fa[0][i] = nxt[i][26];
		
		REP(j, 1, 19){
			fa[j][i] = (fa[j - 1][i] >= inf) ? inf : fa[j - 1][fa[j - 1][i]];	
		}
	}
	scanf("%d", &Q);	
	while(Q--){
		int l = IN(), r = IN() + 1;
		PER(j, 19, 0) if(fa[j][l] <= r) l = fa[j][l];
		puts(l == r ? "Yes" : "No");
	}
	return 0;
}






















Measured memory_bytes: 100736
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef double db;
#define go(u) for(int i = head[u], v = e[i].to; i; i=e[i].lst, v=e[i].to)
#define rep(i, a, b) for(int i = a; i <= b; ++i)
#define pb push_back
#define re(x) memset(x, 0, sizeof x)
inline int gi() {
    int x = 0,f = 1;
    char ch = getchar();
    while(!isdigit(ch)) { if(ch == '-') f = -1; ch = getchar();}
    while(isdigit(ch)) { x = (x << 3) + (x << 1) + ch - 48; ch = getchar();}
    return x * f;
}
template <typename T> inline bool Max(T &a, T b){return a < b ? a = b, 1 : 0;}
template <typename T> inline bool Min(T &a, T b){return a > b ? a = b, 1 : 0;}
const int N = 2007;
int n, K;
int x[N], y[N];
vector<int>G[N];
int dfs1(int u, int fa, int dep) {
	int res = 0;
	for(auto v:G[u]) if(v ^ fa) {
		res += dfs1(v, u, dep + 1);
	}
	return res + (dep > K / 2);
}
int dfs2(int u, int fa, int dep) {
	int res = 0;
	for(auto v:G[u]) if(v ^ fa) {
		res += dfs2(v, u, dep + 1);
	}
	return res + (dep > K / 2);
}
int main() {
#ifndef ONLINE_JUDGE
#endif
	n = gi(), K = gi();
	rep(i, 1, n - 1) {
		x[i] = gi(), y[i] = gi();
		G[x[i]].pb(y[i]);
		G[y[i]].pb(x[i]);
	}
	int ans = n;
	if(K & 1) {
		rep(i, 1, n - 1) Min(ans, dfs2(x[i], y[i], 0) + dfs2(y[i], x[i], 0));
	}else {
		rep(i, 1, n) Min(ans, dfs1(i, 0, 0));
	}
	printf("%d\n", ans);
	return 0;
}

Measured memory_bytes: 512
#include <stdio.h>

int main(void)
{
	int a, b;
	float c;
	int d;
	
	scanf("%d %d", &a, &b);
	
	d = (a + b) / 2;
	c = (a + b) / 2.0;
	
	
	if ((c - d) > 0){
		printf("%d\n", d + 1);
	}
	else {
		printf("%d\n", d);
	}
	
	return (0);
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int h,w;
  cin >> h >> w;
  string board[50];
  for (int i=0; h > i;i++){
    cin >> board[i];
  }
  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 (int i=0; h > i; i++){
    for (int j=0; w > j; j++){
      if (board[i][j]=='#') {
        continue;
      }
      int count = 0;
      for (int d=0; 8 > d; d++){
        const int ni = dy[d]+i;
        const int nj = dx[d]+j;
        if(ni >= h || ni < 0) continue;
        if(nj >= w || nj < 0) continue;
        if(board[ni][nj] == '#') count++;
      }
       board[i][j]=char(count+'0');
    }
  }
  for (int i=0; h > i;i++){
    cout << board[i] <<endl;
  }
}

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

#define right_index(left_index, seq_length) (left_index + seq_length - 1)

using namespace std;

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

    vector<vector<long long int>> X_minus_Y(N + 1, vector<long long int>(N));
    for (int index = 0; index < N; index++) cin >> X_minus_Y[1][index];


    for (int seq_length = 2; seq_length <= N; seq_length++)
        for (int left_index = 0; right_index(left_index, seq_length) < N; left_index++)
            X_minus_Y[seq_length][left_index] = max(X_minus_Y[1][right_index(left_index, seq_length)] - X_minus_Y[seq_length - 1][left_index],
                                                    X_minus_Y[1][left_index] - X_minus_Y[seq_length - 1][left_index + 1]);

	cout << X_minus_Y[N][0];

    return 0;
}

Measured memory_bytes: 70656
import math
import sys
import itertools
from collections import deque
# import numpy as np

def main():
  S = sys.stdin.readline()
  len_S = len(S)

  index = 0 # 操作しているSのインデックス
  DOWN = [] # 下り文字をスタック
  POOL = [] # 水たまりごとの面積
  area = 0 # 総面積

  for s in S:
    if s == '\\':
      DOWN.append(index)

    elif s == '/' and len(DOWN) > 0:
      pool_start = DOWN.pop()
      pool_end = index
      tmp_area = pool_end - pool_start
      area += tmp_area

      while True:
        if len(POOL) == 0:
          break
        if POOL[-1]['start'] > pool_start and POOL[-1]['end'] < pool_end:
          tmp_area += POOL[-1]['area']
          POOL.pop()
        else:
          break

      POOL.append({'start': pool_start, 'end': pool_end, 'area': tmp_area})

    index += 1

  print(area)
  if len(POOL) > 0:
    print(len(POOL), end=" ")
    for i in range(len(POOL)-1):
      print(POOL[i]['area'], end=" ")
    print(POOL[-1]['area'])
  else:
    print(0)

if __name__ == '__main__':
  main()


Measured memory_bytes: 6932
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define printYes() cout << "Yes" << endl;
#define printNo() cout << "No" << endl;
#define printVector(v) rep(i, v.size()) cout << v[i] << endl;

int main()
{
  vector<int> A(3);
  cin >> A[0] >> A[1] >> A[2];
  sort(A.rbegin(), A.rend());
  int ans = abs(A[1] - A[0]) + abs(A[2] - A[1]);
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	cin>>n;
	int a[3][n+1];
	for(int i=1;i<=2;i++){
		for(int j=1;j<=n;j++){
			cin>>a[i][j];
		}
	}
	int ans=0;
	for(int i=1;i<=n;i++){
		int sum=0;
		for(int j=1;j<=i;j++){
			sum+=a[1][j];
		}
		for(int k=i;k<=n;k++){
			sum+=a[2][k];
		}
		ans=max(ans,sum);
	} 
	cout<<ans;
} 

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int n,a[1000],ans;
int main() {
    scanf("%d",&n); n<<=1;
    for(int i=1;i<=n;i++) scanf("%d",&a[i]);
    sort(a+1,a+n+1);
    for(int i=1;i<=n;i+=2) ans+=a[i];
    printf("%d",ans);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
/*
    // 配列の最大値を取得
    int max = *max_element(vec.begin(), vec.end());
    // 配列の最大値のイテレータを取得
    vector<int>::iterator maxIt = max_element(vec.begin(), vec.end());
    // 配列の最大値までの距離を取得
    int maxIndex = distance(vec.begin(), maxIt);
    // 隣り合う重複要素を削除し、末尾のゴミを削除
    // (uniqueは、重複を取り除いた範囲の末尾の次を指すイテレータを返す)
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
*/

int main() {
    int a, b, c;
    cin >> a >> b >> c;

    cout << a * b / 2 << endl;
}




Measured memory_bytes: 256
A, B, C = map(int, input().split())
if A == 5 and B == 5 and C == 7:
	print('YES')
elif A == 5 and B == 7 and C == 5:
	print('YES')
elif A == 7 and B == 5 and C == 5:
	print('YES')
else:
	print('NO')	


Measured memory_bytes: 2940
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <list>
#include <set>
#include <numeric>

#include <map>
#include <math.h>
#include <iomanip>
#include <stack>
#include <queue>
#include <bitset>
#include <math.h>

#define INF 100100100

typedef long long int llint;

using namespace std;

typedef pair<int, int>Pii;

#define pi 3.141592653589793
#define mod 1000000007

int main() {
	int n;
	cin >> n;
	cout << n/3 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
int main()
{
    int a,b,c,k,n,s,i,t;
    scanf("%d %d %d",&a,&b,&c);
    scanf("%d",&k);
    s = 0;
    t = 0;
    if(b <= a){
        for(i = 0;;i++){
            b = b * 2;
            s = s + 1;
            if(b > a){
                break;
            }
        }
    }
    if(b >= c){
        for(i = 0;;i++){
            c = c * 2;
            t = t + 1;
            if(c > b){
                break;
            }
        }
    }
    n = s + t;
    if(n > k){
        printf("No\n");
    }
    else{
        printf("Yes\n");
    }
    return 0;
}


Measured memory_bytes: 1644
st = input().split()
S = st[0]
T = st[1]

ab = input().split()
A = int(ab[0])
B = int(ab[1])
U = input()

new_a = A - 1 if S == U else A
new_b = B-1 if T == U else B

print("{} {}".format(new_a, new_b))


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

using namespace std;

int main(void){

	long long int a, b, c, d;
	cin >> a >> b >> c >> d;

	long long int ans = 0;

	ans = max(max(b*d, a*c), max(a*d, b*c));

	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 3604
import sys
input = sys.stdin.readline
sys.setrecursionlimit(10 ** 7)
INF = (10 ** 9) + 7

N, K = map(int, input().split())
aLst = list(map(int, input().split()))

tmp1 = 0
tmp2 = 0

for i in range(N):
    for j in range(i + 1, N):
        if aLst[i] > aLst[j]:
            tmp1 += 1

for i in range(N):
    for j in range(N):
        if aLst[i] > aLst[j]:
            tmp2 += 1

ans = (tmp1 * (K)) + ((K * ((K - 1)) // 2) * tmp2)
print(ans % INF)


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

using namespace std;

int h[101010];

int main() {
	int n;
	cin >> n;
	for(int i = 0; i < n; i++) {
		cin >> h[i];
	}
	int ans = 0, cnt = 0;
	for(int i = 0; i < n - 1; i++) {
		if(h[i] < h[i+1]) {
			ans = max(ans, cnt);
			cnt = 0;
		}
		else cnt++;
	}
	ans = max(ans, cnt);
	cout << ans;
}

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

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

int main() {
    ll A, B, N;
    cin >> A >> B >> N;

    if (N < B)
        cout << A * N / B - A * (N / B) << endl;
    else
        cout << A * (B - 1) / B - A * ((B - 1) / B) << endl;

    return 0;
}

Measured memory_bytes: 3628
///*
#include<iostream>
using namespace std;

int main() {

	int n, k, x, y, sum = 0;
	cin >> n >> k >> x >> y;

	for (int i = 1; i <= n; i++) {
		if (i > k) {
			sum += y;
		}
		else {
			sum += x;
		}
	}

	cout << sum;

	return 0;
}
//*/

Measured memory_bytes: 256
use std::io;
use std::str::FromStr;

fn input_int_tuple() -> (i32, i32) {
  let mut line: String = String::new();
  io::stdin().read_line(&mut line);
  let vec: Vec<i32> = line.split_whitespace().map(|s| s.parse().unwrap()).collect();
  (vec[0], vec[1])
}

fn main() {
  let (a, b) = input_int_tuple();
  if a <= 8 && b <= 8 {
    println!("Yay!");
  } else {
    println!(":(");
  }
}


Measured memory_bytes: 4352
import java.util.Scanner;

public class Main {
	
	public static void main(String[] args) {
		Main mainObj = new Main();
		mainObj.exec();
	}
	
	public void exec() {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		
		sc.close();
		
		if(!inRange(a) || !inRange(b)) {
			System.out.println(-1);
			return;
		}
		
		System.out.println(a*b);		
	}
	
	boolean inRange(int a) {
		if(a >= 1 && a <= 9) {
			return true;
		}else {
			return false;
		}
	}

}

Measured memory_bytes: 23252
def distance():
    N = [input() for i in range(5)]
    N = list(map(int, N))
    dis = int(input())
    for i in range(5):
        for j in range(i + 1, 5):
            if N[j] - N[i] > dis:
                print(":(")
                return
    print("Yay!")


distance()

Measured memory_bytes: 3060
<?php
fscanf(STDIN, "%s", $b);
function pare($b){
    if($b === 'A'){
        return 'T';
    }elseif($b === 'T'){
        return 'A';
    }elseif($b === 'C'){
        return 'G';
    }elseif($b === 'G'){
        return 'C';
    }
}
$answer = pare($b);
echo $answer;
?>

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

using namespace std;
using ll = long long;

//container util
#define SORT(c) sort((c).begin(),(c).end())

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

const int INF = 1e9;

struct UnionFind{
	vector<int> d;
	UnionFind(int n=0): d(n, -1){}
	int find(int x){
		if(d[x] < 0) return x;
		return d[x] = find(d[x]);
	}
	bool unite(int x, int y){
		x = find(x); y = find(y);
		if(x == y) return false;
		if(d[x] > d[y]) swap(x, y);
		d[x] += d[y];
		d[y] = x;
		return true;
	}
	bool same(int x, int y){ 
		return find(x) == find(y);
	}
	int size(int x){
		return -d[find(x)];
	}
};

int deg[100005];
vector<int> to[100005];


int main(void){

	int n, m, k; cin >> n >> m >> k;
	UnionFind uf(n);

	REP(i,m){
		int a, b; cin >> a >> b;
		a--; b--;
		deg[a]++;
		deg[b]++;
		uf.unite(a, b);
	}

	REP(i,k){
		int a, b; cin >> a >> b;
		a--; b--; 
		to[a].push_back(b);
		to[b].push_back(a);
	}
	
	REP(i,n){
		int ans = uf.size(i)-1-deg[i];
		for(int u: to[i]){
			if(uf.same(i,u)) --ans;
		}
		cout << ans << " ";
	}

	return 0;

}


Measured memory_bytes: 6784
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define int ll
using namespace std;
typedef long long ll;
signed main(){
  int n,a,b,c,d,e;
  cin>>n>>a>>b>>c>>d>>e;
  
  int x = min({a,b,c,d,e});
  
  int ans = 5;
  
  ans += (n-1)/x;
  
  cout << ans << endl;
  return 0;
}

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

using namespace std;
typedef long long ll;
#define int ll

#define REP(i,n) for(ll i=0;i<n;++i)
#define SORT(name) sort(name.begin(), name.end())
#define ZERO(p) memset(p, 0, sizeof(p))
#define MINUS(p) memset(p, -1, sizeof(p))
#if 1
#  define DBG(fmt, ...) printf(fmt, ##__VA_ARGS__)
#else
#  define DBG(fmt, ...)
#endif

const ll LLINF = (1LL<<60);
const int INF = (1LL<<30);
const double DINF = std::numeric_limits<double>::infinity();
const int MOD = 1000000007;
#define MAX_N 110

signed main()
{
    int N;
    cin >> N;
    int A[MAX_N];
    int min_a = LLINF, max_a = -1;
    REP(i, N) {
        cin >> A[i];
        min_a = min(min_a, A[i]);
        max_a = max(max_a, A[i]);
    }

    printf("%lld\n", abs(max_a - min_a));

    return 0;
}


Measured memory_bytes: 256
from sys import stdin,stdout
from collections import defaultdict
import math
#input=stdin.readline
#def print(x):stdout.write(str(x)+'\n')
n=int(input())
l=list(map(int,input().split()))
l.sort()
ans=0
c=set()
for i in range(n):
    for j in range(i+1,n):
        for k in range(j+1,n):
            s=(l[i],l[j],l[k])
            if len(set(s))==3 and (l[i]+l[j]>l[k]):
                ans+=1
            elif l[i]+l[j]<=l[k]:
                break
print(ans)

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

namespace ABC048_C
{
    class Program
    {
        static void Main(string[] args)
        {
            var Nx = Console.ReadLine().Split().Select(int.Parse).ToArray();
            var N = Nx[0];
            var x = Nx[1];
            var a = Console.ReadLine().Split().Select(long.Parse).ToArray();

            long ans = 0;

            for (int i = 0; i < N - 1; i++)
            {
                if (a[i] + a[i + 1] > x)
                {
                    long t = a[i] + a[i + 1] - x;
                    ans += t;
                    if (t > a[i + 1]) a[i] -= t - a[i + 1];
                    a[i + 1] -= Math.Min(t, a[i + 1]);
                }
            }
            Console.WriteLine(ans);

        }
    }
}


Measured memory_bytes: 29532
#include<stdio.h>
#include<string.h>
#define LEN 100005
#define MAX 100000
typedef struct pp{
  char name[100];
  int t;
}P;

P Q[LEN+1];
int head, tail, n,m;

void initialize() {
  head = tail = 0;
     }
int isEmpty() {
  if(head == tail)  return 1;
  else return 0;
      }
int isFull() {
  if(head == (tail + 1) % MAX) return 1;
  else return 0;
      }

void enqueue(P x){
  if(isFull() == 1) {
    printf("??¨?????????????????????????????????\n");
  }
  Q[tail] = x;
  if(tail + 1 == MAX) tail = 0;
  else tail++;
}

P dequeue(){
  P x;
  if(isEmpty() == 1) {
    printf("??¨???????????¢?????????????????????\n");
  }
  x = Q[head];
  if(head + 1 == MAX) head = 0;
  else head++;
  return x;
}


int main(){
  int elaps = 0, c=0;
  int i, q;
  P u;
  scanf("%d %d", &n, &q);
  m=n;
  for ( i = 1; i <= n; i++){
    scanf("%s", Q[i].name);
    scanf("%d", &Q[i].t);
  }
  head = 1;
  tail = n + 1;
  while(n != 0) {
    u = Q[head];
    u.t = Q[head].t - q;
    if(u.t > 0) {
      elaps = elaps + q;
      enqueue(u);
      Q[head]=dequeue();
    }
    else {
      elaps = elaps + Q[head].t;
      printf("%s %d\n",u.name,elaps);
      Q[head] = dequeue();
      n--;
    }
  }
  
  return 0;
}

Measured memory_bytes: 10756
import java.io.*;
import java.util.*;
public class Main { // "Main" should be used for most online judges
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		//String s = sc.nextLine();
		//int count = sc.nextInt();
		int num = sc.nextInt();
		int nums[] = new int[num];
		int t[] = new int[num];
		int x[] = new int[num];
		int y[] = new int[num];
		for(int i = 0; i < num; i++) {
			t[i] = sc.nextInt();
			x[i] = sc.nextInt();
			y[i] = sc.nextInt();
		}
		for(int i = 0; i < num; i++) {
			int sum = 0;
			int time = t[i] - (i==0?0:t[i-1]);
			if(i == 0) {
				sum = x[i] + y[i];
			}
			else {
				sum = x[i] - x[i - 1] + y[i] - y[i-1];
			}
			if(sum > time) {
				System.out.println("No");
				return;
			}
			else if(sum < time) {
				if((time - sum) % 2 != 0) { System.out.println("No"); return;}
			}
		}
		System.out.println("Yes");
	}
}

Measured memory_bytes: 93084
/*
    Washief Hossain Mugdho
    19 September 2020
    Educational DP Stones
*/

#ifndef DEBUG
#pragma GCC optimize("O3")
#endif

#include <bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define pb push_back
#define mp make_pair
#define fr first
#define sc second
#define fastio ios_base::sync_with_stdio(0)
#define untie cin.tie(0)
#define ms(a, b) memset(a, b, sizeof a)
using namespace std;
int a[105], n, k;
bool visited[100005];
bool memo[100005];
bool dp(int x)
{
    if (x == 0)
        return 0;
    if (x < 0)
        return 1;
    if (visited[x])
        return memo[x];
    visited[x] = 1;
    for (int i = 0; i < n; i++)
        if (!dp(x - a[i]))
            return memo[x] = 1;
    return memo[x] = 0;
}
int main()
{
#ifdef LOCAL_OUTPUT
    freopen(LOCAL_OUTPUT, "w", stdout);
#endif
#ifdef LOCAL_INPUT
    freopen(LOCAL_INPUT, "r", stdin);
#endif
    cin >> n >> k;
    for (int i = 0; i < n; i++)
        cin >> a[i];
    cout << (dp(k) ? "First" : "Second") << endl;
}


Measured memory_bytes: 10092
#include<cstdio>
#include<iostream>
using namespace std;
int main()
{
    int da[150]={0},a,i=0,max=0;
    while(cin>>a)
    {
        da[a]++;
        if(max<=da[a])max=da[a];
    }
    for(int j=0;j<150;j++)
    {
        if(da[j]==max)cout<<j<<endl;
    }
    return 0;
}

Measured memory_bytes: 1160
#include <iostream>
#include <vector>
using namespace std;
int main(){
	int n,S;
	while(cin>>n>>S,n||S){
		vector<int> r(n);int ans=0;
		for(int i=0;i<n;++i)cin>>r[i];
		for(int i=0;i<n;++i) for(int j=i+1;j<n;++j)	ans+=(r[i]+r[j]>S)?1:0;
		cout<<ans<<endl;
	}
	return 0;
}

Measured memory_bytes: 1232
#include <iostream>
#include <stack>
#include <string>

using namespace std;

const string Terminater = ".";

bool isOK(string& str)
{
	stack<char> st;
	for (char& c : str)
	{
		if (c == '(' || c == '[')
			st.push(c);

		if (c == ')')
		{

			if ( !st.empty() && '(' == st.top())
				st.pop();
			else
				return false;
		}
		else if (c == ']')
		{
			if (!st.empty() && '[' == st.top())
				st.pop();
			else
				return false;
		}
	}

	if (st.empty())
		return true;

	return false;
}

int main()
{
	while (1)
	{
		string str;
		getline(cin, str);

		if (str == Terminater)
			break;

		if (isOK(str))
			cout << "yes" << endl;
		else
			cout << "no" << endl;
	}
}

Measured memory_bytes: 1184
let () =
  Scanf.scanf "%d %d %d %d\n" @@ fun a b c d ->
  Printf.printf "%d\n"
    (if a < 0 && c < 0 then
       if b > 0 && d > 0 then max (a*c) (b*d)
       else a*c
     else if a > 0 && c > 0 || b > 0 && d > 0 then b*d
     else if a <= 0 && 0 <= b || c <= 0 && 0 <= d then 0
     else max (a*d) (b*c))

Measured memory_bytes: 3844
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define INF (1e9)
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define print(s) cout<<(s)<<endl
#define all(x) (x).begin(),(x).end()

int main() {
    int N;
    cin >> N;
    rep(i, 1, 10){
        rep(j, 1, 10){
            if (i * j == N){
                cout << "Yes" << endl;
                return 0;
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
using namespace std;
int dp[1002][10002];
int func(vector<int>&a , vector<int>&b , int n , int h)
{
	if(h<=0)
		return 0;
	if(n<0)
		return INT_MAX;
	
	if(dp[n][h]!=INT_MAX)	
		return dp[n][h];
			
	dp[n][h] = min(func(a,b,n,h-a[n]) + b[n] , func(a,b,n - 1 , h));
	return dp[n][h];
}
int main()
{
	int h , n , i,x,y,ans,j;
	cin>>h>>n;
	vector<int>a,b;
	for(i=0;i<n;i++)
		{
			cin>>x>>y;
			a.push_back(x);
			b.push_back(y);
		}
	for(i=0;i<1002;i++)
		{
			for(j=0;j<10002;j++)
				dp[i][j] = INT_MAX;
		}
	ans = func(a,b,n-1,h);
	cout<<ans<<endl;
}

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

int main() {
  string s;
  cin>>s;
  int a=s.size()/2;
  int c,i;
  for(i=1;;i++){
    c=0;
    for(int j=0;j<a-i;j++)if(s[j]!=s[a-i+j])c++;
    if(c==0)break;
  }
  cout<<(a-i)*2<<endl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void)
{
	int i, j, n, ts=0, hs=0;
	char tc[101], hc[101];
	
	scanf("%d",&n);
	for (i=0; i<n; i++) {
		scanf("%s %s",tc,hc);
		j = 0;
		while(1) {
			if(tc[j] == '\0' && hc[j] == '\0') {
				ts++; hs++; break;
			} else if(tc[j] > hc[j]) {
				ts += 3; break;
			} else if(hc[j] > tc[j]) {
				hs += 3; break;
			} else {
				j++;
			}
		}
	}
	printf("%d %d\n",ts,hs);
	return 0;
}

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

using namespace std;
using ll = long long;

const int MOD = 1e9 + 7;
#define REP(i, n)  for(int i = 0; i < n; ++i)
#define FOR(i, t, n)  for(ll i = t; i <= (ll)n; ++i)
struct edge {
    int from, to;
    ll cost;
};


class Eratosthenes {
public:
    vector<bool> prime;

    Eratosthenes(ll size) {
        size = max((int) sqrt(size) + 1, 101010);
        prime.resize(size, 1);
        prime[0] = 0;
        prime[1] = 0;
        for (size_t i = 2; i * i <= size; ++i)
            if (prime[i]) {
                for (size_t j = 2; i * j <= size; ++j)prime[i * j] = false;
            }
    }
};


class Combination {
    vector<ll> fac; //n!(mod M)
    vector<ll> ifac; //k!^{M-2} (mod M)
public:
    Combination(ll size) {
        fac.resize(size);
        ifac.resize(size);
        fac[0] = 1;
        ifac[0] = 1;
        for (ll i = 0; i < size; i++) {
            fac[i + 1] = fac[i] * (i + 1) % MOD;
            ifac[i + 1] = ifac[i] * mpow(i + 1, MOD - 2) % MOD;
        }
    }

    ll mpow(ll x, ll n) {
        ll ans = 1;
        while (n != 0) {
            if (n & 1) ans = ans * x % MOD;
            x = x * x % MOD;
            n = n >> 1;
        }
        return ans;
    }

    ll comb(ll a, ll b) {
        if (a == 0 && b == 0)return 1;
        if (a < b || a < 0)return 0;
        ll tmp = ifac[a - b] * ifac[b] % MOD;
        return tmp * fac[a] % MOD;
    }
};


ll GCD(ll a, ll b) {
    if (b == 0)return a;
    return GCD(b, a % b);
}

ll LCM(ll a, ll b) {
    ll gcd = GCD(a, b);
    return a / gcd * b;
}

ll N, M;

int c[3][3], a[3], b[3];

int main() {
    REP(i, 3)REP(j, 3)cin >> c[i][j];
    REP(a1, 101) {
        a[0] = a1;
        REP(a2, 101) {
            a[1] = a2;
            REP(a3, 101) {
                a[2] = a3;
                vector<int> b(3, -1);
                REP(j, 3)b[j] = c[0][j] - a[0];
                bool f = 1;
                REP(i, 3)REP(j, 3)if (b[j] != c[i][j] - a[i]) f = 0;
                if (f) {
                    cout << "Yes" << endl;
                    return 0;
                }
            }
        }
    }
    cout << "No" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include<vector>
#include <algorithm>
#include <queue>
#include<string>
#include <map>
#include <cmath>
#include <deque>
#include <list>
#include <stack>
#include <queue>
#include <utility>
#include <set>
#include <bitset>
typedef long long ll;
typedef long double ld;
#define PI  3.14159265358979323846

#define REP(i,s,n)for(ll i=s;i<(n);++i)
#define rep(i,n) REP(i,0,n)
using namespace std;
string S;
ll N, M;
vector<string>A;


int main() {
    cin >> N;
    ll tmp;
    ll ans;
    if (N%1000==0) {
        ans = 0;
    }
    else {
        tmp = (N / 1000) + 1;
        ans = tmp * 1000 - N;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define LL_MAX 9223372036854775800
int main()
{
    ll n,w;
    cin>>n>>w;
    vector<ll>values(n+1);
    vector<ll>weights(n+1);
    for (ll i = 1;i<=n;i++){
        cin>>weights[i]>>values[i];
    }
    ll len = n*1000;
    ll dp[n+1][len+1];
    for (ll i = 0;i<=len;i++)dp[1][i] = 1000000007;
    dp[1][0] = 0;
    dp[1][values[1]] = weights[1];
    for (ll i = 2;i<=n;i++){
        for (ll v = 0;v<=len;v++){
            dp[i][v] = dp[i-1][v];
            if (values[i]>v)continue;
            dp[i][v] = min(dp[i][v],weights[i]+dp[i-1][v-values[i]]);
        }
    }
    ll ans = -1;
    for (ll i = 0;i<=len;i++){
        if (dp[n][i]<=w)ans = i;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 78336
#include "bits/stdc++.h"
#include "ext/pb_ds/assoc_container.hpp"
#include "ext/pb_ds/tree_policy.hpp"
#include "ext/rope"
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
using namespace __gnu_cxx;
mt19937 rng(high_resolution_clock::now().time_since_epoch().count());
mt19937_64 rngll(high_resolution_clock::now().time_since_epoch().count());
#define lambdify(x) [&](auto &&...args){ return x(forward<decltype(args)>(args)...); }
template<typename T, typename U> T &ctmax(T &x, const U &y){ return x = max<T>(x, y); }
template<typename T, typename U> T &ctmin(T &x, const U &y){ return x = min<T>(x, y); }
template<typename T> using Tree = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;



int main(){
	cin.tie(0)->sync_with_stdio(0);
	int a, v, b, w, t;
	cin >> a >> v >> b >> w >> t;
	a == b || v > w && 1LL * t * (v - w) >= abs(b - a) ? cout << "YES\n" : cout << "NO\n";
	return 0;
}

/*

*/

////////////////////////////////////////////////////////////////////////////////////////
//                                                                                    //
//                                   Coded by Aeren                                   //
//                                                                                    //
////////////////////////////////////////////////////////////////////////////////////////

Measured memory_bytes: 3656
using System;
using System.Collections.Generic;

class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("10000");
            //3
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("1000003");
            //7
        }
        else if (InputPattern == "Input3") {
            WillReturn.Add("9876543210");
            //6
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();
        long N = long.Parse(InputList[0]);

        //試し割りで約数を列挙
        int Answer = int.MaxValue;
        for (long I = 1; I * I <= N; I++) {
            if (N % I == 0) {
                long YakuSuu1 = I;
                long YakuSuu2 = N / I;

                int KetaSuu1 = DeriveKetaSuu(YakuSuu1);
                int KetaSuu2 = DeriveKetaSuu(YakuSuu2);

                int CurrVal = Math.Max(KetaSuu1, KetaSuu2);
                if (CurrVal < Answer)
                    Answer = CurrVal;
            }
        }
        Console.WriteLine(Answer);
    }

    //桁数を求める
    static int DeriveKetaSuu(long pVal)
    {
        if (pVal <= 9) return 1;
        if (pVal <= 99) return 2;
        if (pVal <= 999) return 3;
        if (pVal <= 9999) return 4;
        if (pVal <= 99999) return 5;
        if (pVal <= 999999) return 6;
        if (pVal <= 9999999) return 7;
        if (pVal <= 99999999) return 8;
        if (pVal <= 999999999) return 9;
        if (pVal <= 9999999999) return 10;
        return 11;
    }
}


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

using namespace std;

int main()
{
    int n;
    int count=0;
    cin >> n;
    vector<int> p(n);
    for (int i = 0; i < n ; i++) {
        std::cin >> p.at(i);
    }
    for (int j = 1; j < n-1; j++)
    {
        if(p[j-1]<p[j] || p[j+1]<p[j]){
            if (p[j-1]<p[j]&&p[j+1]<p[j])
            {
                /* code */
            }else{
                count++;
            }                       
        }
    }
    cout << count;    
}

Measured memory_bytes: 256
N = int(input())
room = [[[0]*10 for _ in range (3)] for _ in range(4)]

for _ in range(N):
    b,f,r,v = map(int,input().split())
    room[b-1][f-1][r-1]+=v

for i in range(4):
    for j in range(3):
        for k in range(10):
            print(" {}".format(room[i][j][k]), end="")
        print()
    if i!=3:
        print("####################")


Measured memory_bytes: 5624
#include<iostream>
using namespace std;
long res=0,n,x,a[100004];
int main(){
	cin>>n>>x;
	for(int i=0;i<n;i++){
		cin>>a[i];
	}
	for(int i=1;i<n;i++){
		if(a[i]+a[i-1]<=x){
			continue;
		}else{
			long num=a[i]+a[i-1]-x;
			if(num>a[i]){
				a[i]=0;
			}else{
				a[i]-=num;
			}
//			cout<<num<<endl;
			res+=num;
		}
	}
	cout<<res;
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    int N, H, W;
    cin >> N;
    cin >> H;
    cin >> W;
    int ans = 0;
    
    int A, B;
    for(int i=0; i<N; i++){
        cin >> A;
        cin >> B;
        if ((A>=H)&&(B>=W)) ans++;
    }

    cout << ans << endl;
}


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

#define PI 3.14159265358
typedef long long ll; 
typedef long double ld; 

int main() {
	int i, se, count = 0;
	string s, t;
	cin >> s >> t;
	se = s.length();
	for(i = 0; i < se; i++) {
		if(s[i] == t[i]) {
			count++;
		}
	}
	if(count == se && t.length() > s.length()) {
		cout << "Yes" << endl;
	} else cout << "No" << "\n"; 
	
	return 0;
}


Measured memory_bytes: 3608
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		while(scan.hasNext()){
			int t = scan.nextInt();
			if(t == 0){
				break;
			}
			int n = scan.nextInt();
			int r = 0;
			for(int i = 0;i < n;i++){
				r += - (scan.nextInt() - scan.nextInt());
			}
			if(t <= r){
				System.out.println("OK");
			}else{
				System.out.println(t - r);
			}
		}
	}
}

Measured memory_bytes: 23452
N, M = map(int, input().split())
a, b = 1, N
S = set()
for _ in range(M):
    print(a, b)
    S.add(b - a)
    S.add(a + N - b)
    a += 1
    b -= 1
    if b - a in S or a + N - b in S or b - a << 1 == N:
        b -= 1

Measured memory_bytes: 25988
/* Focus your enery towards light */

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

#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define forn(i,n) for(int i=0;i<n;i++)
#define fore(i,a,b) for(int i=a;i<=b;i++)
#define ford(i,n) for(int i=n-1;i>=0;i--)
#define fi first
#define se second
#define endl "\n"
#define all(a) a.begin(),a.end()
#define sync ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define PI 3.14159265
#define inf 1e18

/******************************************************************************************************/
void file() {
#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif
}
/******************************************************************************************************/

// const ll nax = 2e5 + 1;
// const ll mod = 1e9 + 7;



int main() {

    sync

    int testCases = 1;
    // cin >> testCases;

    while (testCases--) {
        string s, t;
        cin >> s >> t;
        int n = s.size();
        int ans = 0;
        forn (i, n) {
            ans += (s[i] != t[i]);
        }
        cout << ans << endl;
    }
    return 0;
}


Measured memory_bytes: 3836
import sys
readline = sys.stdin.readline

H,W = map(int,readline().split())
A = [None] * H
for i in range(H):
  A[i] = list(map(int,readline().split()))
  
# 左上から順に見ていき、奇数だったら右に一つ移動させる
# 右端まで行ったときに奇数であれば、最終行じゃない場合は下に一つ移動させる

ans = []
for i in range(len(A)):
  for j in range(len(A[i])):
    if A[i][j] % 2 == 1:
      if j + 1 < W: # 右に移動できるとき
        A[i][j + 1] += 1
        A[i][j] -= 1
        ans.append([i + 1,j + 1,i + 1,j + 2])
      else:
        if i + 1 < H:
          A[i + 1][j] += 1
          A[i][j] -= 1
          ans.append([i + 1,j + 1,i + 2,j + 1])

print(len(ans))
for a in ans:
  print(*a)

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

int main(){
    int x;
    cin >> x;
    int ma = -1;
    for (double i = 1;i <= sqrt(x);i++){
        for (double j = 1;j <= sqrt(x);j++){
            if (pow(i,j) <= x){
                int ans = pow(i,j);
                ma = max(ma,ans);
            }
        }
    }

    cout << ma << endl;
}

Measured memory_bytes: 384
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

N,M = map(int, readline().split())
PS = [line.split() for line in readlines()]

AC = [False] * (N+1)
WA_cnt = [0] * (N+1)

penal = 0
for p,s in PS:
  p = int(p)
  if AC[p]:
    continue
  if s== b'WA':
    WA_cnt[p] += 1
  else:
    AC[p] = True
    penal += WA_cnt[p]
    
ac = sum(AC)
print(ac, penal)

Measured memory_bytes: 40788
#include <bits/stdc++.h>
using namespace std;
int main(){
    string S;
    getline(cin,S);
    int currMax = 0;
    int finMax = 0;
    for(int i=0;i<S.length();){
        if(S[i]=='A' || S[i]=='C' || S[i]=='G' || S[i]=='T'){
            currMax = 1;
            i++;
            while(S[i]=='A' || S[i]=='C' || S[i]=='G' || S[i]=='T'){
                currMax++;
                i++;
            }
            if(currMax > finMax){
                finMax = currMax;
            }
        }else{
            i++;
        }
    } 
    cout<<finMax<<endl;
}

Measured memory_bytes: 3620
n,k=map(int,input().split())
p=list(map(int,input().split()))
import numpy as np
p=np.array(p)
temp=p[0:k]
tempsum=sum(temp)
ans=tempsum
for i in range(1,n-k+1):
  tempsum=tempsum-p[i-1]+p[i+k-1]
  ans=max(ans,tempsum)
print((ans+k)/2)

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

int main(){
	string pri = "print", rev = "reverse", rep = "replace", str;
	int q;
	
	cin>>str>>q;
	
	for(int i = 0; i < q; i++){
		int a, b;
		string o, p, temp = "";

		cin>>o;
		cin>>a>>b;

		if(o == pri){
			for(int j = a; j <= b; j++) cout<<str[j];
			cout<<endl;
		}
		if(o == rev){
			for(int j = b; j >= a; j--)
				temp += str[j];
			str.replace(a, b - a + 1, temp);
		}
		if(o == rep){
			cin>>p;
			str.replace(a, b - a + 1, p);
		}
	}
	
	return 0;
}


Measured memory_bytes: 3192