akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define all(x) (x).begin(), (x).end()
#define li long long
#define itn int

using namespace std;

inline int nxt(){
	int n;
	scanf("%d", &n);
	return n;
}

int main(){

	int n = nxt(), x = nxt();
	vector<int> a(n);
	for (int i = 0; i < n; i++)
		a[i] = nxt();
	vector<int> mins(n);
	long long ans = 1e18;
	for (int i = 0; i < n; i++)
		mins[i] = a[i];
	for (int j = 0; j < n; j++){
		ans = min(ans, 1ll * j * x + accumulate(all(mins), 0ll));
		for (int i = 0; i < n; i++){
			mins[i] = min(mins[i], a[(i - j - 1 + n) % n]);
		}
	}

	cout << ans << "\n";

	return 0;
}


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

using namespace std;

using ll = long long;

vector<ll> g[200001];
vector<bool> used(200001);
ll ans = 0, cur = 0;

void dfs(ll u, ll n){
    cur++;
    if(cur == n){
        ans++;
    }
    used[u] = true;
    for(auto x:g[u]){
        if(used[x])continue;
        else dfs(x, n);
    }
    used[u] = false;
    cur--;
}


int main(){
    ll n, m;
    cin >> n >> m;
    for(ll i = 1; i <= m; ++i){
        ll u, v; cin >> u >> v;
        g[u].push_back(v);
        g[v].push_back(u);
    }
    dfs(1, n);
    cout << ans;
    return 0;
}


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

int main(){
    string s;
    cin >> s;
    string ans;
    if(s=="Sunny"){
        ans="Cloudy";
    }
    else if(s=="Cloudy"){
        ans="Rainy";
    }
    else{
        ans="Sunny";
    }

    cout << ans << endl;

    

    return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<map>
#include<set>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<stack>
#include<limits>
#include<sstream> 
#include<unordered_map>      

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef int itn;
typedef vector<int> vi;
typedef vector<ll> vl;

const int inf = numeric_limits<int>::max() >> 2;
const ll linf = numeric_limits<ll>::max() >> 2;
const ull ulinf = numeric_limits<ull>::max() >> 2;
const double pi = acos(-1);
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
const int dx8[8]={-1,0,1,-1,1,-1,0,1};
const int dy8[8]={-1,-1,-1,0,0,1,1,1};

#define p_queue(i) priority_queue<i> 
#define rp_queue(i) priority_queue<i, vector<i>, greater<i>> 
#define umap(i,j) unordered_map<i,j>
#define P(p) cout<<(p)<<endl
#define PS(p) cout<<(p)<< " "
#define IN cin >> 
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i = (m-1); i >= (int)(n); i--)
#define inrep(n,a) for(int i = 0; i < (int)(n); i++)cin >> a[i];
#define mod(i) ((i)%(ll)(1e9 + 7))
#define divm(a,b) (mod(a * modpow((ll)b,(ll)(1e9+5))))
#define rsort(a,b,c) sort(a, b, greater<c>())
#define vsort(v) sort(v.begin(), v.end())
#define rvsort(v,c) sort(v.begin(), v.end(), greater<c>()) 
#define ft first
#define sd second
#define pb push_back
#define it insert
#define sz(x) ((int)(x).size())
#define lb(a,n,k) (lower_bound(a,a+n,k) - a) 
#define vlb(a,k)  (lower_bound(a.begin(),a.end(),k) - a.begin())
#define ub(a,n,k) (upper_bound(a,a+n,k) - a) 
#define vub(a,k)  (upper_bound(a.begin(),a.end(),k) - a.begin())
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return

ll modpow(ll i,ll j){ ll tmp=1; while(j){ if(j%2)tmp=mod(tmp*i);i=mod(i*i);j/=2;}return tmp;}
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; }

vector<string> split(const string &str, char sep){
    vector<string> v;
    stringstream ss(str);
    string buffer;
    while( getline(ss, buffer, sep) ) {
        v.push_back(buffer);
    }
    return v;
}

//ll ncr[100][100];
//ll nCr(int n, int r){if(n==r) ret ncr[n][r] = 1; if(r==0) ret ncr[n][r] = 1; if(r==1) ret ncr[n][r] = n;if(ncr[n][r]) ret ncr[n][r]; ret ncr[n][r] = nCr(n-1,r) + nCr(n-1,r-1);}

//ll npr[100][100]={};
//ll nPr(int n,int r){if(npr[n][r])ret npr[n][r];if(r==0)ret npr[n][r] = 1;if(r==1)ret npr[n][r] = n;ret npr[n][r] = n * nPr(n-1,r-1);}

//ll nHr(int n,int r){ret nCr(n+r-1,r);}

///////////////////////////////////////////////////////////////////////////

int a,b,c,d[100005] = {},n,m;
string s,t;

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

    P(c/a * b);
    return  0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <cstring>
#define max(a,b)((a)>=(b)?(a):(b))
bool osenbei[10][10000],work[10][10000];
int main() {
	int R,C;
	while(scanf("%d %d",&R,&C),R|C) {
		memset(osenbei,false,sizeof(osenbei));
		for(int i=0;i<R;i++) for(int j=0;j<C;j++) {
			scanf("%d",&osenbei[i][j]);
		}
		int ans=0;
		for(int i=0;i<(1<<R);i++) {
			memcpy(work,osenbei,sizeof(osenbei));
			for(int j=0;j<R;j++) {
				if(i&(1<<j))
					for(int k=0;k<C;k++) work[j][k]^=1;
			}
			int Count=0;
			for(int j=0;j<C;j++) {
				int count=0;
				for(int k=0;k<R;k++) count+=work[k][j];
				Count+=max(count,R-count);
			}
			ans=max(ans,Count);
		}
		printf("%d\n",ans);
	}
}

Measured memory_bytes: 1240
#include<stdio.h>

int main(){
  int i,j,k,m,Kazu[100],sum,key;

  scanf("%d",&j);

  for(i=0;i<j;i++)
    {
      scanf("%d",&Kazu[i]);
    }
  for(i=1;i<j;i++)
    {
      key = Kazu[i];
       
      for(k=0;k<j;k++)
	{
	  printf("%d",Kazu[k]);
	  if(k<j-1)printf(" ");
	}
      m=i;
       
      while(m > 0 && Kazu[m-1] > key)
	{
	  Kazu[m]=Kazu[m-1];
	  m--;
	  Kazu[m]=key;
	}
       
         printf("\n");
    }
   for(k=0;k<j;k++)
	{
	  printf("%d",Kazu[k]);
	  	  if(k<j-1)printf(" ");
	}
   printf("\n");
  return 0;
  
}

