akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <stack>
#include <queue>
#include <map>
#include <algorithm>
#include <iomanip>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <tuple>
using namespace std; using ll = long long; using ld = long double;  using pll = pair<ll, ll>;
using vl = vector<ll>; using vll = vector<vl>; using vpll = vector<pll>;
const ld PI = 3.1415926535897932;
#define debug(...) cerr << "[" << #__VA_ARGS__ << "]:", debug_out(__VA_ARGS__)
#define rep1(n) for(ll i=0;i<n;++i)
#define rep2(i,n) for(ll i=0;i<n;++i)
#define rep3(i,a,b) for(ll i=a;i<b;++i)
#define rep4(i,a,b,c) for(ll i=a;i<b;i+=c)
#define rep(...) overload4(__VA_ARGS__,rep4,rep3,rep2,rep1)(__VA_ARGS__)
#define mp make_pair
#define mt make_tuple
#define INT(...) int __VA_ARGS__;in(__VA_ARGS__)
#define LL(...) ll __VA_ARGS__;in(__VA_ARGS__)
#define ULL(...) ull __VA_ARGS__;in(__VA_ARGS__)
#define STR(...) string __VA_ARGS__;in(__VA_ARGS__)
#define CHR(...) char __VA_ARGS__;in(__VA_ARGS__)
#define DBL(...) double __VA_ARGS__;in(__VA_ARGS__)
#define LD(...) ld __VA_ARGS__;in(__VA_ARGS__)
void in() {}
void debug_out() { cerr << endl; }
template<typename Head, typename... Tail>
void debug_out(Head h, Tail... t) {
	cerr << " " << h;
	if (sizeof...(t) > 0) cerr << " :";
	debug_out(t...);
}
template <typename T>
ostream& operator<<(ostream& os, vector<T> vec) {
	for (size_t i = 0; i < vec.size(); i++)os << vec[i] << (i + 1 == vec.size() ? "" : " ");
	return os;
}
ll ctoi(char c) {
	switch (c) {
	case '0': return 0; case '1': return 1; case '2': return 2;
	case '3': return 3; case '4': return 4; case '5': return 5;
	case '6': return 6; case '7': return 7; case '8': return 8;
	case '9': return 9;  default: return 0;
	}
}
bool pairCompare(const pll firstElof, pll secondElof)
{
	return firstElof.first > secondElof.first;
}
//**Snippetリスト**//
//rep, vin, all, iteLoop//
//bitSearch, bitList, nod, gcdlcm, isPrime, primeFactorize, Npow, divisor, modinv, dfs, bfs, eratos//
//dijkstra, WarshallFloyd, BellmanFord, UnionFind, COM, digitDP ,RMQ//
ll i, j, k, l; ll N, M, K, H, W, L, X, Y, Z, R, Q;
ll MOD = 1000000007; ll INF = 1LL << 62; ll ans = 0; ll z = 0, o = 1;
vl flag, color, D; vll path;
//***********//
int main() {
	string S, T;
	cin >> S >> T;
	T = T.substr(0, S.length());
	if (S == T) cout << "Yes";
	else cout << "No";
}

Measured memory_bytes: 3628
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.IOException;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    String[] str = in.readLine().split(" ");
    int a = Integer.parseInt(str[0]);
    int b = Integer.parseInt(str[1]);
    
    int ans = 0;
    int cnt = 1;
    while(cnt<b){
      cnt-=1;
      cnt+=a;
      ans++;
    }
    
    System.out.println(ans);
  }
}

Measured memory_bytes: 22484
import copy

n, m = map(int, input().split())
graph = {i + 1: [] for i in range(n)}
edge = []
for i in range(m):
    a, b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)
    edge.append([a, b])
count = 0
for i in range(m):
    copy_graph = copy.deepcopy(graph)
    a, b = edge[i][0], edge[i][1]
    copy_graph[a].remove(b)
    copy_graph[b].remove(a)
    checked = set()
    check = [a]
    while check:
        test = check.pop(0)
        for j in copy_graph[test]:
            if j not in checked:
                check.append(j)
        checked |= {test,}
    if b not in checked:
        count += 1
print(count)

Measured memory_bytes: 3444
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

long long prime[1000100];
long long isPrime[1000100];

long long sieve(long long n){
  long long p = 0;
  for(long long i = 0; i <= n; i++){
    isPrime[i] = 1LL;
  }
  isPrime[0] = 0;
  isPrime[1] = 0;
  for(long long i = 2LL; i <= n; i++){
    if(isPrime[i] == 1LL){
      prime[p] = i;
      p++;
      for(long long j = 2LL * i; j <= n; j += i){
        isPrime[j] = 0;
      }
    }
  }
  return p;
}

int main() {
  sieve(1000010);
  ll n;
  cin>>n;
  ll mn = n-1;
  for(ll i = 1; i*i <= n; i++){
    if(n%i==0){
      mn = min(mn,(n/i-1)+(i-1));
    }
  }
  cout << mn << endl;
  return 0;
}

Measured memory_bytes: 10624
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=1LL<<61;

int main() {
  ll n;
  cin >> n;
  mat a(2,vec(3));
  for(ll i=0;i<2;i++) {
    for(ll j=0;j<3;j++) {
      cin >> a[i][j];
    }
  }
  vec dp1(n+1);
  for(ll i=0;i<3;i++) {
    for(ll j=0;j<=n;j++) {
      dp1[j]=max(dp1[j],j);
      if(j) {
        dp1[j]=max(dp1[j],dp1[j-1]);
      }
      if(j-a[0][i]>=0) {
        dp1[j]=max(dp1[j],dp1[j-a[0][i]]+a[1][i]);
      }
    }
  }
  ll m=dp1[n];
  vec dp2(m+1);
  for(ll i=0;i<3;i++) {
    for(ll j=0;j<=m;j++) {
      dp2[j]=max(dp2[j],j);
      if(j) {
        dp2[j]=max(dp2[j],dp2[j-1]);
      }
      if(j-a[1][i]>=0) {
        dp2[j]=max(dp2[j],dp2[j-a[1][i]]+a[0][i]);
      }
    }
  }
  cout << dp2[m] << endl;
}

