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

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

        int[][] a = new int[3][3];
        boolean[][] isMarked = new boolean[3][3];

        for(int i=0; i<3; i++){
            for(int j=0; j<3; j++){
                a[i][j] = stdIn.nextInt();
            }
        }

        int n = stdIn.nextInt();
        for(int t=0; t<n; t++){
            int x = stdIn.nextInt();
            for(int i=0; i<3; i++){
                for(int j=0; j<3; j++){
                    if(a[i][j] == x){
                        isMarked[i][j] = true;
                    }
                }
            }
        }

        System.out.println(isBingo(isMarked) ? "Yes" : "No");
    }

    static boolean isBingo(boolean[][] isMarked){
        if(isMarked[0][0] && isMarked[0][1] && isMarked[0][2]){
            return true;
        }
        if(isMarked[1][0] && isMarked[1][1] && isMarked[1][2]){
            return true;
        }
        if(isMarked[2][0] && isMarked[2][1] && isMarked[2][2]){
            return true;
        }
        if(isMarked[0][0] && isMarked[1][0] && isMarked[2][0]){
            return true;
        }
        if(isMarked[0][1] && isMarked[1][1] && isMarked[2][1]){
            return true;
        }
        if(isMarked[0][2] && isMarked[1][2] && isMarked[2][2]){
            return true;
        }
        if(isMarked[0][0] && isMarked[1][1] && isMarked[2][2]){
            return true;
        }
        if(isMarked[0][2] && isMarked[1][1] && isMarked[2][0]){
            return true;
        }
        return false;
    }
}

Measured memory_bytes: 23764
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n,k = mi()
if n == 0:
    print(0)
    exit()
ans = n
temp1 = n % k
temp2 = k - temp1
ans = min(temp1,ans)
ans = min(temp2,ans)
print(ans)

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

int main() {
  int n, m, x;
  cin>>n>>m>>x;
  int c[n];
  int a[n][m];
  for (int i=0; i<n; i++) {
    cin>>c[i];
    for (int j=0; j<m; j++) {
      cin>>a[i][j];
    }
  }
  int ans = -1;
  for (int i=0; i<(1<<n); i++) {
    int rikaido[m];
    for (int j=0; j<m; j++) rikaido[j] = 0;
    int cost = 0;
    for (int j=0; j<n; j++) {
      if ((i>>j) & 1) {
        cost += c[j];
        for (int k=0; k<m; k++) {
          rikaido[k] += a[j][k];
        }
      }
    }
    bool ok = true;
    for (int j=0; j<m; j++) {
      if (rikaido[j] < x) {
        ok = false;
        break;
      }
    }
    if (ok) {
      if (ans == -1) {
        ans = cost;
      } else {
        ans = min(cost, ans);
      }
    }
  }
  cout<<ans<<endl;
}

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

using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

#define REP(i, l, n) for(int i=(l), i##_len=(n); i<i##_len; ++i)
#define ALL(x) (x).begin(),(x).end()
#define pb push_back

ll gcd(ll a,ll b){return b ? gcd(b,a%b) : a;}
ll lcm(ll a,ll b){return a/gcd(a,b)*b;}

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

char alpha[26] = {'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z'};

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

int main(){
    int n; cin >> n;
    vector<vector<ll> > tlis(n, vector<ll>(3));
    ll sum = 0;
    REP(i, 0, n){
        cin >> tlis[i][0] >> tlis[i][1];
        tlis[i][2] = tlis[i][0] + tlis[i][1];
        sum -= tlis[i][1];
    }
    sort(ALL(tlis), [](auto &x, auto &y){return x[2] > y[2];});
    for(int i = 0; i < n; i+= 2){
        sum += tlis[i][2];
    }
    cout << sum << endl;
}

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

int main() {
	int N, P, A, odd = 0, even = 0;
	int64_t sum = 0, num;
	cin >> N >> P;
	for (int i = 0;i < N;i ++) {
		cin >> A;
		if (A % 2) odd ++;
		else even ++;
	}
	for (int i = P;i <= odd;i += 2) {
		for (int j = 0;j <= even;j ++) {
			num = 1;
			for (int k = 0;k < i;k ++) {
				num *= odd - k;
				num /= k + 1;
			}
			for (int k = 0;k < j;k ++) {
				num *= even - k;
				num /= k + 1;
			}
			sum += num;
		}
	}
	cout << sum;
	return 0;
}

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

using namespace std;

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

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

int mpa[4];
int mpb[4];

// LRUD
int dx[] = {-1, 1, 0, 0};
int dy[] = {0, 0, -1, 1};
string str = "LRUD";
int ch[] = {1, 0, 3, 2};

void ansNO(int n){
	//cout << "IN ansNO " << str[n] << endl;
	cout << "NO" << endl;
	exit(0);
}

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

	ll h, w, n;cin >> h >> w >> n;
	int y, x;cin >> y >> x;
	string a, b;cin >> a >> b;

	REP(i, n){
		//cout << i << endl;
		//cout << a[i] << " " << b[i] << endl;
		REP(j, 4)if(a[i] == str[j]){
			mpa[ch[j]]++;
			y += dy[j];
			x += dx[j];
		}
		//cout << "y x " << y << " " << x << endl;
		if(mpb[0] < 0 || mpa[1] - mpb[0] > abs(x - w))ansNO(0);
		if(mpb[1] < 0 || mpa[0] - mpb[1] > abs(x - 1))ansNO(1);
		if(mpb[2] < 0 || mpa[3] - mpb[2] > abs(y - h))ansNO(2);
		if(mpb[3] < 0 || mpa[2] - mpb[3] > abs(y - 1))ansNO(3);

		REP(j, 4)if(b[i] == str[j]){
			mpb[ch[j]]++;
			y += dy[j];
			x += dx[j];
		}
		//cout << "y x " << y << " " << x << endl;

		while(x < 1){x++;mpb[1]--;}
		while(x > w){x--;mpb[0]--;}
		while(y < 1){y++;mpb[3]--;}
		while(y > h){y--;mpb[2]--;}

		//cout << "y x " << y << " " << x << endl;
		//cout << "mpa ";REP(j, 4)cout << mpa[j] << " ";cout << endl;
		//cout << "mpb ";REP(j, 4)cout << mpb[j] << " ";cout << endl;

		if(mpb[0] < 0 || mpa[1] - mpb[0] > abs(x - w))ansNO(0);
		if(mpb[1] < 0 || mpa[0] - mpb[1] > abs(x - 1))ansNO(1);
		if(mpb[2] < 0 || mpa[3] - mpb[2] > abs(y - h))ansNO(2);
		if(mpb[3] < 0 || mpa[2] - mpb[3] > abs(y - 1))ansNO(3);
	}

	cout << "YES" << endl;

	return 0;
}