Measured memory_bytes: 600
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define all(v) v.begin(), v.end()
long long int gcd(long long int a, long long int b)
{
   if (a%b == 0)
   {
       return(b);
   }
   else
   {
       return(gcd(b, a%b));
   }
}

long long int lcm(long long int a, long long int b)
{
   return a * b / gcd(a, b);
}
int main() {
  long long int A, B;
  cin >> A >> B;
  long long int maxAB = max(A,B);
  long long int minAB = min(A,B);
  long long int ans = lcm(maxAB, minAB);
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
char ch[12][12];
int dh[]={1,0,-1,0},dw[]={0,-1,0,1};
void dfs(int h,int w){
      ch[h][w]='0';
      for(int i=0;i<4;i++){
            int nx=h+dh[i],ny=w+dw[i];
            if(nx>=0&&nx<12&&ny>=0&&ny<12&&ch[nx][ny]=='1')dfs(nx,ny);
      }
      return ;
}
int main(){
      while(cin>>ch[0]){
            int solve=0;
            for(int i=1;i<12;i++)cin>>ch[i];
            for(int i=0;i<12;i++){
                  for(int j= 0;j<12;j++)
                  if(ch[i][j]=='1'){dfs(i,j);solve++;}
            }
            cout << solve << endl;
      }
}

Measured memory_bytes: 1140
#!usr/bin/env python3
from collections import defaultdict
import math
import bisect
import random
def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return list(input())
def IIR(n): return [II() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
mod = 1000000007

#A
a,b = LI()
if b % a == 0:
    print(a+b)
else:
    print(b-a)
#B

#C
"""
def gcd(a,b):
    if a == 0:
        return b
    return gcd(b%a,a)
n = II()
a = LI()
ans = a[0]
for i in range(1,n):
    ans = gcd(ans,a[i])
print(ans)
"""

#D

#E

#F

#G

#H

#I

#J

#K

#L

#M

#N

#O

#P

#Q

#R

#S

#T


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


using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define fore(i,a) for(auto &i:a)

typedef pair <int, int> P;
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
const int  INF = 1 << 30;
const ll INFL = 1LL<<60;
const ll mod = 1000000007;		




int main() {

	int n;
	cin >> n;

	VI h(n);
	REP(i, n)cin >> h[i];

	int ans = 0;
	REP(i, n) {
		bool b = true;
		for (int j = i - 1; j >= 0; j--) {
			if (h[j] > h[i])b = false;
		}
		if (b)ans++;
	}
	cout << ans << endl;

	return 0;
}

Measured memory_bytes: 256
a=[[int(j) for j in input().split()]for i in range(3)]
n=int(input())
s=set()
for i in range(n):
    b=int(input())
    for j in range(3):
        for k in range(3):
            if a[j][k]==b:
                s.add((j+1,k+1))

for i in range(1,4):
    p,q=0,0
    for j in range(1,4):
        if (i,j) in s:
            p+=1
        if (j,i) in s:
            q+=1
    if p==3 or q==3:
        print("Yes")
        exit()
p,q=0,0
for i in range(1,4):
    if (i,i) in s:
        p+=1
    if (i,4-i) in s:
        q+=1
if p==3 or q==3:
    print("Yes")
    exit()

print("No")

Measured memory_bytes: 3064
s = input()


#
# def solve(left, right):
#     if len(right) == 0:
#         return eval(left)
#     return solve(left + right[0], right[1:]) + solve(left + '+' + right[0], right[1:])

def solve(left, right):
    if len(left) == 0:
        return eval(right)
    return solve(left[:-1], left[-1] + right) + solve(left[:-1], left[-1] + '+' + right)


print(solve(s[:-1], s[-1]))


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

int main(void){
  int A, B;
  cin >> A >> B;
  if(A >= 13)
    cout << B << "\n";
  else if(A >= 6)
    cout << B / 2 << "\n";
  else
    cout << 0 << "\n";
  return 0;
}


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

string toString(int a, int l){
    string s = to_string(a);
    while(s.size() < l)s = '0' + s;
    return s;
}

int main(){
    int a, l;
    while(cin >> a >> l, a != 0 || l != 0){
        map<int, int> mp;
        int i = 1;
        do{
            mp[a] = i;
            string s = toString(a, l), t = s;
            sort(s.rbegin(), s.rend());
            sort(t.begin(), t.end());
            a = stoi(s) - stoi(t);
            i++;
        }while(mp[a] == 0);
        cout << mp[a]-1 << ' ' << a << ' ' << i-mp[a] << endl;
    }

    return 0;
}



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

int main() {
  int a,b;
  cin >> a >> b;
  if (a < b) {
    cout << "a < b" << endl;
  } else if (a > b) {
    cout << "a > b" << endl;
  } else if (a == b) {
    cout << "a == b" << endl;
  }
  return 0;
}


Measured memory_bytes: 3076
#include <bits/stdc++.h>
#include <iostream>
#include <functional>
#include <vector>
#include <stdio.h>
#include <queue>
#include <string.h>
#include <math.h>
using namespace std;
#define rep(i,a,n) for (int i=a;i<=n;i++)
#define rep1(i,a,n) for (int i=a;i<n;i++)
#define per(i,a,n) for (int i=a;i>=n;i--)
#define per1(i,a,n) for (int i=a;i>n;i--)
#define pb push_back
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define endl "\n"
#define pi 3.14159265358979323846264338327950288419716939937510
#define IOS cin.sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const ll mod=1000000007;
const int inf=0x3f3f3f3f;
const ll INF=0x3f3f3f3f3f3f3f3f;
ll qpow(ll a,ll b){ll s=1;while(b>0){if(b%2==1){s=s*a;}a=a*a;b=b>>1;}return s;}
ll qpowmod(ll a, ll b, ll c){ll res, t;res=1;t=a%c;while(b){if(b & 1){res=res*t%c;}t=t*t%c;b>>=1;}return res;}
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;}
inline long long read(){long long k=0,f=1;char ch=getchar();while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}while(ch>='0'&&ch<='9'){k=k*10+ch-'0';ch=getchar();}return k*f;}
inline void write(long long x){if(x<0)x=-x,putchar('-');if(x>9)write(x/10);putchar(x%10+'0');}
// head
ll n,a[2005],ans;
int main()
{
    //IOS;
    cin>>n;
    rep(i,1,n)
    {
        cin>>a[i];
    }
    sort(a+1,a+1+n);
    /*rep(i,1,n)
    {
        cout<<a[i]<<' ';
    }
    cout<<endl;*/
    rep(i,1,n-2)
    {
        rep(j,1,n-1)
        {
            if(i!=j&&j>i)
            {
                ll pos;
                pos=lower_bound(a+1,a+1+n,a[i]+a[j])-a;
                /*if(pos==n+1)
                {
                    continue;
                }*/
                //cout<<pos<<endl;
                ans+=(pos-j-1);
                //cout<<i<<' '<<j<<' '<<pos<<' '<<pos-j-1<<endl;
            }
        }
    }
    cout<<ans<<endl;
    return 0;
}
/*
4
1 2 3 4
*/


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