Measured memory_bytes: 198376
#include<iostream>
#include <cstring>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=998244353 ;

int main(){
  ll a, b, c, d; cin >> a >> b >> c >> d;
  cout << max({a*c, b*d, a*d, b*c}) << endl;
}


Measured memory_bytes: 3672
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;
using Pair = System.Tuple<int, int>;
using Edge = System.Tuple<int, int, long>;
//using Debug;
//using static System.Globalization.CultureInfo;

class Program
{
    static void Main(string[] args)
    {
        Solve();
        //WriteLine(Solve());
    }
    static long[] memo;
    static int[][] a;
    static void Solve()
    {
        var num = Input.num;
        a = Enumerable.Repeat(0, num).Select(_ => Input.ar).ToArray();
        memo = Enumerable.Repeat(-1L, (1 << num)).ToArray();
        memo[0] = 1;
        WriteLine(dfs((1 << num) - 1, 0));
    }
    static long dfs(int num,int c)
    {
        if (memo[num] != -1) return memo[num];
        var res = 0L;
        for (var i = 0; i < a.Length; i++)
            if ((1&num >> i) == 1 && a[c][i] == 1)
                res = (res + dfs(num ^ (1 << i), c + 1)) % Input.MOD;
        return memo[num] = res;
    }
}

public class Input
{
    public static string read => ReadLine();
    public  static int[] ar => Array.ConvertAll(read.Split(' '), int.Parse);
    public  static int num => ToInt32(read);
    public static long[] arL => Array.ConvertAll(read.Split(' '), long.Parse);
    public  static long numL => ToInt64(read);
    public static char[][] gred(int h) 
        => Enumerable.Repeat(0, h).Select(v => read.ToCharArray()).ToArray();
    public static int[][] ar2D(int num)
        => Enumerable.Repeat(0, num).Select(v => ar).ToArray();
    public static long[][] arL2D(int num)
        => Enumerable.Repeat(0, num).Select(v => arL).ToArray();
    public const long Inf = (long)1e18;
    public const double eps = 1e-6;
    public  const string Alfa = "abcdefghijklmnopqrstuvwxyz";
    public  const int MOD = 1000000007;
}


Measured memory_bytes: 42028
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll maxn=1e5+10;
ll fh[maxn];
ll a[2][maxn];
bool cmp(ll a,ll b){
    return a>b;
}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n;
    cin>>n;
    ll z=0;
    ll f=0;
    ll sum=0;
    for(ll i=1;i<=n;++i){
        ll x;
        cin>>x;
        if(x>0){
            sum+=x;
            a[1][z++]=x;
        }
        else{
            sum-=x;
            a[0][f++]=x;
        }
    }
    bool flag=true;
    if(f==0){
        sort(a[1],a[1]+z,cmp);
        cout<<sum-2*a[1][z-1]<<endl;
        cout<<a[1][z-1]<<" "<<a[1][z-2]<<endl;
        a[0][f++]=a[1][z-1]-a[1][z-2];
        z-=2;
        flag=false;
    }
    if(z&&f){
        if(f==1&&z==0){
            cout<<a[0][0]<<endl;
            cout<<a[1][1]<<" "<<a[1][0]<<endl;
            return 0;
        }
        if(flag)cout<<sum<<endl;
        while(z>1){
            cout<<a[0][0]<<" "<<a[1][--z]<<endl;
            a[0][0]-=a[1][z];
        }
        while(f>1){
            cout<<a[1][0]<<" "<<a[0][--f]<<endl;
            a[1][0]-=a[0][f];
        }
        cout<<a[1][0]<<" "<<a[0][0]<<endl;
    }
    else {
            sort(a[0],a[0]+f);
            sum+=2*a[0][f-1];
            cout<<sum<<endl;
            while(f-2>=0){
                cout<<a[0][f-1]<<" "<<a[0][f-2]<<endl;
                a[0][f-2]=a[0][f-1]-a[0][f-2];
                f--;
            }
    }
}


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

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

int main(){
    int n, m;
    cin >> n >> m;
    vector<int> b(n);
    for (int i = 0; i < n; i++) cin >> b[i];
    vector<int> c(n);
    for (int i = 0; i < n; i++) c[i] = (int)gcd((long long)pow(2, 32), b[i]);
    sort(c.begin(), c.end());
    if (c.front() != c.back()){
        cout << 0 << endl;
        return 0;
    }
    long long a = b[0];
    int x;
    for (int i = 1; i < n; i++){
        x = b[i];
        a = a * x / gcd(x, a);
    }
    cout << (m * 2 / a + 1) / 2 << endl;
}

Measured memory_bytes: 1024
N = int(input())
al = list(map(int, input().split()))
bl = list(map(int, input().split()))
cl = list(map(int, input().split()))

old_index = False
s = 0
for a in al:
  s += bl[a-1]
  if old_index is not False and old_index + 1 == a:
    s += cl[a-2]
  old_index = a
print(s)

Measured memory_bytes: 38256
#include<stdio.h>

int main(){
	double a[100], n;
	int i=0;
	while(scanf("%lf", &n)!=EOF){
		a[i]=n;
		i++;
	}
	int j;
	for(j=0;j<i;j++){
		if(a[j]<=48){
			puts("light fly");
		}else if(a[j]<=51){
			puts("fly");
		}else if(a[j]<=54){
			puts("bantam");
		}else if(a[j]<=57){
			puts("feather");
		}else if(a[j]<=60){
			puts("light");
		}else if(a[j]<=64){
			puts("light welter");
		}else if(a[j]<=69){
			puts("welter");
		}else if(a[j]<=75){
			puts("light middle");
		}else if(a[j]<=81){
			puts("middle");
		}else if(a[j]<=91){
			puts("light heavy");
		}else{
			puts("heavy");
		}
	}
	return 0;
}