Measured memory_bytes: 920
loop do
	h,w=gets.chomp.split.map(&:to_i)
	break if h==0 && w==0

	h.times do |i|
		w.times do |j|
			if(i==0 || i==h-1 || j==0 || j==w-1)
				print "#"
			else print "."
			end
		end
		puts
	end
	puts

end

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define ll long long
#define vi vector<ll>
#define sll(x) scanf("%lld",&x)
#define prll(x) printf("%lld ",x)
#define pri(x) printf("%d ",x)
#define si(x) scanf("%d",&x)
#define el printf("\n")
#define pb push_back
#define f first
#define s second
#define arrondi(a) (long long)floor(a+0.5);
#define NIL -1
ll N=500005;
ll MAX=9223372036854775807;
ll MOD=1000000007;
long double PI =4*atan(1);

int main()
{
	IOS;
    cout.precision(30);
    int n; cin >> n; vector<ll> A(n,0);
    for (int i=0;i<n;i++)
    {
        cin >> A[i]; A[i]--;
    }
    for (int i=1;i<n;i++)
    {
        if (A[i]<A[i-1])
        {
            A[i]++;
        }
    }
    bool res=true;
    for (int i=0;i<n-1;i++)
    {
        if (A[i]>A[i+1])
            res=false;
    }
    if (!res) cout << "No\n"; else cout << "Yes\n";
    return 0;
}


Measured memory_bytes: 1024
import numpy as np

N = int(input())
AB = np.zeros((3, N))

for i in range(N):
    tmpA, tmpB = map(int, input().split())
    AB[0, i] = tmpA + tmpB
    AB[1, i] = tmpA
    AB[2, i] = tmpB

AB = AB[:, np.argsort(AB[0, :])][:, ::-1]

point = 0
for i in range(N):
    if i%2==0:
        point += AB[1, i]
    else:
        point -= AB[2, i]
 
print(int(point))


Measured memory_bytes: 19912
#include<iostream>
#include<algorithm>
#include<map>
using namespace std;
#define fr first
#define sc second
typedef pair< int , int > Pt;
int m, n;
bool serach( Pt *a, Pt *b, int& x,int& y){
  for(int j = 1 ; j < m ; j++ ){
    if(!binary_search(b,b+n,Pt(a[j].fr+x,a[j].sc+y))) return false;
  }
  return true;
}
int main(){
  while(cin >> m , m){
    Pt M[m];
    for(int i = 0 ; i < m ; i++ ) cin >> M[i].fr >> M[i].sc;
    cin >> n;
    Pt D[n];
    for(int i = 0 ; i < n ; i++ ) cin >> D[i].fr >> D[i].sc;
    sort(D,D+n);
    for(int i = 0 ; i < n ; i++ ){
      int x = D[i].fr - M[0].fr , y = D[i].sc - M[0].sc;
      if(serach(M,D,x,y)){
        cout << x << " " << y << endl;
        break;
      }
    }
  }
}

Measured memory_bytes: 1168
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
constexpr int di[] = { 0, 1, 0, -1 }, dj[] = { 1, 0, -1, 0 };
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define SORTR(v) sort((v).rbegin(), (v).rend())
#define all(v) (v).begin(), (v).end()
#define vmax 10000
constexpr ll inf = 1e18+7;
/*cout<<fixed<<setprecision(20);cin.tie(0);ios::sync_with_stdio(false);*/
ll n,a,ans=0;
ll dp[53][53][2503];

int main(){
  cin>>n>>a;
  vector<int> x(n);
  rep(i,n){
    cin>>x[i];
  }
  rep(i,2501){
    dp[0][0][i]=0;
  }

  dp[0][0][0]=1;

  rep(i,n){
    rep(k,n){
      rep(j,2501){
      if(j-x[i]>=0){
        dp[i+1][k+1][j]+=dp[i][k][j-x[i]];
        dp[i+1][k][j]+=dp[i][k][j];
      }else{
        dp[i+1][k][j]+=dp[i][k][j];
      }
      }
    }
  }
  rep(k,n+1){
    rep(j,2501){
      if(j==k*a){
        ans+=dp[n][k][j];
      }
    }
  }
  cout<<ans-1<<endl;
  return 0;
}


Measured memory_bytes: 52480
a = gets.to_i
b = gets.to_i
c = gets.to_i
x = gets.to_i

count = 0
for i in 0..a do
        for j in 0..b do
                for k in 0..c do
                        if i * 500 + j * 100 + k * 50 == x
                                count += 1
                        end
                end
        end
end

puts count

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

using ll = long long;
using Vi = vector<int>;
using Vl = vector<ll>;
using Pii = pair<int, int>;
using Pll = pair<ll, ll>;

constexpr int I_INF = numeric_limits<int>::max();
constexpr ll L_INF = numeric_limits<ll>::max();

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

void solve() {
    ll N;
    cin >> N;
    Vl A(N), B(N);
    for (ll i = 0; i < N; i++) {
        cin >> A[i];
    }
    for (ll i = 0; i < N; i++) {
        cin >> B[i];
    }
    Vl cumA(N + 1), cumB(N + 1);
    for (ll i = 0; i < N; i++) {
        cumA[i + 1] = cumA[i] + A[i];
        cumB[i + 1] = cumB[i] + B[i];
    }

    ll ans = 0;
    for (ll i = 0; i < N; i++) {
        ans = max(ans, cumA[i + 1] + cumB[N] - cumB[i]);
    }

    cout << ans << "\n";
}

//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

int main() {
#ifdef FASTIO
    cin.tie(0), cout.tie(0);
    ios::sync_with_stdio(false);
#endif
#ifdef FILEINPUT
    ifstream ifs("./in_out/input.txt");
    cin.rdbuf(ifs.rdbuf());
#endif
#ifdef FILEOUTPUT
    ofstream ofs("./in_out/output.txt");
    cout.rdbuf(ofs.rdbuf());
#endif
    solve();
    cout << flush;
    return 0;
}

Measured memory_bytes: 256
// D - Coloring Edges on Tree
#include <bits/stdc++.h>
using namespace std;
#define rp(i,s,e) for(int i=(s);i<(e);++i)
#define NMAX 100000

int K = 1;
int C[NMAX+1];//child
int S[NMAX+1];//sibling
int colors[NMAX+1];