using namespace std;

struct Point {
	int x, y;
};

int main(void) {
	int N;
	int sx = 0, sy = 0, ex, ey;
	int xi, yi, ai;
	cin >> ex >> ey >> N;
	for (int i = 0; i < N; i++) {
		cin >> xi >> yi >> ai;
		switch (ai) {
		case 1:
			if (xi > sx) sx = xi;
			break;
		case 2:
			if (xi < ex) ex = xi;
			break;
		case 3:
			if (yi > sy) sy = yi;
			break;
		case 4:
			if (yi < ey) ey = yi;
			break;
		}
	}
	cout << ((ex - sx > 0 && ey - sy > 0) ? ((ex - sx) * (ey - sy)) : 0) << endl;
	return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include "math.h"
 
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define drep(i,a,b) for(ll i=(a);i>=(b);--i)
#define SIZE(a) int((a).size())
#define out(a) cout<<(a)<<endl;
const int INF=INT_MAX;
const int MAX = 510000;
const ll MOD = 1L<<32;
ll fac[MAX], finv[MAX], inv[MAX];
ll round24(ll x,ll y){
  if(x+y>=24)return x+y-24;
  return x+y;
}
int main(){
  ll a,b;cin>>a>>b;
  cout<<round24(a,b)<<endl;
}




Measured memory_bytes: 3584
/*

  _|_|                              _|  _|    _|
_|    _|  _|  _|_|  _|_|_|_|        _|  _|  _|
_|    _|  _|_|          _|          _|  _|_|
_|    _|  _|          _|      _|    _|  _|  _|
  _|_|    _|        _|_|_|_|    _|_|    _|    _|

*/
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstring>
#include<vector>
#include<queue>
#include<set>
//#define ls (rt<<1)
//#define rs (rt<<1|1)
#define vi vector<int>
#define pb push_back
#define mk make_pair
#define pii pair<int,int>
#define rep(i,a,b) for(int i=(a),i##end=(b);i<=i##end;i++)
#define fi first
#define se second
typedef long long ll;
using namespace std;
const int maxn=3e3+100;
const int mod=1e9+7;
int f[maxn][maxn],a[maxn];
int ksm(int num,int t){
    int res=1;
    for(;t;t>>=1,num=1ll*num*num%mod){
        if(t&1)res=1ll*num*res%mod;
    }
    return res;
}
int main(){
    int n,q;cin>>n>>q;
    rep(i,1,n)cin>>a[i];
    rep(i,1,n)rep(j,1,n)f[i][j]=a[i]<a[j];
    ll inv2=ksm(2,mod-2);
    rep(i,1,q){
        int x,y;cin>>x>>y;
        f[x][y]=f[y][x]=inv2*(f[x][y]+f[y][x])%mod;
        rep(j,1,n){
            if(j==x||j==y)continue;
            f[x][j]=f[y][j]=inv2*(f[x][j]+f[y][j])%mod;
            f[j][x]=f[j][y]=inv2*(f[j][x]+f[j][y])%mod;
        }
    }
    ll last=0;rep(i,1,n)rep(j,1,i-1)last=(last+f[i][j])%mod;
    cout<<last*ksm(2,q)%mod;
    return 0;
}


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

int sign(int x){
    return x > 0 ? 1 : -1;
}

int main() {
    long long X,K,D;
    cin>>X>>K>>D;
    X = abs(X);
    long long m = min(K,X/D);
    K-= m;
    X-= D*m;
    if(K%2==0){
        cout<<X;
    }else{
        cout<<min(abs(X+D),abs(X-D));
    }


    return 0;
}

Measured memory_bytes: 3628
n, d = map(int, input().split())
x = [list(map(int, input().split())) for _ in range(n)]
cnt = 0
for x1 in range(n):
    for x2 in range(x1 + 1, n):
        di = 0
        for i in range(d):
            di += abs(x[x1][i] - x[x2][i]) ** 2
        if di ** 0.5 == int(di ** 0.5):
            cnt += 1
print(cnt)


Measured memory_bytes: 3188
import java.util.Scanner;

public class Main {

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

	    long x=gl();
	    long t=gl();
	    //int b=gi();


        System.out.println(Math.max(x-t,0));
//        if (Math.abs(x-a)>Math.abs(x-b) ) {
//        	System.out.print("B");
//        }else {
//            System.out.print("A");
//        }


	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}
}

Measured memory_bytes: 35280
#include <stdio.h>