Measured memory_bytes: 608
#include <iostream>
#include <vector>
#include <map>
#include <string>
#include <utility>
#include <queue>
#include <stack>
#include <cmath>
#include <numeric>
#include <algorithm>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define ll long long
#define all(v) ((v).begin(),(v).end())
#define Sort(v) sort(all(v))
using namespace std;
int day[12]={31,28,31,30,31,30,31,31,30,31,30,31};

int main(){
    int n;
    cin>>n;
    if(n%10==9||n/10==9)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}



    



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

int main(){
    int n;

    while(cin >> n, n != 0){
        for(int i=1; i<=n; i++){
            int pm, pe, pj;
            cin >> pm >> pe >> pj;
            double all_ave = (pm+pe+pj) / 3.0;
            double me_ave = (pm+pe) / 2.0;

            if(pm == 100 || pe == 100 || pj == 100) cout << "A" << endl;
            else if(me_ave >= 90.0) cout << "A" << endl;
            else if(all_ave >= 80.0) cout << "A" << endl;
            else if(all_ave >= 70.0) cout << "B" << endl;
            else if(all_ave >= 50 && (pm >= 80) || (pe >= 80)) cout << "B" << endl;
            else cout << "C" << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int a[1000000];
int main()
{
	ll i,s;
	cin>>s;
	a[0]=s;
	for(i=1;i<1000000;i++){
		if(a[i-1]%2==0) a[i]=a[i-1]/2;
		else a[i]=(3*a[i-1])+1;
	}
	for(i=0;i<1000000-1;i++){
		for(ll j=i+1;j<1000000;j++){
			if(a[i]==a[j]){cout<<j+1<<endl;return 0;}
		}
	}
	return 0;
}

Measured memory_bytes: 4096
#define _USE_NATH_DEFINES
#include <cstdio>
#include <iostream>
#include <sstream>
#include <fstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <complex>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <limits>
#include <climits>
#include <cfloat>
#include <functional>
#include <iterator>
#include <random>
#include <tuple>


using namespace std;
#define REP(i,m,n) for(int i=(int)m ; i < (int) n ; ++i )
#define rep(i,n) REP(i,0,n)
using ll = long long;
#define EPS 1e-9
const int INF = 1050000000;
const long long LINF = 1LL << 60;
const ll MOD = 1e9 + 7;
const int MINF = -1050000000;

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


int main() {
	string s;
	cin >> s;
	char ans = s[0];
	rep(i, s.size()) {
		if (i == s.size() - 1) ans = s[i];
	}

	if (ans == '3') {
		cout << "bon" << endl;
		return 0;
	}
	else if (ans == '0' || ans == '1' || ans == '6' || ans == '8') {
		cout << "pon" << endl;
		return 0;
	}
	else {
		cout << "hon" << endl;
		return 0;
	}
	return 0;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
#define mod 1000000007
#define int long long
using namespace std;
int bigmod(int a , int b)
{
    if(b==0) return 1 ;
    int x=bigmod(a,b/2) ;
    x=((x%mod)*(x%mod))%mod ;
    if(b%2) x=((x%mod)*(a%mod))%mod ;
    return x ;
}
int32_t main()
{
    int n ; cin>>n ;
    if(n<2){cout<<"0"<<endl ; return 0 ; }
    int as=bigmod(10,n) ;// cout<<as<<endl ;
    int ass=(bigmod(9,n)*2)%mod-bigmod(8,n)+mod ; ass%=mod ;
    //cout<<ass<<endl ;
    cout<<(as-ass+mod)%mod<<endl ;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define loop(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n)  loop(i,0,n)
#define all(c) c.begin(),c.end()
#define rall(c) c.rbegin(),c.rend()
#define vi vector<int>
#define vl vector<ll>
#define pll pair<ll,ll>
#define vpll vector<pll>

int main(){
  int n,k;
  cin>>n>>k;
  vi su(n);
  rep(i,n)su[i]=0;
  int ans=0;
  rep(i,k){
    int tmp;
    cin>>tmp;
    rep(i,tmp){
    int tmp2;
    cin>>tmp2;
    su[tmp2-1]=1;
    }
  }
  rep(i,n){
    if(su[i]==0)ans++;
  }
  cout<<ans<<endl;
}

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

using namespace std;



int main(){

	int n ; cin >> n;
		int ans=0;
		for(int i = 1 ; i <=n; i++){
			if((1<=i&&i<=9)||(100<=i&&i<=999)||(10000<=i&&i<=99999)){
				ans++;
			}
		}
			cout<<ans<<endl;
	}





Measured memory_bytes: 256
from math import ceil

n = int(input())
# ans = ceil(n / 11) * 2
# print(ceil(n / 11) * 2, (n // 11) * 2)
ans = (n // 11) * 2
rem = n % 11
if rem == 0:
    ans = ans
elif rem <= 6:
    ans = ans + 1
else:
    ans = ans + 2
print(ans)

Measured memory_bytes: 38384
import math
import collections
import fractions
import itertools

def solve():
    n = int(input())
    xy = [[int(x) for x in input().split()] for _ in range(n)]
    vec = list()
    for xy1, xy2 in itertools.combinations(xy, 2):
        p = xy2[0] - xy1[0]
        q = xy2[1] - xy1[1]
        vec.append((p, q))
        vec.append((-p, -q))
    c = collections.Counter(vec)
    if n >= 2:
        ans = max(c.values())
        print(n - ans)
    else:
        print(1)
    return 0

if __name__ == "__main__":
    solve()


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

using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef pair<ll, ll> Pll;
typedef vector<int> Vi;
//typedef tuple<int, int, int> T;
#define FOR(i,s,x) for(int i=s;i<(int)(x);i++)
#define REP(i,x) FOR(i,0,x)
#define ALL(c) c.begin(), c.end()
#define DUMP( x ) cerr << #x << " = " << ( x ) << endl
#define UNIQUE(c) sort(ALL(c)), c.erase(unique(ALL(c)), c.end())

const int dr[4] = {-1, 0, 1, 0};
const int dc[4] = {0, 1, 0, -1};

int N;
double memo[301][301][301];


double rec(int i, int j, int k) {
  if (i < 0 or j < 0 or k < 0) {
    return 0.0;
  }
  if (i + j + k == 0) {
    return 0.0;
  }
  if (memo[i][j][k] >= 0.0) {
    return memo[i][j][k];
  }

  double s = i + j + k;

  return memo[i][j][k] = (i * rec(i-1, j, k) + j * rec(i+1, j-1, k) + k * rec(i, j+1, k-1) + N) / s;
}

int main() {
  // use scanf in CodeForces!
  cin.tie(0);
  ios_base::sync_with_stdio(false);

  cin >> N;
  vector<int> sushi(3, 0);
  REP(i, N+1) REP(j, N+1) REP(k, N+1) memo[i][j][k] = -1.0;
  REP(i, N) {
    int a; cin >> a; a--;
    sushi[a]++;
  }
  cout << setprecision(20) << rec(sushi[0], sushi[1], sushi[2]) << endl;

  return 0;
}


Measured memory_bytes: 213376
#include <iostream>
#include <cassert>
#include <queue>

#define INF 922337203685477580
typedef long long ll;

using namespace std;

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

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

  int count = 0;

  for (int i = 0; i < N; i++) {
    for (int j = N - 1; j > i; j--) {
      if (A[j] < A[j - 1]) {
        int t = A[j];
        A[j] = A[j - 1];
        A[j - 1] = t;
        count++;
      }
    }
  }

  for (int i = 0; i < N; i++) {
    if (i > 0) {
      cout << " ";
    }
    cout << A[i];
  }
  cout << endl << count << endl;
  return 0;
}

Measured memory_bytes: 3064
import sys
sys.setrecursionlimit(100000)

def rec(n):
    if n == 0:
        memo[n] = 0
        return memo[n]
    if memo[n] != -1:
        return memo[n]
    res = n
    pow6 = []
    pow9 = []
    for i in range(n):
        if 6 ** i > n:
            break
        pow6.append(6 ** i)
    
    for j in range(1, n):
        if 9 ** j > n:
            break
        pow9.append(9 ** j)
    L = set(pow6 + pow9)
    
    for k in L:
        res = min(res, rec(n - k)+1)
        
    memo[n] = res
    return memo[n]
    

N = int(input())
memo = [-1] * (N+1)
print(rec(N))

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

Measured memory_bytes: 572
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <bitset>
using namespace std;
typedef string::const_iterator State;
#define Ma_PI 3.141592653589793
#define eps 1e-5
#define LONG_INF 2000000000000000000LL
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007LL
#define GYAKU 500000004LL
#define MOD 998244353LL
#define seg_size 262144
#define REP(a,b) for(long long a = 0;a < b;++a)
int main() {
	int n;
	cin >> n;
	for (int i = 1; i <= 9; ++i) {
		for (int q = 1; q <= 9; ++q) {
			if (i * q == n) {
				cout << "Yes" << endl;
				return 0;
			}
		}
	}
	cout << "No" << endl;
}

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

#define mod 1000000007

int a[22][22];
long mem[22][(1<<22)-1];

long rec(int curr, int mask, int n)
{
  if(curr==n)
    return mask==0;
  if(mem[curr][mask]!=-1)
    return mem[curr][mask];
  long ans=0;
  for(int j=0;j<n;j++)
  {
    bool available=mask&(1<<j);
    if(available&&a[curr][j])
      ans=(ans%mod+rec(curr+1,mask^(1<<j),n)%mod)%mod;
  }
  mem[curr][mask]=ans;
  return ans;
  
}

int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++)
  {
    for(int j=0;j<n;j++)
      cin>>a[i][j];
  }
  memset(mem,-1,sizeof(mem));
  
  cout<<rec(0,(1<<n)-1,n);
  

}

Measured memory_bytes: 721280
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cstring>

#include <iostream>
#include <complex>
#include <string>
#include <algorithm>
#include <numeric>
#include <vector>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>

#include <functional>
#include <cassert>

typedef long long ll;
using namespace std;

#ifndef LOCAL
#define debug(x) ;
#else
#define debug(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl;

template <typename T1, typename T2>
ostream &operator<<(ostream &out, const pair<T1, T2> &p) {
  out << "{" << p.first << ", " << p.second << "}";
  return out;
}

template <typename T>
ostream &operator<<(ostream &out, const vector<T> &v) {
  out << '{';
  for (const T &item : v) out << item << ", ";
  out << "\b\b}";
  return out;
}
#endif

#define mod 1000000007 //1e9+7(prime number)
#define INF 1000000000 //1e9
#define LLINF 2000000000000000000LL //2e18
#define SIZE 200010


int main(){
  int a, b;

  cin >> a >> b;

  cout << max({a+b, a-b, a*b}) << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
    string s,t;
    cin>>s>>t;
    int len=s.size();
    string t1=t.substr(0,len);
    if(t1==s)
        cout<<"Yes"<<endl;
    else
        cout<<"No"<<endl;
}


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

#define REP(i,n) for(ll i=0; i<(ll)(n); i++)
#define FOR(i,n,m) for (ll i=n; i<(ll)(m); i++)
#define pb push_back
#define INF 1000000007LL
#define all(a) (a).begin(),(a).end()
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)

typedef long long ll;
typedef pair<int,int> p;

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

int main(){
    ios::sync_with_stdio(false);
    set<string> s;
    int N;
    cin >> N;
    REP(i, N) {
        string si;
        cin >> si;
        s.insert(si);
    }
    if (s.size() == 3) {
        cout << "Three" << endl;
    } else {
        cout << "Four" << endl;
    }
    return 0;
}


Measured memory_bytes: 256
import static java.lang.Integer.parseInt;
import static java.lang.Long.parseLong;
import static java.lang.System.exit;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

public class Main {

	static final int MOD = 998244353;

	static int add(int a, int b) {
		int res = a + b;
		return res >= MOD ? res - MOD : res;
	}

	static int sub(int a, int b) {
		int res = a - b;
		return res < 0 ? res + MOD : res;
	}

	static int mul(int a, int b) {
		int res = (int) ((long) a * b % MOD);
		return res < 0 ? res + MOD : res;
	}

	static int pow(int a, int e) {
		if (e == 0) {
			return 1;
		}
		int r = a;
		for (int i = 30 - Integer.numberOfLeadingZeros(e); i >= 0; i--) {
			r = mul(r, r);
			if ((e & (1 << i)) != 0) {
				r = mul(r, a);
			}
		}
		return r;
	}

	static int inv(int a) {
		return pow(a, MOD - 2);
	}

	static void solve() throws Exception {
		int n = scanInt();
		int facts[] = new int[n + 1];
		facts[0] = 1;
		for (int i = 1; i <= n; i++) {
			facts[i] = mul(facts[i - 1], i);
		}
		int factsInv[] = new int[n + 1];
		factsInv[n] = inv(facts[n]);
		for (int i = n - 1; i >= 0; i--) {
			factsInv[i] = mul(factsInv[i + 1], i + 1);
		}
		int ans = pow(3, n);
		int p2 = 2;
		for (int i = n; i > n / 2; i--) {
			ans = sub(ans, mul(mul(facts[n], mul(factsInv[i], factsInv[n - i])), p2));
			p2 = add(p2, p2);
		}
		out.print(ans);
	}

	static int scanInt() throws IOException {
		return parseInt(scanString());
	}

	static long scanLong() throws IOException {
		return parseLong(scanString());
	}

	static String scanString() throws IOException {
		while (tok == null || !tok.hasMoreTokens()) {
			tok = new StringTokenizer(in.readLine());
		}
		return tok.nextToken();
	}

	static BufferedReader in;
	static PrintWriter out;
	static StringTokenizer tok;

	public static void main(String[] args) {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			solve();
			in.close();
			out.close();
		} catch (Throwable e) {
			e.printStackTrace();
			exit(1);
		}
	}
}

Measured memory_bytes: 101844
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0;i < (int)(n);i++)
using ll = long long;
const ll MOD=1000000007;
//const ll MOD=998244353;
const long long INF = 1LL << 60;
const double pi=acos(-1.0);
int dx[8] = {1, 0, -1, 0, 1, 1, -1, -1};
int dy[8] = {0, 1, 0, -1, 1, -1, -1, 1};

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



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

  string S; cin>>S;
  ll N=S.size();
  ll left=0,right=N-1;
  ll ans=0;
  while(right-left>0){
    if(S[left]==S[right]) {left++; right--;}
    else if(S[left]=='x') {left++; ans++;}
    else if(S[right]=='x') {right--; ans++;}
    else {cout<<-1<<'\n'; return 0;}
  }
  
  cout<<ans<<'\n';
  
  return 0;
}

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