void dfs(int p, int p_color){
	int color = 1;
	for(int c=C[p]; c; c=S[c]){
		if(colors[c]) continue;
		colors[c] = color==p_color? ++color: color;
		K = max(K, color);
		dfs(c, color++);
	}
}

int main(){
	int N; cin>>N;
	int Q[N];
	for(int i=1; i<=N-1; ++i){
		int p,c; scanf("%d%d",&p,&c);
		Q[i] = c;
		int s = C[p];
		C[p] = c;
		S[c] = s;
	}
	colors[0] = NMAX;
	dfs(1, 0);
	printf("%d\n", K);
	rp(i, 1, N) printf("%d\n", colors[Q[i]]);
}

Measured memory_bytes: 3968
#include <bits/stdc++.h>
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <random>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define repp(i,n,m) for (int i = m; i < (n); ++i)
#define repl(i,n) for (long long i = 0; i < (n); ++i)
#define reppl(i,n,m) for (long long i = m; i < (n); ++i)
using namespace std;
using ll = long long;
using ld = long double;
using P = pair<int, int>;
using PL = pair<long long, long long>;
using Pxy = pair<double, double>;
using T = tuple<int, int, bool>;
const int INF = 1001001007;
const int mod = 1000000007;
const int MOD = 998244353;
const ll inf = 1e18;
template <typename AT>
void printvec(vector<AT> &ar){
    rep(i,ar.size()-1) cout << ar[i] << " ";
    cout << ar[ar.size()-1] << endl;
}
template <typename Q>
void printvvec(vector<vector<Q>> &ar){
    rep(i,ar.size()){
        rep(j,ar[0].size()-1) cout << ar[i][j] << " ";
        cout << ar[i][ar[0].size()-1] << endl;
    }
}
template <typename S>
bool range(S a, S b, S x){
    return (a <= x && x < b);
}

int main() {
    string s; cin >> s;
    int a = 0;
    int b = 0;
    int c = 0;
    rep(i,3){
        if (s[i] == 'a') a++;
        if (s[i] == 'b') b++;
        if (s[i] == 'c') c++;
    }
    if (a*b*c==1) cout << "Yes" << endl;
    else cout << "No" << endl;
}

Measured memory_bytes: 3608
import std.stdio;
import std.range;
import std.conv;
import std.algorithm;
import std.array;
import std.string;


void main()
{
    int r, c;
    readf("%d %d\n", &r, &c);
    int[][] a = new int[][r];
    for (int y = 0; y < r; y++)
    {
        a[y] = readln.strip.split(' ').map!(to!int).array;
        writeln((a[y] ~ a[y].sum).map!(to!string).join(" "));
    }
    int D = 0;
    for (int x = 0; x < c; x++)
    {
        int C = 0;
        for (int y = 0; y < r; y++)
        {
            C += a[y][x];
        }
        D += C;
        write(C, " ");
    }
    writeln(D);
}



Measured memory_bytes: 3180
th = 10 ** 9

S = int(input())

if S <= th:
    print(0, 0, 1, 0, 1, S)
else:
    a = th
    d = -(-S // th)
    b = 1
    c = a * d - S
    print(0, 0, a, b, c, d)


Measured memory_bytes: 2940
#include<bits/stdc++.h>
#define ls p<<1
#define rs p<<1|1 
#define fast ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define mm make_pair
#define pi 2*acos(0.0)
#define lcm(a,b) (a*b)/__gcd(a,b)
#define cp(i,ans) printf("%.if",ans);
#define cpp(i,ans) cout.precision(i);cout<<fixed<<ans<<endl;
#define lowbit(x) (x)&(-x)
#define out(x) {cout<<x<<endl;return 0;} 
#define all(v) v.begin(),v.end() 
#define mem(x,i) memset(x,i,sizeof(x)) 
#define mec(x,y) memcpy(x,y,sizeof(y))
#define eps 1e-8 
#define ull unsigned long long
#define cps CLOCKS_PER_SEC
using namespace std;
typedef long long ll;
const int mod=1e9+7;
const int inf=0x3f3f3f3f;
ll gcd(ll x,ll y){if(y==0) return x;else return gcd(y,x%y);} 
ll ksm(ll a,ll b){ll r=1;while(b){if(b&1) r=(r*a)%mod;a=a*a%mod;b>>=1;}return r;} 
void exgcd(ll a, ll b, ll &x, ll &y, ll &d){if(!b) d=a,x=1,y=0;else exgcd(b,a%b,y,x,d),y-=a/b*x;}
ll inv(ll a, ll p){ll x,y,d;exgcd(a,p,x,y,d);x=(x%p+p)%p;return x;}
inline int read()
{
    char c=getchar();int x=0,f=1;
    while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}
    while(c>='0'&&c<='9'){x=x*10+c-'0';c=getchar();}
    return x*f;
}
const int maxn=1e5+100;
ll n,m,k,t;
int main()
{
	cin>>n;
	int g=gcd(n,360);
	int ans=360/g;
	cout<<ans<<endl;
}

Measured memory_bytes: 3616
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace atcoder
{
	class Program
	{
		static void Main(string[] args)
		{
			String input = Console.ReadLine();
			StringBuilder sb = new StringBuilder();
			for(int i = 0;i < input.Length;i += 2)
			{
				sb.Append(input[i]);
			}
			Console.WriteLine(sb.ToString());
		}
	}
}


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

  int a[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};

int main(int argc, char *argv[]) {
  ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);


  int k;cin>>k;
  cout<<a[k-1]<<endl;

  

  
  return 0;
}


Measured memory_bytes: 256
using System;

namespace ConsoleApplication1
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                string a = Console.ReadLine();
                    if (a == null)
                        break;
                string[] aa = a.Split();
                int data1 = int.Parse(aa[0]);
                int data2 = int.Parse(aa[1]);

                int data0 = data1 + data2;

                int count = 1;
                while (true)
                {

                    data0 /= 10;
                    if (data0 != 0)
                        count++;
                    else
                        break;
                }
                Console.WriteLine(count);
            }
            Console.ReadLine();
            //int[] ans = { 0, 0, 0 };
            //for (int i = 0; i < 10; i++)
            //{
            //    string a = Console.ReadLine();
            //    int aa = int.Parse(a);

            //    if (ans[0] < aa)
            //    {
            //        ans[2] = ans[1];
            //        ans[1] = ans[0];
            //        ans[0] = aa;
            //    }
            //    else if (ans[1] < aa)
            //    {
            //        ans[2] = ans[1];
            //        ans[1] = aa;
            //    }
            //    else if (ans[2] < aa)
            //    {
            //        ans[2] = aa;
            //    }
            //}

            //Console.WriteLine(ans[0]);
            //Console.WriteLine(ans[1]);
            //Console.WriteLine(ans[2]);
            //Console.ReadLine();

            //    for (int i = 1; i <= 9; i++)
            //    {
            //        for (int ii = 1; ii <= 9; ii++)
            //        {
            //            string ans;
            //            ans = i+"x"+ii+"="+i*ii;
            //            Console.WriteLine(ans);

            //        }

            //    }
            //            Console.ReadLine();        }
        }
    }
}

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