int main(){
	int n,i;
	double money=100000;
	scanf("%d",&n);
	
	for(i=0;i<n;i++){
		money*=1.05;
		if((int)money%1000 != 0){
			money=(double)((int)(money/1000)*1000+1000);
		}
	}
	
	printf("%d\n",(int)money);
	
	return 0;
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
#define ll long long
#define double long double
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
#define mod (ll)(1e9+7)
#define inf (ll)(3e18+7)
#define pi (double) acos(-1)
#define P pair<int,int>
#define PiP pair<int,pair<int,int>>
#define all(x) x.begin(),x.end()
using namespace std;

int main(){
    int n, m, now=0;
    string s;
    cin >> n >> m >> s;
    reverse(all(s));
    vector<int> ans;
    while(now < n){
        for(int i = m; i >= 1; i--){
            if(s[i+now] == '0'){
                now += i;
                ans.push_back(i);
                break;
            }
            else if(i == 1){
                cout << -1 << endl;
                exit(0);
            }
        }
    }
    reverse(all(ans));
    rep(i, ans.size())cout << ans.at(i) << " ";
}   


Measured memory_bytes: 1144
#include <iostream>
#include <cstdio>
#include <algorithm>
#include<cmath>
#include<vector>
using namespace std;

long long cnt;
int l;
int A[1000000];
int n;
vector<int> G;

void insertionSort(int A[],int n,int g){
  for(int i=g;i<n;i++){
    int v=A[i];
    int j=i-g;
    while(j>=0&&A[j]>v){
      A[j+g]=A[j];
      j-=g;
      cnt++;
    }
    A[j+g]=v;
  }
}


void shellSort(int A[],int n){
    for(int h=1; ; ){
    if(h>n) break;
    G.push_back(h);
    h=3*h+1;
  }
  
  for(int i=G.size()-1;i>=0;i--){
    insertionSort(A,n,G[i]);
  }
  
  
}



int main(){

  int i=0;
  while(1){
    scanf("%d",&n);
    if(1<=n&&n<=1000000){
      while(1){
	if(n==i) break;
	scanf("%d",&A[i]);
	if(0<=A[i]&&A[i]<=1000000000) i++;
      }
      break;
    }
  }

  cnt=0;

  shellSort(A,n);


  cout<<G.size()<<endl;
  for(int i=G.size()-1;i>=0;i--){
    printf("%d",G[i]);
    if(i)printf(" ");
  }
 
  printf("\n");
  printf("%lld\n",cnt);
  for(int i=0;i<n;i++) printf("%d\n",A[i]);
  

  return 0;
}



Measured memory_bytes: 7140
A, B, C, D = map(int, input().split())

attack_t = C//B
kalan_t = C%B
if kalan_t != 0:
    attack_t += 1

attack_a = A//D
kalan_a = A%D
if kalan_a != 0:
    attack_a += 1

if attack_t <= attack_a:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 9188
#include<bits/stdc++.h>
#define ll long long int
#define mk make_pair
#define pb push_back
#define INF (ll)1e18
#define pii pair<ll,ll>
#define mod 1000000007 //998244353
#define f(i,a,b) for(ll i=a;i<b;i++)
#define fb(i,a,b) for(ll i=a;i>b;i--)
#define ff first
#define ss second
#define PI 3.141592653589793238
#define pq priority_queue<ll>
#define pqr priority_queue<ll,vector<ll>,greater<ll>()>
using namespace std;
ll pow_mod(ll a,ll b)
{
	ll res=1;
	while(b!=0)
	{
		if(b&1)
		{
			res=(res*a)%mod;
		}
		a=(a*a)%mod;
		b/=2;
	}
	return res;
}
void solve()
{
    ll n;  // Number of tennis tables  
    
    cin>>n;
    
    ll a,b;
    
    cin>>a>>b;
    
    if(a>b)
    swap(a,b);
    
    ll dis=b-a;
    
    if(dis%2==0){
        cout<<(dis/2)<<endl;
    }
    else{
        ll x1=(b+a-1)/2;
        ll x2=(2*n-b-a+1)/2;
        
        ll ans=min(x1,x2);
        cout<<ans<<endl;
    }
}
int32_t main()
{    ios_base::sync_with_stdio(false);
     cin.tie(NULL);
     cout.tie(NULL);
     
//Start from Here.

  ll t;
  t=1;
 // cin>>t;
  while(t--)
  solve();
  
//Good Bye!
    return 0;
}

Measured memory_bytes: 3668
import java.util.Scanner;

class LucasNumber {
	public static long calcLucasNumber(int n) {
		long returnNumber=0;
		if (n <= 1) {
			switch (n) {
			case 0:
				returnNumber = 2;
				break;
			case 1:
				returnNumber = 1;
				break;
			}
		} else if (n >= 2) {
			long lucasNumber[] = { 2, 1, 0 };
			for (int i = 2; i <= n; i++) {
				lucasNumber[2] = lucasNumber[0] + lucasNumber[1];
				lucasNumber[0] = lucasNumber[1];
				lucasNumber[1] = lucasNumber[2];
			}
			returnNumber = lucasNumber[2];
		}
		return returnNumber;
	}
}

public class Main {
	public static void main(String args[]) {
		Scanner scan = new Scanner(System.in);
		int number = scan.nextInt();
		long lucasNumber = LucasNumber.calcLucasNumber(number);
		if (lucasNumber != -1) {
			System.out.println(lucasNumber);
		} else {
			System.out.println("Invalid value N");
		}
	}
}


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

#define  ll long long int
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define si(a) a.size()
#define p pair< ll,ll >
#define v vector< ll >
#define vi vector<p>
#define mem(tabl,i) memset(tabl, i, sizeof(tabl))
#define sp(x,y) fixed<<setprecision(y)<<lf(x)
#define debug(c) cout << #c << " = " << c << endl;
#define  f(i,a,b) for(int i=a;i<b;i++)
#define fe(i,a,b) for(int i=a;i<=b;i++)
#define Mod 1000000007

const int N = 1e5 + 5;

int main()
{
   ios_base::sync_with_stdio(false);
   cin.tie(NULL);
     
           string s;
           ll n,k,b,c,x,y,z;
           ll counter=0,counter1=0,counter2=0;
           ll sum=0,result=0,ans=-1, flag=0;
           cin>>n>>k;
           f(i,0,k)
           {
               cin>>x;
               sum+=x;
           }
           cout<<max(ans,n-sum)<<endl;

       
}


Measured memory_bytes: 3652
def main():
	import sys
	input=sys.stdin.readline
	n,q=map(int,input().split())
	c=list(map(int,input().split()))
	ab=[[]for i in range(n)]
	lr=[[]for i in range(n)]
	num=[-1]*n
	for i in range(n):
		if num[c[i]-1]!=-1:
			ab[num[c[i]-1]].append(i)
		num[c[i]-1]=i
	for i in range(q):
		l,r=map(int,input().split())
		lr[l-1].append((r-1,i))
	ans=[-1]*q
	BIT=[0]*n
	for i in range(n-1,-1,-1):
		for x in ab[i]:
			x+=1
			while x<=n:
				BIT[x-1]+=1
				x=x+(x&-x)
		for x,y in lr[i]:
			X=x
			x+=1
			ret=0
			while x!=0:
				ret+=BIT[x-1]
				x=x-(x&-x)
			ans[y]=X-i+1-ret
	for x in ans:
		print(x)
if __name__ == '__main__':
	main()

Measured memory_bytes: 224408
#include <iostream>
#include <algorithm>
#include <climits>
#include <vector>
#include <stack>
#include <cmath>
#include <queue>
#include <set>
#include <map>
using namespace std;

int main() {
    int n;
    cin >> n ;
    vector<int> c(n-1), s(n-1), f(n-1);
    for (int i = 0; i < n - 1; ++i) {
        cin >> c[i] >> s[i] >> f[i];
    }

    for (int k = 0; k < n - 1; ++k) {
        int t = -1;
        for (int j = k; j < n - 1; ++j) {
            t = max(t, s[j]);
            while(t % f[j]) t++;
            t += c[j];
        }
        cout << t << endl;
    }
    cout << 0 << endl;

    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<algorithm>
#include<string.h>
#include<queue>

using namespace std;

#define MAXN 130
int z[10000];

int main()
{
    int x1,y1,x2,y2;
    scanf("%d%d%d%d",&x1,&y1,&x2,&y2);
    int a,b;
    a=x2-x1;
    b=y2-y1;
    for(int i=1;i<=b;i++)
        printf("U");
    for(int i=1;i<=a;i++)
        printf("R");
    for(int i=1;i<=b;i++)
        printf("D");
    for(int i=1;i<=a;i++)
        printf("L");
    printf("L");
    for(int i=1;i<=b+1;i++)
        printf("U");
    for(int i=1;i<=a+1;i++)
        printf("R");
    printf("DR");
    for(int i=1;i<=b+1;i++)
        printf("D");
    for(int i=1;i<=a+1;i++)
        printf("L");
    printf("U\n");
    return 0;
}


Measured memory_bytes: 128
import numpy as np

def solve():
    cnt = 0
    money = 0
    for i in range(N):
        if cnt >= M:
            break
        if cnt + AB[i][1] >= M:
            money += AB[i][0] * (M - cnt)
            cnt = M   
        else:
            money += AB[i][0]*AB[i][1]
            cnt += AB[i][1]
#    print(cnt)
    print(money)

if __name__ == "__main__":
    N,M = list(map(int, input().split()))   
    AB = [list(map(int, input().split())) for _ in range(N)]
    AB.sort(key=lambda x: x[0])
#    print(AB)
    solve()


Measured memory_bytes: 46420
#include<stdio.h>
int main()
{
  int a,b,d,r;
  double f;
  scanf("%d %d",&a,&b);
  d=a/b;
  r= a%b;
  f=(double)a/(double)b;
  printf("%d %d %f\n",d,r,f);
  return 0;
}



Measured memory_bytes: 2104
import java.util.Scanner;

public class Main {
    public static void main(String... args){
        Scanner scan = new Scanner(System.in);
        while(true){
            String s = scan.next();
            if(s.equals("-"))break;
            StringBuilder sb = new StringBuilder(s);
            int h = scan.nextInt();
            for(int i = 0;i < h;i++){
                int hn = scan.nextInt();
                String s1 = sb.substring(0, hn);
                sb.delete(0, hn);
                sb.append(s1);
            }
            System.out.println(sb);

        }


        scan.close();
    }

    

}


Measured memory_bytes: 26268
"use strict";

function main(arg) {
    arg     = arg.split("\n");
    const A = parseInt(arg[0]);
    const B = parseInt(arg[1]);
    const C = parseInt(arg[2]);
    const D = parseInt(arg[3]);
    
    console.log(Math.min(A,B) + Math.min(C,D));
}
main(require('fs').readFileSync('/dev/stdin', 'utf8'));

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

using namespace std;

int main() {
  char X, Y;
  cin >> X >> Y;

  if (X == Y) {
    cout << "=" << endl;
  } else if (X < Y) {
    cout << "<" << endl;
  } else {
    cout << ">" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <math.h>
#include <algorithm>
#include <map>
#include <sstream>
#include <queue>
#include <deque>
#include <set>
#include <stack>
#include <functional>
#include <utility>
#include <stdio.h>
#define ll long long
#define MP make_pair
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define PLI pair<ll, int>
#define PIL pair<int, ll>
#define F first
#define S second
#define SHN 1e9
#define LSHN 1e18
using namespace std;
string s;
int l[100010],r[100010];
int a[100010];
int n;
int main()
{
	cin >>s;
	n=s.size();
	for (int i=0;i<n;i++)
	{
		if (!i) l[i]=-1;
		else if (s[i-1]=='R') l[i]=i-1;
		else l[i]=l[i-1];
	} 
	for (int i=n-1;i>=0;i--)
	{
		if (i==n-1) r[i]=-1;
		else if (s[i+1]=='L') r[i]=i+1;
		else r[i]=r[i+1];
	}
	for (int i=0;i<n;i++)
	{
		if (s[i]=='L')
		{
			if ((i-l[i])%2) a[l[i]+1]++;
			else a[l[i]]++;
		}
		else
		{
			if ((r[i]-i)%2) a[r[i]-1]++;
			else a[r[i]]++;
		}
	}
	for (int i=0;i<n;i++) cout <<a[i]<<" ";
	return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <stdio.h>
#include <cstring>
#include <cstdio>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string>
#include <stdlib.h>
#include <queue>
#include <stack>
#include <utility>
#include <fstream>
#include <random>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <functional>
#include <random>
#include <time.h>
#include <chrono>
#include <sstream>
#include <iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define FOR(i,a,b) for(int i=a;i<b;i++)
#define ll long long
#define INF 1000000001
#define mod 1000000007
#define sort(s) sort(s.begin(), s.end());
#define reverse(s) reverse(s.begin(), s.end());
int dx[4] = { 0,1,0,-1 };
int dy[4] = { 1,0,-1,0 };
using namespace std;
int POW(int x, int y) { return int(pow(double(x), double(y))); }
double log(double a, double b) { return log(b) / log(a); }

unsigned int randxor()
{
	static unsigned int x = 123456789, y = 362436069, z = 521288629, w = 88675123;
	unsigned int t;
	t = (x ^ (x << 11)); x = y; y = z; z = w; return(w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}


int main() {
	int n, a, b;
	cin >> n >> a >> b;
	cout << min(a, b) << " ";
	if (a + b <= n) {
		cout << 0 << endl;
	}
	else {
		cout << (a + b) - n << endl;
	}

	return 0;
}





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

using namespace std;
 
/// ----------------------------- (Debug) ------------------------------
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; }; sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0); sim > char dud(...);
struct debug {
#ifndef ONLINE_JUDGE
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i));}
sim, class b dor(pair < b, c > d) {ris << "(" << d.first << ", " << d.second << ")";}
sim dor(rge<c> d) {*this << "["; for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it; ris << "]";}
#else
sim dor(const c&) { ris; }
#endif
};
vector<char*> tokenizer(const char* args) {
	char *token = new char[111]; strcpy(token, args); token = strtok(token, ", ");
	vector<char*> v({token});
	while(token = strtok(NULL,", ")) v.push_back(token);
	return reverse(v.begin(), v.end()), v;
}
void debugg(vector<char*> args) { cerr << "\b\b "; }
template <typename Head, typename... Tail>
void debugg(vector<char*> args, Head H, Tail... T) {
	debug() << " [" << args.back() << ": " << H << "] ";
	args.pop_back(); debugg(args, T...);
}
#define harg(...) #__VA_ARGS__
#ifndef ONLINE_JUDGE
#define dbg(...) { debugg(tokenizer(harg(__VA_ARGS__, \b\t-->Line)), __VA_ARGS__, __LINE__); cerr << endl;}
#else
#define dbg(...) { }
#endif
/// -----------------------------------------------------------------------
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi; 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)    
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define print(x) cout << x << "\n";
#define REP(i,a,b) for(i=a;i<=b;i++)
#define RAP(i,a,b) for(i=a;i>=b;i--)
#define spa <<" "<<
#define all(x) (x).begin(), (x).end()
#define sz(x) (int)x.size()
ll mod=998244353;
const int MX=0x3f3f3f3f;