int main() {
  int n;
  ll ans = 0;
  cin >> n;
  unordered_map<string,int> mp;
  for(int i = 0;i < n;i++){
    string s;
    cin >> s;
    sort(s.begin(),s.end());
    auto itr = mp.find(s);
    if(itr != mp.end()) {
      mp[s]++;
    }
    else {
      mp[s] = 1;
    }
  }
  for(auto itr = mp.begin(); itr != mp.end(); ++itr){
    ll a = itr->second;
    ans += a*(a-1)/2;
  }
  cout << ans << endl;
}


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

int main() {
  string s;
  cin >> s;
  vector<int> a(4);
  for ( int i=0; i<4; i++ ) {
    a[i]=(s[i]-'0');
  }
  for ( int mask=0; mask<8; mask++ ) {
    int res=a[0];
    for ( int i=0; i<3; i++ ) {
      if ( mask>>i&1 ) {
        res+=a[i+1];
      }
      else {
        res-=a[i+1];
      }
    }
    if ( res==7 ) {
      for ( int i=0; i<3; i++ ) {
        cout << a[i];
        cout << ( mask>>i&1? '+' : '-' );
      }
      cout << a[3];
      cout << "=7\n";
      return 0;
    }
  } 

  return 0;
}

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

using ull = unsigned long long;
using ll = long long;
using ld = long double;