typedef long long ll;

ll gcd ( ll a, ll b ) {
	ll c;
	while ( a != 0 ) {
		c = a; a = b%a; b = c;
	} return b; 
}

ll lcm (ll a, ll b){
	return a/gcd(a,b)*b;
}

int main(){
	int N;
	cin>>N;
	ll x,ans;
	N--;
	cin>>ans;
	while(N--){
		cin>>x;
		ans=lcm(ans,x);
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
n, time = map(int, input().split())
 
arr = list(map(int, input().split())) + [float("inf")]
 
left, temp, sum_time = 0, 0, 0
 
for t in arr[1:]:
  if t <= temp + time:
    temp = t
  else:
    sum_time += (temp + time - left)
    left, temp = t, t
 
print(sum_time)

Measured memory_bytes: 25196
a,b=map(int,input().split())
import math
a_min=math.ceil(a*12.5)
a_max=(a+1)*12.5
b_min=math.ceil(b*10)
b_max=(b+1)*10
if a_max<=b_min or b_max<=a_min:
  print(-1)
else:
  print(max(a_min,b_min))

Measured memory_bytes: 3060
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define FAST() ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

int main()
{
    FAST();
    ll n,k,i;
    cin>>n>>k;
    ll arr[n+3];
    for(i=1; i<=n; i++)cin>>arr[i];

    for(i=k+1; i<=n; i++)
    {
        if(arr[i]>arr[i-k])cout<<"Yes"<<endl;
          else cout<<"No"<<endl;
    }





    return 0;
}







Measured memory_bytes: 5164
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(int)(a); (i)<(int)(b); ++(i))
#define rFor(i, a, b) for(int (i)=(int)(a)-1; (i)>=(int)(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<int, lint> pil;
typedef pair<lint, lint> pll;
template<class T> bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T> bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;}
template<class T> T div_floor(const T a, const T b){return a>=0 ? a/b : (a+1)/b-1;}
template<class T> T div_ceil(const T a, const T b){return a>=0 ? (a-1)/b+1 : a/b;}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod*mod;
constexpr int MAX = 200010;

int main(){
    int n, m;
    scanf("%d%d", &n, &m);
    double l[n], a[n], b[n];
    rep(i, n) scanf("%lf%lf%lf", &l[i], &a[i], &b[i]);
    double ans = 0;
    rep(S, 1<<n)if(__builtin_popcount(S) == m){
        double tmp = 0;
        rep(i, n)if(S>>i & 1)For(j, i+1, n)if(S>>j & 1){
            tmp += pow(l[i]-l[j], 2) + pow(a[i]-a[j], 2) + pow(b[i]-b[j], 2);
        }
        chmax(ans, tmp);
    }
    printf("%.20lf\n", ans);
}


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

#define INF 1000010000
#define nl '\n'
#define pb push_back
#define ppb pop_back
#define mp make_pair
#define fi first
#define se second
#define pii pair<int,int>
#define pdd pair<double,double>
#define all(c) (c).begin(), (c).end()
#define SORT(c) sort(all(c))
#define sz(c) (c).size()
#define rep(i,n) for( int i = 0; i < n; ++i )
#define repi(i,n) for( int i = 1 ; i <= n; ++i )
#define repn(i,n) for( int i = n - 1 ; i >= 0 ; --i )
#define repf(j,i,n) for( int j = i ; j < n ; ++j )
#define die(s) {std::cout << s << nl;}
#define dier(s) {std::cout << s; return 0;}
#define dbg(var) {std::cout << #var << "  = " << var << nl;}
#define vi vector<int>
typedef long long ll;

using namespace std;


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

	int a , b;
	cin >> a >> b;
	cout << (3 * a + b) / 2;

	return 0;
}

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

using namespace std;

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

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

    vector<long long> a, b;
    a.push_back(0);
    b.push_back(0);
    for (int i = 0; i < N; ++i) {
        a.push_back(a[i] + (long long)A[i]);
    }
    for (int i = 0; i < M; ++i) {
        b.push_back(b[i] + (long long)B[i]);
    }

    int res = 0;
    int B_pos = M;
    for (int i = 0; i <= N; ++i) {
        if (a[i] > K) {
            break;
        }
        while (b[B_pos] > K - a[i]) {
            B_pos--;
        }
        res = max(res, i + B_pos);
    }

    cout << res << endl;
}


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

int main(){
    int n;
    cin >> n;
    vector<int> v(n);
    for(auto &x: v) cin >> x;
    int cnt=1;
    bool direct_is_unset=true;
    bool direct_is_upper=true;
    int prev= v[0];
    for(int i=1; i<n; i++){
        if(direct_is_unset){
            direct_is_unset = prev == v[i];
            direct_is_upper = prev < v[i];
        } else if(direct_is_upper){
            if(prev > v[i]){
                cnt+=1;
                direct_is_unset = true;
            }
        } else if(!direct_is_upper){
            if(prev < v[i]){
                cnt+=1;
                direct_is_unset = true;
            }

        }
        prev = v[i];
    }
    cout << cnt << endl;
}

Measured memory_bytes: 640
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = Integer.parseInt(sc.next());
		int M = Integer.parseInt(sc.next());
		int C = Integer.parseInt(sc.next());
		ArrayList<Integer> listB = new ArrayList<>();
		int[][] listA = new int[N][M];
		for(int i = 0; i< M; i++) {
			listB.add(Integer.parseInt(sc.next()));
		}
		for(int i = 0; i< N; i++) {
			for(int j = 0; j < M; j++) {
				listA[i][j] = Integer.parseInt(sc.next());
			}
		}
		sc.close();

		int count = 0;
		for(int i = 0; i < N; i++) {
			int tmp = C;
			for(int j = 0; j < M; j++) {
				tmp += listA[i][j] * listB.get(j);
			}
			if(tmp > 0) count++;
		}

		System.out.println(count);
	}

}


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