const int maxn=1e7+1;
int isprime[maxn];

int main(){
	IOS;
	int i;
	REP(i,1,maxn-1) isprime[i]=i;
    for(i=2;i*i<maxn;i++)
        if(isprime[i])
            for(int j=i*i;j<maxn;j+=i)
                isprime[j]=min(i,isprime[j]);
    int n;
    cin>>n;
    ll ans=1,temp=0;
    REP(i,2,n){
    	temp=i;
    	map<int,int> mp;
    	while(temp!=1){
    		mp[isprime[temp]]++;
    		temp/=isprime[temp];
    	}
    	temp=1;
    	for(auto u:mp) temp*=(u.S+1);
    	ans+=i*temp; 
    	// dbg(temp,i);
    }
    cout<<ans;
	return 0;
}

Measured memory_bytes: 42716
#include<iostream>
#include<cstdio>
#include<cstring>
#include<ctime>
#include<cstdlib>
#include<algorithm>
#include<cmath>
#include<string>
#include<queue>
#include<vector>
#include<map>
#include<set>
#include<utility>
#include<iomanip>
#include<map>
#include<vector>
using namespace std;
int read(){
    int xx=0,ff=1;char ch=getchar();
    while(ch>'9'||ch<'0'){if(ch=='-')ff=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){xx=xx*10+ch-'0';ch=getchar();}
    return xx*ff;
}
long long READ(){
    long long xx=0,ff=1;char ch=getchar();
    while(ch>'9'||ch<'0'){if(ch=='-')ff=-1;ch=getchar();}
    while(ch>='0'&&ch<='9'){xx=xx*10+ch-'0';ch=getchar();}
    return xx*ff;
}
char one(){
	char ch=getchar();
	while(ch==' '||ch=='\n')
		ch=getchar();
	return ch;
}
struct my{
	int cnt[26];
	void clear(){
		memset(cnt,0,sizeof(cnt));
	}
	bool friend operator<(const my&A,const my&B){
		for(int i=0;i<26;i++)
			if(A.cnt[i]<B.cnt[i])
				return 1;
			else if(A.cnt[i]>B.cnt[i])
				return 0;
		return 0;
	}
}C;
map<my,int>mp;
const int maxn=100010;
int N,len;
char s[maxn];
long long ans=0;
int main(){
	//freopen("in","r",stdin);
	N=read();
	for(int i=1;i<=N;i++){
		scanf("%s",s+1);
		len=strlen(s+1);
		C.clear();
		for(int j=1;j<=len;j++)
			C.cnt[s[j]-'a']++;
		ans+=mp[C]++;
	}
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 15872
import java.util.*;
import java.util.stream.*;

public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int a = in.nextInt(), b = in.nextInt();
        if(8 < a || 8 < b) {
            System.out.println(":(");
        } else {
            System.out.println("Yay!");
        }
    }
}