const int mod = 1e9 + 7;
const int inf = INT_MAX;
const int N = 2e5 + 5;

ll n, mxadd, mnadd, mxsub, mnsub;
pair<ll, ll> a[N];

bool f(ll dist) {
    for (int i = 0; i < n; i++) {
        if (mxadd >= a[i].first + a[i].second + dist)
            return true;
        if (mnadd <= a[i].first + a[i].second - dist)
            return true;
        if (mnsub <= a[i].first - a[i].second - dist)
            return true;
        if (mxsub >= a[i].first - a[i].second + dist)
            return true;
    }
    return false;
}

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

    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i].first >> a[i].second;

    mnadd = INT_MAX;
    for (int i = 0; i < n; i++) {
        mxadd = max(mxadd, a[i].first + a[i].second);
        mnadd = min(mnadd, a[i].first + a[i].second);
    }

    mxsub = INT_MIN;
    mnsub = INT_MAX;
    for (int i = 0; i < n; i++) {
        mxsub = max(mxsub, a[i].first - a[i].second);
        mnsub = min(mnsub, a[i].first - a[i].second);
    }

    ll lo = 0, hi = (ll)2e9;
    while (lo < hi) {
        int mid = lo + (hi - lo + 1) / 2;
        if (f(mid))
            lo = mid;
        else hi = mid - 1;
    }
    cout << lo << '\n';
    return 0;
}

Measured memory_bytes: 6784
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <cmath>
#include <queue>
#include <map>
#include <unordered_map>
#include <set>
#include <functional>
#include <bitset>
#include <numeric>
#include <complex>
#include <iomanip>
#include <cassert>
#include <random>


int main() {
    int n, m; std::cin >> n >> m;
    std::vector<std::vector<int>> edg(n);
    for (int i = 0; i < m; i++) {
        int a, b; std::cin >> a >> b;
        a--; b--;
        edg[a].push_back(b);
        edg[b].push_back(a);
    }
    auto dfs = [&](auto &self, int pos, int s) {
        if (s == (1 << n) - 1) return 1;
        int ret = 0;
        for (int c : edg[pos]) {
            if ((s >> c) & 1) continue;
            ret += self(self, c, s | (1 << c));
        }
        return ret;
    };
    std::cout << dfs(dfs, 0, 1) << std::endl;
    return 0;
}