int main() {
  int x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  int dx = x2 - x1, dy = y2 - y1;
  int a = abs(dx), b = abs(dy);
  int x3, y3, x4, y4;
  if (0 <= dx && 0 < dy) {
    x3 = x2 - b; y3 = y2 + a;
    x4 = x3 - a; y4 = y3 - b;
  } else if (dx < 0 && 0 <= dy) {
    x3 = x2 - b; y3 = y2 - a;
    x4 = x3 + a; y4 = y3 - b;
  } else if (dx < 0 && dy <= 0) {
    x3 = x2 + b; y3 = y2 - a;
    x4 = x3 + a; y4 = y3 + b;
  } else {
    x3 = x2 + b; y3 = y2 + a;
    x4 = x3 - a; y4 = y3 + b;
  }
  printf("%d %d %d %d\n", x3, y3, x4, y4);
}

Measured memory_bytes: 256
def main():
    N, M = [int(i) for i in input().split()]

    if N == 1 and M == 1:
        print(1)
    elif N == 1:
        print(M - 2)
    elif M == 1:
        print(N - 2)
    else:
        print((N - 2) * (M - 2))

main()


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define mo 998244353
using namespace std;
int n, m, i, j, k, x, y, book[20005], zhan[20005], flag, f[2005][2005];
int top, nex[20005], to[20005], fir[20005];
int lj(int u, int v)
{
	top++;
	nex[top] = fir[u];
	fir[u] = top;
	to[top] = v;
}
long long read()
{
	long long xx = 0, flagg = 1;
	char ch = getchar();
	while ((ch < '0' || ch > '9') && ch != '-')
		ch = getchar();
	if (ch == '-')
	{
		flagg = -1;
		ch = getchar();
	}
	while (ch >= '0' && ch <= '9')
	{
		xx = xx * 10 + ch - '0';
		ch = getchar();
	}
	return xx * flagg;
}
void pus(long long xx, int flagg)
{
	if (xx >= 10)
		pus(xx / 10, 0);
	putchar(xx % 10 + '0');
	if (flagg == 1)
		putchar(' ');
	if (flagg == 2)
		putchar('\n');
	return;
}
void ss(int v)
{
	if (flag != 0)
		return;
	if (book[v] != 0)
	{
		flag = book[v];
		return;
	}
	top++;
	book[v] = top;
	zhan[top] = v;
	for (int top1 = fir[v]; top1; top1 = nex[top1])
		ss(to[top1]);
	if (flag != 0)
		return;
	book[v] = 0;
	zhan[top] = 0;
	top--;
}
int main()
{
	n = read();
	m = read();
	for (i = 1; i <= m; i++)
	{
		x = read();
		y = read();
		f[x][y] = 1;
		lj(x, y);
	}
	for (i = 1; i <= n; i++)
		if (flag == 0)
			ss(i);
	if (flag == 0)
	{
		printf("-1\n");
		return 0;
	}
	for (i = 1; i <= top - flag + 1; i++)
		zhan[i] = zhan[i + flag - 1];
	top = top - flag + 1;
	for (i = 1; i <= n; i++)
		book[i] = 0;
	for (i = 1; i <= top; i++)
		book[zhan[i]] = i;
	while (1)
	{
		flag = 0;
		for (i = 1; i <= top; i++)
		{
			for (j = 1; j <= top; j++)
				if (i + 1 != j && (i != top || j != 1))
				{
					if (f[zhan[i]][zhan[j]] == 1)
					{
						flag = 1;
						if (j < i)
						{
							for (k = 1; k <= i - j + 1; k++)
								zhan[k] = zhan[j + k - 1];
							top = i - j + 1;
						}
						else
						{
							for (k = 1;; k++)
							{
								zhan[i + k] = zhan[j + k - 1];
								if (j + k - 1 == top)
								{
									top = i + k;
									break;
								}
							}
						}
					}
					if (flag == 1)
						break;
				}
			if (flag == 1)
				break;
		}
		if (flag == 0)
			break;
	}
	pus(top, 2);
	for (i = 1; i <= top; i++)
		pus(zhan[i], 2);
	return 0;
}

Measured memory_bytes: 7552
#include<stdio.h>
int main()
{
	int n,m,i,j,k;
	char c;
	while(scanf("%d%d",&n,&m),n)
	{
		int a[100]={0};
		for(k=0;k<m;++k)
		{
			scanf(" %c",&c);
			if(c=='A')
			{
				for(i=0;i<n;++i)if(!a[i]){a[i]=1;break;}
			}
			if(c=='B')
			{
				for(i=n-1;i>=0;--i)if(!a[i]){a[i]=2;break;}
			}
			if(c=='C')
			{
				if(!k)a[n/2]=3;
				else
				{
					for(i=0;i<n;++i)
					{
						if(i!=n-1&&a[i]&&!a[i+1]){a[i+1]=3;break;}
						if(i&&a[i]&&!a[i-1]){a[i-1]=3;break;}
					}
				}
			}
			if(c=='D')
			{
				if(!k)a[0]=4;
				else
				{
					int mc=-1,mi=-1,x,y;
					for(i=0;i<n;++i)
					{
						x=y=999;
						for(j=i;j>=0;--j)if(a[j]){x=i-j;break;}
						for(j=i;j<n;++j)if(a[j]){y=j-i;break;}
						if(x>y)x=y;
						if(mc<x)mc=x,mi=i;
					}
					a[mi]=4;
				}
			}
		}
		for(i=0;i<n;++i)putchar("#ABCD"[a[i]]);
		puts("");
	}
	return 0;
}

Measured memory_bytes: 0
use proconio::input;
#[allow(unused_imports)]
use proconio::marker::{Bytes, Chars};
#[allow(unused_imports)]
use std::cmp::{min, max};

fn main() {
	input! {
		a: usize,
		b: usize,
		c: usize,
	}

	if c <= a+b {
		println!("Yes");
	}
	else {
		println!("No");
	}
}