Measured memory_bytes: 21844
import java.util.Scanner;

public class Main {
	public static int maximumProfit(int price[], int n) {
		int min = price[0];
		int max = price[1] - price[0];
		for (int i = 1; i < n; i++) {
			if (max < price[i] - min) {
				max = price[i] - min;
			}
			if (min > price[i]) {
				min = price[i];
			}
		}
		return max;
	}

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		int n = scanner.nextInt();
		int[] price = new int[n];

		for (int i = 0; i < n; i++) {
			price[i] = scanner.nextInt();
		}
		int max = maximumProfit(price, n);
		System.out.println(max);
		scanner.close();

	}

}


Measured memory_bytes: 100124
n,i;
main()
{
  char a[99];
  for(;scanf("%d",&n);puts(""))
    {
      if(n==-1)exit(0);
      for(i=0;n>3;n/=4)
	a[i++]='0'+(n%4);
      for(putchar('0'+n);i--;)
	putchar(a[i]); 
    }
}

Measured memory_bytes: 0
int main(){
 int a,b;
 while(1){
  scanf("%d %d",&a,&b);
  if(a==0&&b==0)break;
  if(a<b){
   printf("%d %d\n",a,b);
  }else{
   printf("%d %d\n",b,a);
  }
 }
 return 0;
}

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

typedef double db;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
typedef vector<ll> vll;
typedef vector<int> vi;
typedef complex<double> com;

#define MOD 1000000007
#define PI 3.14159265359
#define endl '\n'
#define eb emplace_back
#define pb push_back
#define F first
#define S second
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define unique_sort(x) (sort(x.begin(), x.end()), x.resize(distance(x.begin(), unique(x.begin(), x.end()))))
#define fast_io() ios_base :: sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define dbg(x) cout << #x << " = " << x << '\n'
#define dbg2(x,y) cout<<#x<<" = "<<x<<" & "<<#y<<" = "<<y<<endl;

void test()
{
	int x;
	cin>>x;

	if(x>=30)
	{
		cout<<"Yes"<<endl;
	}
	else
		cout<<"No"<<endl;
}

int main()
{   
fast_io();
cout << fixed << setprecision(15);
int t = 1;

//cin>>t;

for(int i = 0; i < t; i++)
{
	test();
}
return 0;
}

Measured memory_bytes: 3612
use std::io::*;
use std::str::FromStr;
   
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")
}

fn main() {
	let n: u32 = read();
	let s: String = read();

	let mut p: char = '-' as char;

	let mut slime: String = "".to_string();
	for c in s.chars() {
		if p != c {
			slime.push(c);
			p = c;
		}
	}

	println!("{}", slime.chars().count());
}

Measured memory_bytes: 4352
import numpy as np

N = int(input())
P = [int(p) for p in input().split()]
Q = [int(q) for q in input().split()]

def factorial(n):
    ret = 1
    for i in range(1, n+1):
        ret *= i
    return ret

a = 0
used_l = []
for i in range(N):
    a += factorial(N-1-i)*(P[i]-1-np.sum(P[i]>np.array(used_l)))
    used_l.append(P[i])

b = 0
used_l = []
for i in range(N):
    b += factorial(N-1-i)*(Q[i]-1-np.sum(Q[i]>np.array(used_l)))
    used_l.append(Q[i])