Measured memory_bytes: 3596
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		//提示されるダイス目の入力
		String dice = sc.nextLine();

		//入力されたダイス目の配列
		String[] dicenum =dice.split(" ");
		int[] dicenumber =new int[6];

		for(int i = 0 ; i < dicenum.length ; i++){

			dicenumber[i] = Integer.parseInt(dicenum[i]);


			}

		//提示されたダイスの転がる方向
		String str = sc.nextLine();

		//1文字単位でリスト化
		String[] direction = str.split("");

		//Diceクラスの呼び出し
		Dice diceroll = new Dice(dicenumber);

		//Rollクラスの呼び出し
		Roll dicetop = new Roll();

		//Diceクラスの受けわたし
		dicetop.setDice(diceroll);

		//配列を渡して長さ分だけ振る命令
		int dt = dicetop.roll(direction);

		System.out.println(dt);

		sc.close();

	}

}

 class Dice {

	int[] d = new int[6];

	public Dice(int[] setd) {

		this.d[0] = setd[0];
		this.d[1] = setd[1];
		this.d[2] = setd[2];
		this.d[3] = setd[3];
		this.d[4] = setd[4];
		this.d[5] = setd[5];

	}

}

 class Roll {

	Dice dice;

	public void setDice(Dice getDice) {
		dice = getDice;
	}

	public int roll(String[] splitstr) {
		//番地の目の移動
		//1,2,3,4,5,6
		//移動方向がN・Sの時は3と4は変わらない
		//移動方向がE・Wの時は2と5は変わらない
		//1と6は常に移動する

		//Sの時は1⇒2⇒6⇒5⇒1の位置にそれぞれ移動する
		//Nの時は1⇒5⇒6⇒2⇒1の位置にそれぞれ移動する
		//Eの時は1⇒3⇒6⇒4⇒1の位置にそれぞれ移動する
		//Wの時は1⇒4⇒6⇒3⇒1の位置にそれぞれ移動する

		//1-6を配列番号0-5に割り当てて並べ替えをする

		int empty = 0;

		//方向ごとに場合分け

		for (String str : splitstr) {

			switch (str) {
			case "S":
				empty = dice.d[0];
				dice.d[0] = dice.d[4];
				dice.d[4] = dice.d[5];
				dice.d[5] = dice.d[1];
				dice.d[1] = empty;
				break;

			case "N":
				empty = dice.d[0];
				dice.d[0] = dice.d[1];
				dice.d[1] = dice.d[5];
				dice.d[5] = dice.d[4];
				dice.d[4] = empty;
				break;

			case "E":
				empty = dice.d[0];
				dice.d[0] = dice.d[3];
				dice.d[3] = dice.d[5];
				dice.d[5] = dice.d[2];
				dice.d[2] = empty;
				break;

			case "W":
				empty = dice.d[0];
				dice.d[0] = dice.d[2];
				dice.d[2] = dice.d[5];
				dice.d[5] = dice.d[3];
				dice.d[3] = empty;
				break;

			default:
				break;
			}

		}

		return dice.d[0];
	}
}


Measured memory_bytes: 26196
#include<cstdio>
#include<algorithm>
#include<vector>
using namespace std;
long long H, W, T, Mod = 1000000007;
long long gcd(long long a, long long b) {
	return b ? gcd(b, a%b) : a;
}
long long Pow(long long a, long long b) {
	long long r = 1;
	while (b) {
		if (b & 1)r = r * a%Mod;
		a = a * a%Mod; b >>= 1;
	}
	return r;
}
long long Calc(long long n, long long m) {
	long long r1 = Pow(2, gcd(n, m));
	long long r2 = Pow(2, m);
	long long r3 = Pow(2, n);
	return (r1 + r2 + r3 + Mod - 3) % Mod;
}
int main() {
	scanf("%lld%lld%lld", &H, &W, &T);
	long long t1 = gcd(H, T), t2 = gcd(W, T);
	printf("%lld\n", Pow(Calc(H / t1, W / t2), t1*t2));
}

Measured memory_bytes: 128
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        new Main().run();
    }

    private void run() {
        Scanner scanner = new Scanner(System.in);
        int N = scanner.nextInt();
        int[] d = new int[N];
        for (int i = 0; i < N; i++) {
            d[i] = scanner.nextInt();
        }
        long sum = 0;
        for (int j = 0; j < N - 1; j++) {
            for (int i = j + 1; i < N; i++) {
                sum += d[i] * d[j];
            }
        }

        System.out.println(sum);
    }
}

Measured memory_bytes: 21844
import java.util.*;
import java.io.*;
import java.math.*;
 
public class Main {
    public static void main(String[] args) throws Exception {
        Scanner sc = new Scanner(System.in);
        int k = sc.nextInt();
        int x = sc.nextInt();
        if(500*k >= x){
            System.out.println("Yes");
        }else{
            System.out.println("No");
        }
        
    }
}

Measured memory_bytes: 23764
#include<stdio.h>
int a[1000001];

int Func(int n) {
	if (n == 0)return 0;
	else return a[n] + Func(n - 1);
}

int main() {
	a[0] = 0;
	a[1] = 0;
	a[2] = 1;
	for (int i = 3; i <= 1000000; i++) {
		if (i % 2 == 0)a[i] = 0;
		else {
			int h = 1;
			for (int j = 3; j*j <= i && h == 1; j += 2) {
				if (i%j == 0)h = 0;
			}
			a[i] = h;
		}
	}
	int n;
	while (~scanf("%d", &n)) {
		printf("%d\n", Func(n));
	}
}



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

bool IsPrime(int num) {
  if (num < 2)
    return false;
  else if (num == 2)
    return true;
  else if (num % 2 == 0)
    return false;  // 偶数はあらかじめ除く

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

  // 素数である
  return true;
}