Measured memory_bytes: 2068
#include<bits/stdc++.h>
using namespace std;
int main() {
    string s;
    cin >> s;
    for (int i = 0; i < 3;i++){
        if(s[i]==s[i+1]){
            cout << "Bad" << endl;
            return 0;
        }
    }
    cout << "Good" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<algorithm>

using namespace std;
int main()
{
    int n,m;
    cin >> n >> m;
    int s[n+1];
    s[0]=m;
    int ss=1;
    for(int i=1;i<=n;i++){
        int a,b;
        cin >> a >> b;
        s[i]=s[i-1]+(a-b);
        if(s[i]<0){
            ss=0;
            break;
        }
    }
    
    if(ss==0){
        cout << "0" << endl;
    }else{
        sort(s,s+n+1);
        cout << s[n] << endl;
    }
    return 0;
}


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

using namespace std;

int main(){
  
  string S;
  cin >> S;
  int mon = 700;
  
  if(S[0] == 'o') mon=mon+100;
  if(S[1] == 'o') mon=mon+100;
  if(S[2] == 'o') mon=mon+100;
  
  cout << mon << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < n; ++i)
using ll = long long;
using P = pair<int,int>;
// Sieve of Eratosthenes
// https://youtu.be/UTVg7wzMWQc?t=2774
struct Sieve {
  int n;
  vector<int> f, primes;
  Sieve(int n=1):n(n), f(n+1) {
    f[0] = f[1] = -1;
    for (ll i = 2; i <= n; ++i) {
      if (f[i]) continue;
      primes.push_back(i);
      f[i] = i;
      for (ll j = i*i; j <= n; j += i) {
        if (!f[j]) f[j] = i;
      }
    }
  }
  bool isPrime(int x) { return f[x] == x;}
  vector<int> factorList(int x) {
    vector<int> res;
    while (x != 1) {
      res.push_back(f[x]);
      x /= f[x];
    }
    return res;
  }
  vector<P> factor(int x) {
    vector<int> fl = factorList(x);
    if (fl.size() == 0) return {};
    vector<P> res(1, P(fl[0], 0));
    for (int p : fl) {
      if (res.back().first == p) {
        res.back().second++;
      } else {
        res.emplace_back(p, 1);
      }
    }
    return res;
  }
};
int main() {
   int n;cin>>n;
   int ans=0;
   Sieve primes(1000000);
   rep(i,n-1){
      int sum=1;
      for (auto &&i : primes.factor(n-i-1))
         sum*=i.second+1;
      ans+=sum;
   }
   cout<<ans<<endl;
}

Measured memory_bytes: 7828
#include<bits/stdc++.h>
using namespace std;
int field[11][11];
int main() {
    while(true) {
        int H, W;
        cin >> H >> W;
        if(H == 0 && W == 0) break;
        for(int h = 1; h <= H; h++) {
            for(int w = 1; w <= W; w++) {
                cin >> field[h][w];
            }
        }
        int ans = 0;
        for(int h1 = 1; h1 <= H; h1++) {
            for(int h2 = h1 + 2; h2 <= H; h2++) {
                for(int w1 = 1; w1 <= W; w1++) {
                    for(int w2 = w1 + 2; w2 <= W; w2++) {
                        int innermaxi = 0;
                        int outermini = 15;
                        for(int h = h1; h <= h2; h++) {
                            outermini = min(outermini, field[h][w1]);
                            outermini = min(outermini, field[h][w2]);
                        }
                        for(int w = w1; w <= w2; w++) {
                            outermini = min(outermini, field[h1][w]);
                            outermini = min(outermini, field[h2][w]);
                        }
                        int now = 0;
                        for(int w = w1 + 1; w < w2; w++) {
                            for(int h = h1 + 1; h < h2; h++) {
                                innermaxi = max(innermaxi, field[h][w]); 
                                now += outermini - field[h][w];
                            }
                        }
                        if(innermaxi >= outermini) continue;
                        ans = max(ans, now);
                    }
                }
            }
        }
        cout << ans << endl;
    }
    return 0;
}


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

typedef struct Mise {
	string s;
	int p;
	int num;
}mise;

bool cmp(const mise& a, const mise& b) {
	if (a.s == b.s) {
		return a.p > b.p;
	}
	else {
		return a.s < b.s;
	}
}

int main() {
	int n; cin >> n;
	//mise m;
	vector<mise> m(n);
	//vector<string> s(n);
	//vector<int> p(n);
	for (int i = 0; i < n; i++) {
		cin >> m[i].s >> m[i].p;
		m[i].num = i+1;
	}
	sort(m.begin(), m.end(),cmp);
	for (int i = 0; i < n; i++) {
		cout << m[i].num << endl;
	}
	return 0;
}

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

#define ll long long

const int maxn = 2e5 + 5;
int a[maxn];
ll f[maxn][3];

int main() {
    int n;
    scanf("%d", &n);
    for (int i = 1; i <= n; ++i) {
        scanf("%d", &a[i]);
    }
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j < 3; ++j) {
            f[i][j] = -1e18;
        }
    }
    for (int i = 1; i <= 3; ++i) {
        f[i][i - 1] = a[i];
    }
    f[3][0] = a[1] + a[3];
    for (int i = 4; i <= n; ++i) {
        f[i][0] = f[i - 2][0] + a[i];
        f[i][1] = max(f[i - 2][1], f[i - 3][0]) + a[i];
        f[i][2] = max(f[i - 2][2], f[i - 3][1]) + a[i];
        if (i > 4) {
            f[i][2] = max(f[i][2], f[i - 4][0] + a[i]);
        }
    }
    ll ans;
    if (n & 1) {
        ans = max(f[n][2], max(f[n - 1][1], f[n - 2][0]));
    }else {
        ans = max(f[n][1], f[n - 1][0]);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 9108
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>
#include <iomanip> 

using ll = long long;
using ull = unsigned long long;
using namespace std;

#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i = 0;(i) < ((int)(n));++(i))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() )
#define test(a) cout<<"line:"<<__LINE__<<"["<<(#a)<<": "<<(a)<<"]"<<endl

constexpr int INF = 1e9+7;
constexpr ll INFL = 9*1e18;

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

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

int inline digit(ll num){int tmp = 0;while(num){tmp++;num/=10;}return tmp;} // 桁数
template<typename T>inline T SUM(vector<T> vec){return accumulate(all(vec),(T)0);} // vectorの中身を全部足す
template<typename T>inline T digitSum(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;} // 各桁の和
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);} // 最大公約数
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;} // 最小公倍数
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;} // 累乗
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T>inline void print(T&& x){cout<<setprecision(32)<<x<<endl;}


const ll COM_MAX = (ll)(2000); // combinationの最大値
vector<ll> fac(COM_MAX),finv(COM_MAX),inv(COM_MAX);