print(abs(a-b))


Measured memory_bytes: 22116
#include <bits/stdc++.h>
using namespace std;
#define IOS ios::sync_with_stdio(false); cin.tie(0);
#define FOR(i,s,n) for(int i = (s); i < (n); i++)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) for(int i = (n); i >= 0; i--)
#define ALL(n) (n).begin(), (n).end()
#define RALL(n) (n).rbegin(), (n).rend()
#define ATYN(n) cout << ( (n) ? "Yes":"No") << '\n';
#define CFYN(n) cout << ( (n) ? "YES":"NO") << '\n';
#define OUT(n) cout << (n) << '\n';
using ll = long long;
using ull = unsigned long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;

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

ll lcm(ll x, ll y) {
    return x / gcd(x,y) * y;
}

int main(void)
{
    IOS
    int N, M;
    cin >> N >> M;
    string S; cin >> S;
    string T; cin >> T;

    ll xl = lcm(N,M);
    ll ln = xl / N;
    ll lm = xl / M;

    if (N == M && S != T) {
        OUT(-1)
        return 0;
    } else {
        map<ll,char> X;
        REP(i,N) {
            X[ln*i] = S[i];
        }
        REP(i,M) {
            if (!(X.count(lm*i) == 0 || X[lm*i] == T[i])) {
                OUT(-1)
                return 0;
            }
        }
    }

    cout << xl << '\n';

    return 0;
}


Measured memory_bytes: 6144
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
 
 
void swap (int *x, int *y) {
  int temp;    
 
  temp = *x;
  *x = *y;
  *y = temp;
}
 
int gcd(int a,int b){
  if(a<b){
    swap(&a,&b);
  }
 
  if(b==0){
    return a;
  }
 
  int r=a%b;
  while(r!=0){
    a = b;
    b = r;
    r = (a%b);
  }
 
  return b;
}
 
/* クイックソート */
int dn(const void*a,const void*b){return*(int*)b-*(int*)a;}
 
 
int modpow(int a,int n,int mod){
  int ans=1;
  while(n>0){
    if(n & 1){
      ans=ans*a%mod;
    }
    a=a*a%mod;
    n/=2;
  }
  return ans;
}
 
int max(int a,int b){
  if(a<b){
    return b;
  }
  else{
    return a;
  }
}
 
int min(int a,int b){
  if(a<b){
    return a;
  }
  else{
    return b;
  }
}
 
void chmax(int *a,int b){
  if(*a < b){
    *a = b;
  }
 
  return;
}
 
void chmin(int *a,int b){
  if(*a > b){
    *a =b;
  }
 
  return;
}
 

int main(void){
  int a,b;
  char op;
  scanf("%d %c %d",&a,&op,&b);
  if(op=='+'){
    printf("%d",a+b);
  }else{
    printf("%d",a-b);
  }
  return 0;
}

Measured memory_bytes: 1704
#include<map>
#include<set>
#include<list>
#include<cmath>
#include<queue>
#include<stack>
#include<cstdio>
#include<string>
#include<vector>
#include<complex>
#include<cstdlib>
#include<cstring>
#include<numeric>
#include<sstream>
#include<iostream>
#include<algorithm>
#include<functional>

#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,b,n) for(int i=b;i<n;i++)

using namespace std;

typedef    long long          ll;
typedef    unsigned long long ull;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      pii;

const int INF=1<<29;
const double EPS=1e-9;

const int dx[]={1,0,-1,0},dy[]={0,-1,0,1};
char board[1100][1100];
int dp[1100][1100];//
int main(){
	int n;
	while(cin>>n,n){
		bool fi =false;

		for(int i =1;i <=n;i++){
			for(int j =1;j <=n;j++){
				cin>>board[i][j];
				dp[i][j]=0;
			}
		}
		int ans =0;
		for(int i =1;i <=n;i++){
			for(int j =1;j <=n;j++){
				if(board[i][j]=='*'){
					dp[i][j]=0;
				}else{
					dp[i][j]=min(dp[i-1][j-1],min(dp[i-1][j],dp[i][j-1]))+1;
					if(dp[i][j]>ans){
						ans =dp[i][j];
					}
				}
			}
		}
		cout <<ans<<endl;

	}
	return 0;
}

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

using namespace std;
using ll = long long;
using P = pair<int, uint>;

const ll INF64 = 1LL << 60;
const int INF32 = 1 << 29;
const int MOD = 1000000007;

const int CASES = 3;

void solve(){
    ll N, K; cin >> N >> K;
    if(K == 0){
        cout << N * N << '\n';
        return;
    }

    ll ans = 0;
    for(ll i = K; i < N+1; ++i) {
            ans += N / i * (i - K);
            ans += max(0LL, (N % i) - K + 1LL);
    }
    cout << ans << '\n';
    return;
}