int main(void) {
  int x;
  cin >> x;
  bool flg = false;
  while (true) {
    flg = IsPrime(x);
    if (flg) break;
    x++;
  }
  cout << x << endl;
  return 0;
}

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

int main() {
  ll n;
  cin >> n;
  rep(i,3501)rep(j,3501){
      ll ng=0,ok=3501;
      while(ok-ng>=2){
        ll mid=(ng+ok)/2;
        ll x=4*i*j*mid,y=n*i*j+n*i*mid+n*j*mid;
        if(x==y){
          cout << i << " "  << j << " " << mid;
          return 0;
        }
        else if(x>y) ok=mid;
        else ng=mid;
      }
      
  }
}

Measured memory_bytes: 3652
#include <bits/stdc++.h>
#pragma GCC target("avx2")
#pragma GCC optimize("Ofast")
using namespace std;
using u16 = uint16_t;

u16 n;
uint ans;
u16 a[2000];
int main(){
  scanf("%hu", &n);
  for(uint i = 0; i < n; i++) scanf("%hu", &a[i]);
  sort(a, a + n);
  for(uint i = 0; i < n; i++) for(uint j = i + 1; j < n; j++) for(uint k = j + 1; k < n; k++) if(a[i] + a[j] > a[k]) ans++;
  printf("%u", ans);
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <queue>
#include <vector>
#include <set>
#include <map>
#include <numeric>

using namespace std;

int main(){
    int n;
    cin>>n;
    cout<<n*800-n/15*200<<endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0; i<n; i++)
#define INF 100000
using namespace std;
bool isPrime(int x)
{
	if(x < 2) return false;
	if(x == 2) return true;
	if(x % 2 == 0) return false;
	for(int i=3; i*i<=x; i+=2)
	{
		if(x % i == 0) return false;
	}
	return true;
}
int main()
{
	double m, a, b;
	while(cin >> m >> a >> b)
	{
		int ans_p,ans_q,area = 0;
		if(m == 0 && a == 0 && b == 0) break;
		double inf = a/b;
		for(int i=2; i<=m; i++)
		{
			long tmp_area = 0, p, q;
			if(!isPrime(i)) continue;
			for(int j=i; j<=m/i; j++)
			{
				if((double)i/j < inf || (double)i/j > 1.0) continue;
				if(!isPrime(j)) continue;
				if(i*j > m) break;
				tmp_area = i*j;
				p = i;
				q = j;
			}
			if(tmp_area >= area)
			{
				area = tmp_area;
				ans_p = p;
				ans_q = q;
			}
		}
		cout << ans_p << " " << ans_q << endl;
	}
	return 0;
}




Measured memory_bytes: 3128
using System;
using System.Collections.Generic;
using System.Linq;

public class Solution
{
    public static void Main()
    {
        var vals = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var n = vals[0];
        var k = vals[1];

        int d = 0;
        while (n > 0)
        {
            n /= k;
            d++;
        }
        if (d == 0)
        {
            d = 1;
        }

        Console.WriteLine(d);
    }
}

Measured memory_bytes: 13268
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import array
from bisect import *
from collections import *
import fractions
import heapq
from itertools import *
import math
import random
import re
import string
import sys

H1, M1, H2, M2, K = map(int, input().split())

dur = (H2 - H1) * 60 + M2 - M1
print(max(0, dur - K))



Measured memory_bytes: 10772
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <stack>
#include <queue>
#include <cmath>
using namespace std;
const int max_n = 10000+5;
long long cnt[111];
long long m,n,a=0,b,W;
const int INF = 1e8;
const int mod = 1e9 + 7;
long dist[max_n],s[max_n],w[max_n],v[max_n];
long long dp[max_n][max_n];
vector<vector<int> > G;
bool isprime(long long xx){
    if(xx == 2) return true;
    if(xx % 2==0 || xx<2)    return false;
    long long ii = 3;
    while(ii*ii <= xx){
        if(xx %ii == 0) return false;
        ii += 2;
    }
    return true;
}
long long gcd(long long xx, long long yy){
    if(yy == 0) return xx;
    long long k = xx/yy;
    long long c = xx - k*yy;
    return gcd(yy, c);
}
void solve(){
    for(int i=0 ; i<=W ; i++){
        dp[i][0] = 0;
    }
    for(int i=0 ; i<n ; i++){
        for(int j=0 ; j<=W ; j++){
            if(j>=w[i]){
                dp[i+1][j] = max(dp[i][j-w[i]]+v[i], dp[i][j]);
            }else{
                dp[i+1][j] = dp[i][j];
            }
        }
    }
    cout << dp[n][W] << endl;
}
int main(){
    cin >> n >> W;
    for(int i=0 ; i<n ; i++){
        cin >> v[i] >> w[i];
    }
    solve();
    return 0;
}


Measured memory_bytes: 50528
n = int(input())
a = list(map(int, input().split()))

res=0
a_set=set(a)

res=0
for i in range(n):
    res = res ^ a[i]

if n % 3 ==0:
    if res==0:
        print("Yes")
        exit()
else:
    if len(a_set) ==1:
        print("Yes")
        exit()
print("No")

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

int main(){
	int n,curr;
	int c4 = 0; // count of numbers which are divisible by 4
	int c2 = 0; // count of number which are not divisble by 4 but divisible by 2
	int c = 0; // count of number not divisible by 2
	scanf("%d",&n);
	for(int i=0;i<n;i++){
		scanf("%d",&curr);
		if(curr%4==0)
			c4++;
		else if(curr%2==0)
			c2++;
		else
			c++;
	}
	if(c2==0){
		if(c4>=c-1)
			printf("Yes\n");
		else
			printf("No\n");
	}
	else{
		if(c4>=c)
			printf("Yes\n");
		else
			printf("No\n");	
	}
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<atcoder/all>
#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 fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; using namespace atcoder;
void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
template<class T>bool chmax(T& a, const T& b) { if (a < b) { a = b; return 1; } return 0; }
template<class T>bool chmin(T& a, const T& b) { if (b < a) { a = b; return 1; } return 0; }
//---------------------------------------------------------------------------------------------------
/*---------------------------------------------------------------------------------------------------
　　　　　　　　　　　 ∧＿∧
　　　　　 ∧＿∧ 　（´<_｀ ）　 Welcome to My Coding Space!
　　　　 （ ´_ゝ`）　/　 ⌒i     @hamayanhamayan0
　　　　／　　　＼　 　  |　|
　　　 /　　 /￣￣￣￣/　　|
　 ＿_(__ﾆつ/　    ＿/ .| .|＿＿＿＿
　 　　　＼/＿＿＿＿/　（u　⊃
---------------------------------------------------------------------------------------------------*/














int K;
string acl = "ACL";
//---------------------------------------------------------------------------------------------------
void _main() {
	cin >> K;

	string ans = "";
	rep(k, 0, K) ans += acl;
	cout << ans << endl;
}







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

int main()
{
    std::ios_base::sync_with_stdio(false);
    int n, m;
    long long k;
    std::cin >> n >> m >> k;
    std::vector<long long> a(n + 1), b(m + 1);
    for (int i = 1; i <= n; i++) { std::cin >> a[i]; a[i] += a[i - 1]; }
    for (int i = 1; i <= m; i++) { std::cin >> b[i]; b[i] += b[i - 1]; }
    int i = 0, j = 0;
    while (i <= n && a[i] <= k) i++; i--;
    while (j <= m && a[i] + b[j] <= k) j++; j--;
    int c = i + j;
    while (i > 0)
    {
        i--;
        while (j <= m && a[i] + b[j] <= k) j++; j--;
        c = std::max(c, i + j);
    }
    std::cout << c << '\n';
    return 0;
}


Measured memory_bytes: 6424
//#define _GLIBCXX_DEBUG

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

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (ll)(m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T1, typename T2>
bool chmin(T1 &a,T2 b){if(a>b){a=b;return true;}else return false;}
template<typename T1, typename T2>
bool chmax(T1 &a,T2 b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,-1,0,0,1,1,-1,-1};
vector<ll>dy={0,0,1,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2>&p){
  return os << p.first << " " << p.second;
}
//mt19937 mt(chrono::steady_clock::now().time_since_epoch().count());

int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  string s;cin>>s;
  rep(i,0,s.size()){
    if(s[i]=='R')buf++;
    else buf=0;
    chmax(res,buf);
  }
  cout<<res<<endl;
  return 0;
}

Measured memory_bytes: 3656
#include<bits/stdc++.h>
using namespace std;
const int N=500005;
#define pii pair<double,int>
#define fi first
#define se second
#define mp make_pair
int n,L,y;
double x;
pii Q[N];
signed main(){
	scanf("%d%d",&n,&L);
	double ans=0;
	int l=1,r=1;
	scanf("%lf%d",&x,&y);
	Q[1]=mp(x,y);
	ans=x*y;
	printf("%.10lf\n",x);
	n--;
	while (n--){
		scanf("%lf%d",&x,&y);
		int p=y;
		while (p){
			int c=min(p,Q[l].se);
			Q[l].se-=c;p-=c;ans-=c*Q[l].fi;
			if (!Q[l].se)l++;
		}
		ans+=x*y;
		while (l<=r&&Q[r].fi>=x){
			x=(x*y+Q[r].fi*Q[r].se)/(y+Q[r].se);
			y+=Q[r].se;
			r--;
		}
		r++;Q[r]=mp(x,y);
		printf("%.10lf\n",ans/L);
	}
}


Measured memory_bytes: 18304
import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);
	public static final int
		Sp = 0, Ha = 1, Cu = 2, Di = 3;

	public static void main(String[] args){
		boolean[][] trump = new boolean[4][13];
		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 13; j++){
				trump[i][j] = false;
			}
		}
		int n = scan.nextInt();
		for(int i = 0; i < n; i++){
			String m = scan.next();
			int num = scan.nextInt();
			char mc = m.charAt(0);
			int a = 0;
			switch(mc){
				case 'S' :
					a = Sp;
					break;
				case 'H' :
					a = Ha;
					break;
				case 'C' :
					a = Cu;
					break;
				case 'D' :
					a = Di;
					break;
			}
			trump[a][num - 1] = true;
		}

		for(int i = 0; i < 4; i++){
			for(int j = 0; j < 13; j++){
				if(trump[i][j] == false){
					char mc = 0;
					switch(i){
						case 0 :
							mc = 'S';
							break;
						case 1 :
							mc = 'H';
							break;
						case 2 :
							mc = 'C';
							break;
						case 3 :
							mc = 'D';
							break;
					}
					System.out.printf("%c %d\n", mc, j + 1);
				}
			}
		}
	}
}