// TODO: write
int main() {
  int n;cin>>n;
  vector<pair<ll,ll>> a(n);rep(i,n)cin>>a[i].fi>>a[i].se;
  ll ans = 0;
  sort(all(a),[&](auto a1,auto a2){
    chmax(ans,abs(a1.fi - a2.fi) + abs(a1.se - a2.se));
    return a1.fi + a1.se > a2.fi + a2.se;
  });
  chmax(ans,abs(a[0].fi - a[n-1].fi) + abs(a[0].se - a[n-1].se));
  sort(all(a),[&](auto a1,auto a2){
    chmax(ans,abs(a1.fi - a2.fi) + abs(a1.se - a2.se));
    return a1.fi > a2.fi;
  });
  chmax(ans,abs(a[0].fi - a[n-1].fi) + abs(a[0].se - a[n-1].se));
  sort(all(a),[&](auto a1,auto a2){
    chmax(ans,abs(a1.fi - a2.fi) + abs(a1.se - a2.se));
    return a1.se > a2.se;
  });
  chmax(ans,abs(a[0].fi - a[n-1].fi) + abs(a[0].se - a[n-1].se));
  sort(all(a),[&](auto a1,auto a2){
    chmax(ans,abs(a1.fi - a2.fi) + abs(a1.se - a2.se));
    return a1.fi - a1.se > a2.fi - a2.se;
  });
  chmax(ans,abs(a[0].fi - a[n-1].fi) + abs(a[0].se - a[n-1].se));
  print(ans);
  return 0;
}

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

using namespace std;

const int INF = 1001001001;

int main()
{
    int N, M;
    cin >> N >> M;
    vector<pair<int, int>> key;
    for(int i=0;i<M;i++){
        int a, b;
        cin >> a >> b;
        int s = 0;
        for(int j=0;j<b;j++){
            int c;
            cin >> c;
            --c;
            s |= (1 << c);
        }
        key.emplace_back(s, a);
    }

    vector<int> dp(1 << N, INF); // 2^n
    // 空集合
    dp[0] = 0;
    for(int s=0;s<(1<<N);s++){
        for(int i=0;i<M;i++){
            int t = s | key[i].first;
            int cost = dp[s] + key[i].second;
            dp[t] = min(dp[t], cost);
        }
    }
    int ans = dp.back();
    if(ans == INF) ans = -1;
    cout << ans << endl;
}

Measured memory_bytes: 256
a = list(map(int, input().split()))
for d in input():
	if d == "N":
		a = [a[1], a[5], a[2], a[3], a[0], a[4]]
	elif d == "E":
		a = [a[3], a[1], a[0], a[5], a[4], a[2]]
	elif d == "S":
		a = [a[4], a[0], a[2], a[3], a[5], a[1]]
	else:
		a = [a[2], a[1], a[5], a[0], a[4], a[3]]
print(a[0])



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

int main(){
  int res,n; cin>>n;
  string s,t; cin>>s>>t;     
  for(int i=1;i<=n;i++){
   if(s.substr(n-i,i)==t.substr(0,i)){
     res=i;
   }
  }
  cout<<2*n-res<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

int main(void){

    int i,j;
    int N,K;
    char *A; 

    scanf("%d",&N);
    scanf("%d",&K);
    A=malloc(sizeof(char)*N);
    scanf("%s",A);

    //for(i=0;i<N;i++){
    //    scanf("%s",&A[i]);
    //}
    if (A[K-1]=='A'){
        A[K-1]='a';
    }else if (A[K-1]=='B'){
        A[K-1]='b';
    }else{
        A[K-1]='c';
    }
    printf("%s",A);
    return 0;
}


Measured memory_bytes: 128
use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

// const ANSWER: i64 = 999900;
const ANSWER: i64 = 123456700;
const SIMULATE: bool = false;

fn query(v: i64) -> bool {
    println!("? {}", v);
    std::io::stdout().flush().unwrap();
    if SIMULATE {
        (ANSWER <= v && ANSWER.to_string() <= v.to_string())
            || (ANSWER > v && ANSWER.to_string() > v.to_string())
    } else {
        read::<String>() == "Y"
    }
}

fn answer(v: i64) {
    if SIMULATE {
        println!("! {} {}", ANSWER, v);
        assert!(ANSWER == v);
    } else {
        println!("! {}", v);
        std::io::stdout().flush().unwrap();
    }
}

fn main() {
    let mut digits = vec![];
    for i in 0..10 {
        let mut left = if i == 0 { 0 } else { -1 };
        let mut right = 9;
        while right - left > 1 {
            let mut mid = (left + right) / 2;
            let mut v = 0;
            for d in digits.iter() {
                v = v * 10 + d;
            }
            v = v * 10 + mid;
            while v < 1e+9 as i64 {
                v = v * 10 + 9;
            }
            if query(v) {
                right = mid;
            } else {
                left = mid;
            }
        }
        digits.push(right);
    }
    while *digits.last().unwrap() == 0 {
        let mut v = 0;
        if digits.iter().filter(|&&v| v != 0).all(|&v| v == 9) {
            v = 1;
            for i in 0..digits.len() - 1 {
                v *= 10;
            }
            if query(v) {
                break;
            } else {
                digits.pop();
            }
        } else {
            for i in 0..digits.len() - 1 {
                v = v * 10 + 9;
            }
            if query(v) {
                digits.pop();
            } else {
                break;
            }
        }
    }
    let mut ans = 0;
    for d in digits.iter() {
        ans = ans * 10 + d;
    }
    answer(ans);
}


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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))

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

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

struct Edge{
  int to, cost;

  Edge(int t, int c = 0): to(t), cost(c)
  {}
  bool operator>(const Edge& rhs) const{
	return cost > rhs.cost;
  }
  bool operator<(const Edge& rhs) const{
	return cost < rhs.cost;
  }

};
using Graph = vector<vector<Edge>>;

bool topo_sort(const Graph& G, VI& order){
  int N = G.size();
  VI color(N, 0);
  
  function<bool(int)> visit = [&](int v)->bool{
	color[v] = 1;
	for(const auto& e: G[v]){
	  if(color[e.to] == 2) continue;
	  if(color[e.to] == 1) return false;
	  if(!visit(e.to)) return false;
	}
	order.push_back(v);
	color[v] = 2;
	return true;
  };

  for(int u=0;u<N;++u)
	if(!color[u] && !visit(u))
	  return false;
  reverse(begin(order), end(order));
  return true;
}

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

  int N, M;
  cin >> N >> M;
  Graph G(N);
  REP(i,M){
	int a, b;
	cin >> a >> b;
	--a;
	--b;
	G[a].EB(b, 0);
  }

  VI order(N);
  topo_sort(G, order);
  REP(i,N) cout << order[i]+1 << endl;

  vector<bool> uniq(N-1);
  REP(i,N-1){
	for(auto& e: G[order[i]]){
	  if(e.to == order[i+1])
		uniq[i] = true;
	}
  }
  cout << (all_of(ALL(uniq), [](bool b){ return b;})? 0: 1) << endl;

  return 0;
}