int main() {
    #ifdef MYLOCAL
    vector<string> filenames {"input1.txt", "input2.txt", "input3.txt"};
    cout << "------------\n";
    for(int i = 0; i < CASES; ++i){
        ifstream in(filenames[i]);
        cin.rdbuf(in.rdbuf());
        solve();
        cout << "------------\n";
    }
    #else

    solve();

    #endif
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#include<cmath>
#include<set>
#include<map>
#define For(i,a,b) for(int i=(a);i<(b);i++)
#define Rep(i,n) for(int i=0;i<(n);i++)
using namespace std;
typedef long long ll;

int main() {
	int H, W;
	cin >> H >> W;
	vector<vector<char>> c(H, vector<char>(W));
	Rep(i, H)Rep(j, W) cin >> c[i][j];
	
	Rep(i, H)Rep(j, W) {
		if (c[i][j] == '#') {
			int s = 0;
			if (i>0 && c[i - 1][j] == '#') s = 1;
			else if (i+1<H && c[i + 1][j] == '#') s = 1;
			else if (j>0 && c[i][j - 1] == '#') s = 1;
			else if(j+1<W && c[i][j + 1] == '#') s = 1;
			if (s == 0) {
				cout << "No" << endl;
				return 0;
			}
		}
	}
	cout << "Yes" << endl;
	return 0;
}

Measured memory_bytes: 256
package main

import (
	"fmt"
)

func main() {
	var a, b, c, d int
	fmt.Scan(&a, &b, &c, &d)

	totalNum := b - a + 1
	lcm := c * d / gcd(c, d)
	var cNum, dNum, eNum int
	if a%c == 0 {
		cNum = a/c-1
	} else {
		cNum = a/c
	}
	if a%d == 0 {
		dNum = a/d-1
	} else {
		dNum = a/d
	}
	if a%lcm == 0 {
		eNum = a/lcm-1
	} else {
		eNum = a/lcm
	}
	ans := totalNum - ((b/c - cNum) + (b/d - dNum) - (b/lcm - eNum))
	fmt.Println(ans)
}

func gcd(x, y int) int {
	tmp := x % y
	if tmp > 0 {
		return gcd(y, tmp)
	} else {
		return y
	}
}


Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <string>
#include <numeric>
#include <algorithm>
#include <utility>
#include <vector>

using std::cout;
using std::cin;
using std::string;


int main()
{
  int H, W;
  cin >> H >> W;
  int h, w;
  cin >> h >> w;
  int white_cell_num = H * W - (h * W) - w * H + (h*w);
  cout << white_cell_num << "\n";
  return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <map> //pair is also included in this library
#include <stack>
#include <string>
#include <vector>

#define INF (INT_MAX/3)

#define REP(i, s, n) for(int i = (int)(s); i < (int)(n); i++)

using namespace std;

typedef long long int ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef pair<int, int> PII;

bool solve(string w){
  sort(w.begin(), w.end());

  char head = w[0];
  ll count = 0;
  bool ans = true;

  if(w.size() % 2 == 0){
    REP(i, 0, w.size()){
      if(head != w[i]){
        if((count % 2) != 0){
          ans = false;
          break;
        }
        head = w[i];
      }
      count++;
    }
  } else {
    ans = false;
  }
  return ans;
}

int main(){
  string w;

  cin >> w;

  if(solve(w)){
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}


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

using namespace std;

struct Comp {
	bool operator()(const string &a, const string &b) { return a.size() > b.size(); }
};

int main() {

	priority_queue<string, vector<string>, Comp> q;
	int ans, L0 = 128, L = 0;
	string alphabet;
	for(char c = 'a'; c <= 'z'; ++c) alphabet += c;
	for(char c = 'A'; c <= 'Z'; ++c) alphabet += c;
	for(char c = '0'; c <= '9'; ++c) alphabet += c;
	for(char c : alphabet) {
		cout << "? " << string(L0, c) << endl;
		cin >> ans;
		if(ans < L0) q.push(string(L0-ans, c));
		L += L0 - ans;
	}
	while(q.size() > 1) {
		string a = q.top(); q.pop();
		string b = q.top(); q.pop();
		string c;
		int i = 0, j = 0;
		while(i < a.size() && j < b.size()) {
			string test = c + a[i] + b.substr(j);
			cout << "? " << test << endl;
			cin >> ans;
			if(L-ans == test.size()) c += a[i++];
			else c += b[j++];
		}
		c += a.substr(i) + b.substr(j);
		q.emplace(c);
	}
	cout << "! " << q.top() << endl;

	return 0;
}

Measured memory_bytes: 3780
n = int(input())
num = [int(i) for i in input().split()]
flag = 0
if num == sorted(num):
  flag = 1
else:  
  sorted_num = sorted(num)
  for i in range(n):
    if flag == 1:
      break
    for j in range(n-i-1):
      temp = num[i]
      num[i] = num[i+j+1]
      num[i+j+1] = temp
      if num == sorted_num:
        flag = 1
        break
      else:
        temp = num[i]
        num[i] = num[i+j+1]
        num[i+j+1] = temp
if flag == 1:
  print('YES')
else:
  print('NO')

Measured memory_bytes: 3188
n=int(input())
l=[0,0,0]
for i in list(map(int,input().split())):
  if i%2:l[0]+=1
  elif i%4:l[1]+=1
  else:l[2]+=1

print("Yes" if l[2]+1>=l[0]+int(1<=l[1]) else "No")

Measured memory_bytes: 14252
#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;

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

//階乗,factで初期化
vec tfact(1e7+1);
void fact(ll n) {
  for(ll i=0;i<=n;i++) {
    if(i==0) {
      tfact[i]=1;
    }
    else {
      tfact[i]=tfact[i-1]*i%mod;
    }
  }
}

//nCk 繰り返し高速
ll comb(ll n, ll k) {
  return tfact.at(n)*mpow(tfact.at(k),mod-2)%mod*mpow(tfact.at(n-k),mod-2)%mod;
}

int main() {
  ll h,w,n;
  cin >> h >> w >> n;
  fact(h+w+10);
  vector<pll> G(n+1);
  for(ll i=0;i<n;i++) {
    ll y,x;
    cin >> y >> x;
    y--,x--;
    G[i]={y,x};
  }
  G[n]={h-1,w-1};
  vec dp(n+1);
  sort(G.begin(),G.end());
  for(ll i=0;i<=n;i++) {
    ll y=G[i].first;
    ll x=G[i].second;
    dp[i]=comb(y+x,y);
    for(ll j=0;j<i;j++) {
      ll dx=G[i].first-G[j].first;
      ll dy=G[i].second-G[j].second;
      if(dx>=0&&dy>=0) dp[i]=(dp[i]-dp[j]*comb(dx+dy,dy)%mod+mod)%mod;
    }
  }
  cout << dp[n] << endl;
}


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

string s;
bool bus = false;

int main(){
    cin >> s;

    for(int i=0; i<2; i++){
        for(int j=i+1; j<3; j++){
            if(s[i] != s[j]) bus = true;
        }
    }
    if(bus) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}

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

int main() {
    long long n, m, ans;
    cin >> n >> m;
    if (n > m/2)
        ans = m/2;
    else {
        ans = (m + 2*n) / 4;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using bint = boost::multiprecision::cpp_int;

int main()
{
    int N, A, B;
    std::cin >> N >> A >> B;
    if (N > A + B) {
        if (A > B) {
            std::cout << B << " " << 0 << std::endl;
        } else {
            std::cout << A << " " << 0 << std::endl;
        }
    } else {
        if (A > B) {
            std::cout << B << " " << A + B - N << std::endl;
        } else {
            std::cout << A << " " << A + B - N << std::endl;
        }
    }
    return 0;
}

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

const string YES = "YES";
const string NO = "NO";

typedef long long ll;

void solve(long long N, std::vector<long long> A){
    auto total = accumulate(A.begin(), A.end(), 0LL);
    if(total % 2 == 0) cout << YES << endl;
    else cout << NO << endl;
}

int main(){
    long long N;
    scanf("%lld",&N);
    std::vector<long long> A(N);
    for(int i = 0 ; i < N ; i++){
        scanf("%lld",&A[i]);
    }
    solve(N, std::move(A));
    return 0;
}


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

int main()
{
    int n;
    cin >> n;
    int res = 0;
    int i = 1;
    int x = n-1;
    while (i < n) {
        res += x/i;
        i++;
    }
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 3628