Measured memory_bytes: 26460
#!/usr/bin/env python3
import sys
 
YES = "Yes"  # type: str
NO = "No"  # type: str
 
 
def solve(N: int):
    print(YES if '7' in str(N) else NO)
    return
 
 
# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    solve(N)
 
if __name__ == '__main__':
    main()

Measured memory_bytes: 9184
#include <iostream>
#include<cstdio>
#include<algorithm>
using namespace std;
int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    if((a==7&&(b==5&&c==5))||(b==7&&(c==5&&a==5))||(c==7&&(b==5&&a==5)))
        cout<<"YES"<<endl;
    else
        cout<<"NO"<<endl;
    return 0;
}

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

using namespace std;

int main(void) {
	string b, s = "";
	int i;
	cin >> b;
	if (b.size() < 10) {
		for (i = 0; i < b.size(); i++) {
			if (b[i] == 'A') {
				if (i < b.size() - 1 && b[i + 1] == 'A')
					s += "A";
			}
			else if (i < b.size() - 2 && b[i] == 'K' && b[i + 1] == 'I' && b[i + 2] == 'H') {
				s += "!";
				i += 2;
			}
			else {
				s = s + b[i];
			}
		}
		if (s == "!BR") {
			printf("YES\n");
			return 0;
		}
	}
	printf("NO\n");
	return 0;
}

Measured memory_bytes: 256