Measured memory_bytes: 4496
#include<cstdio>
#include<algorithm>

using namespace std;

const int MA = 100100;

int cnt[100100];
int M;

int calc(int r){
	if(r * 2 == M || r == 0){
		int all = 0;
		for(int i = r; i < MA; i += M){
			all += cnt[i];
		}
		return all / 2;
	}
	int l1 = 0, dif1 = 0;
	int all1 = 0;
	for(int i = r; i < MA; i += M){
		if(cnt[i] % 2 == 1) l1++;
		all1 += cnt[i];
		dif1 += cnt[i] / 2;
	}
	int l2 = 0, dif2 = 0;
	int all2 = 0;
	for(int i = (M - r); i < MA; i += M){
		if(cnt[i] % 2 == 1) l2++;
		all2 += cnt[i];
		dif2 += cnt[i] / 2;
	}
	int r1 = l1 + dif1 * 2;
	int r2 = l2 + dif2 * 2;
	int all = all1 + all2;
	if((all1 + all2) % 2 == 1){
		all--;
		if(l1 < l2){
			l2--;
			r2--;
		}else{
			l1--;
			r1--;
		}
	}
	if(r1 < l2){
		return (all - (l2 - r1)) / 2;
	}else if(r2 < l1){
		return (all - (l1 - r2)) / 2;
	}else{
		return all / 2;
	}
}

int solve(){
	int ans = 0;
	for(int i = 0; i * 2 <= M; ++i){
		ans += calc(i);
	}
	return ans;
}

void input(){
	int N;
	scanf("%d%d", &N, &M);
	for(int i = 0; i < N; ++i){
		int x;
		scanf("%d", &x);
		cnt[x]++;
	}
}

int main(){
	input();
	int ans = solve();
	printf("%d\n", ans);
	return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <queue>
#include <utility>
#define maxn 100005
using namespace std;
typedef long long ll;
inline int getint(){
  char c; int res = 0;
  for(c = getchar();c < '0' || c > '9';c = getchar());
  for(;c >= '0' && c <= '9';c = getchar()) res = res * 10 + (c - '0');
  return res;
}
int n,k;
struct Permu{
  int a[maxn];
  Permu(){
    memset(a,0,sizeof(a));
  }
  void read(){
    for(int i = 1;i <= n;i++) a[i] = getint();
  }
  void print(){
    for(int i = 1;i <= n;i++) printf("%d%c",a[i],i == n ? '\n' : ' ');
  }
  bool operator == (const Permu &p){
    for(int i = 1;i <= n;i++) if(a[i] ^ p.a[i]) return false;
    return true;
  }
  Permu operator * (Permu p){
    Permu res = Permu();
    for(int i = 1;i <= n;i++) res.a[i] = a[p.a[i]];
    return res;
  }
  Permu inv(){
    Permu res = Permu();
    for(int i = 1;i <= n;i++) res.a[a[i]] = i;
    return res;
  }
};
Permu f(Permu p,Permu q){ return q * p.inv(); }
Permu p,q,e,fir[7];
Permu fpow(Permu p,int x){
  Permu res = e;
  while(x){
    if(x & 1) res = res * p;
    x >>= 1;
    p = p * p;
  }
  return res;
}
int main(){
  n = getint(), k = getint();
  for(int i = 1;i <= n;i++) e.a[i] = i;
  p.read(), q.read();
  fir[1] = p, fir[2] = q;
  for(int i = 3;i <= 6;i++) fir[i] = f(fir[i - 2],fir[i - 1]);
  if(k <= 6) fir[k].print();
  else{
    Permu A = q * p.inv();
    Permu r = q.inv() * p * q * p.inv();
    int num = k % 6;
    A = A * fpow(r,k / 6 - 1);
    fir[0] = A * q.inv() * p * A.inv();
    fir[1] = f(A * q.inv() * A.inv(),fir[0]);
    for(int i = 2;i <= num;i++) fir[i] = f(fir[i - 2],fir[i - 1]);
    fir[num].print();
  }
  return 0;
}


Measured memory_bytes: 16000
#include <stdio.h>

int main()
{
  int dt[2];
  int i;
  int wk;
  for(i=1;;i++) {
    scanf("%d %d",&dt[0],&dt[1]);
    if ((dt[0] == 0)&&(dt[1] == 0)) {
      return 0;
    }
    if (dt[0] > dt[1]) {
      wk = dt[0];
      dt[0] = dt[1];
      dt[1] = wk;
    }
    printf("%d %d\n",dt[0],dt[1]);
  }
}

Measured memory_bytes: 600
/*
  Esteban Arango Medina
*/
#include <algorithm>
#include <iostream>
#include <iterator>
#include <numeric>
#include <sstream>
#include <fstream>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cstdio>
#include <vector>
#include <bitset>
#include <cmath>
#include <queue>
#include <tuple>
#include <deque>
#include <stack>
#include <list>
#include <map>
#include <set>
using namespace std;

using ll=long long;
#define int ll

typedef long long ll;
typedef pair<int,int> ii;
typedef pair<string,int> si;
typedef pair<int,ii> iii;
typedef vector <si> vsi;
typedef vector <ii> vii;
typedef vector <int> vi;
typedef vector <char> vc;
typedef vector <string> vs;
typedef map <string,vs> msvs;
typedef map <string,int> msi;
typedef map <char,int> mci;
typedef map <int,int> mii;
typedef map <string,string> mss;
#define rep(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define all(x) (x).begin(), (x).end()
#define pb push_back
#define mp make_pair
#define endl '\n' // Normal `cout << endl` flushes the output every time wich hit performance badly
#define INF 1000000000
#define deb(x) cout<<#x<<": "<<x<<endl;
#define printArray(arr) for(auto x: arr) { cout<<x<<", "; }
#define printMatrix(mat) for(auto x: mat) { cout<<" "; printArray(x); cout<<endl; }
#define printMap(mmap) for(auto p: mmap) { cout<< p.first<<": "<<p.second<<endl; }

signed main(){
  ios_base::sync_with_stdio(false); cin.tie(NULL); // Fast input
  #ifdef LOCAL_PROJECT
    freopen("in.in", "r", stdin);
    // freopen("out.out", "w", stdout);
  #endif

  int T = 1; //cin>>T;
  while(T--) {
    bool ans = false;
    int n; cin>>n;
    while(n>0){
      int digit = n%10;
      if(digit == 7) {ans = true; break;}
      n /= 10;
    }
    if(ans){
      cout<<"Yes";
    }else{
      cout<<"No";
    }
  }
  return 0;
}

Measured memory_bytes: 3652