akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main(string[] args)
    {
        string input = Console.ReadLine();
        int a = int.Parse(input);
        input = Console.ReadLine();
        int b = int.Parse(input);
        input = Console.ReadLine();
        int c = int.Parse(input);
        input = Console.ReadLine();
        int d = int.Parse(input);
        input = Console.ReadLine();
        int e = int.Parse(input);
        input = Console.ReadLine();
        int k = int.Parse(input);
        if (Math.Abs(a - b) <= k && Math.Abs(a - b) <= k && Math.Abs(a - c) <= k && Math.Abs(a - d) <= k && Math.Abs(a - e) <= k && Math.Abs(c - b) <= k && Math.Abs(b - d) <= k && Math.Abs(e - b) <= k && Math.Abs(c - d) <= k && Math.Abs(c - e) <= k && Math.Abs(d - e) <= k) { Console.WriteLine("Yay!"); }
        else { Console.WriteLine(":("); }
    }
}


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

int main() {
  int n,sum=0;
  cin>>n;
  int b[n-1],a[n];
  for(int i = 0; i < n - 1; i++) cin>>b[i];
  a[0] = b[0];
  a[n-1] = b[n-2];
  for(int i = 1; i < n-1; i++) {
      a[i] = min(b[i],b[i-1]);
  }
  
  for(int i = 0; i < n; i++)  sum += a[i];
  cout<<sum<<"\n";
  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <iostream>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <queue>

using namespace std;

#define rep(i,x) for(int i=0;i<x;i++)
#define SORT(x) sort(x.begin(),x.end())
#define pb(x) push_back(x)
#define int long long

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

  vector<int> A;
  int min;

  rep(i, N) {
    int tmp;
    cin >> tmp;
    A.push_back(tmp);

    if (i == 0) {
      min = A[i];
    } else {
      if (min > A[i]) {
        min = A[i];
      }
    }
  }

  while(1) {
    int next_min = min;
    rep(i, N) {
      if (A[i]%min == 0) {

      } else {
        A[i] = A[i] % min;
        if (next_min > A[i]) {
          next_min = A[i];
        }
      }
    }
    if (next_min < min) {
      min = next_min;
    } else {
      break;
    }
  }

  cout << min << endl;

  return 0;
}


Measured memory_bytes: 1400
import std.algorithm;
import std.array;
import std.ascii;
import std.bigint;
import std.complex;
import std.container;
import std.conv;
import std.functional;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

auto readInts() {
	return array(map!(to!int)(readln().strip().split()));
}
auto readInt() {
	return readInts()[0];
}
auto readLongs() {
	return array(map!(to!long)(readln().strip().split()));
}
auto readLong() {
	return readLongs()[0];
}

void readlnTo(T...)(ref T t) {
    auto s = readln().split();
    assert(s.length == t.length);
    foreach(ref ti; t) {
        ti = s[0].to!(typeof(ti));
        s = s[1..$];
    }
}

class UnionFindTree {
public:
    this(size_t n) {
        parent = iota(n).array();
        rank = new size_t[](n);
    }
    size_t find(size_t n) {
        if(n == parent[n]) {
            return n;
        } else {
            parent[n] = find(parent[n]);
            return parent[n];
        }
    }
    void unite(size_t n, size_t m) {
        auto p1 = find(n);
        auto p2 = find(m);
        if(n == m) {
            return;
        }
        if(rank[p1] < rank[p2]) {
            swap(p1, p2);
        }
        if(rank[p1] == rank[p2]) {
            ++rank[p1];
        }
        parent[p2] = p1;
    }
private:
    size_t[] parent;
    size_t[] rank;
}
unittest {
    auto uft = new UnionFindTree(10);
    foreach(i; iota(10)) {
        assert(uft.find(i) == i);
    }
    foreach(i; iota(10).filter!(a => a%3 == 0).drop(1)) {
        uft.unite(i, i-3);
    }
    foreach(i; iota(10).filter!(a => a%3 == 0)) {
        assert(uft.find(0) == uft.find(i));
    }
    foreach(i; iota(10).filter!(a => a%3 != 0)) {
        assert(uft.find(0) != uft.find(i));
    }
}

const real eps = 1e-10;

const long p = 1_000_000_000 + 7;

void main(){
    auto s = readln.chomp();
    auto k = (s.length + 1) / 2;
    auto one = 0;
    auto zero = 0;
    if(s.length%2 == 1) {
        if(s[k-1] == '1') {
            ++one;
        } else {
            ++zero;
        }
    }
        
    long ans = k;
    while(k <= s.length) {
        if(s[s.length - k] == '1') {
            ++one;
        } else {
            ++zero;
        }
        if(s[k-1] == '1') {
            ++one;
        } else {
            ++zero;
        }

        if(one == 0 || zero == 0) {
            ans = k;
        }
        ++k;
    }
    writeln(ans);
}



Measured memory_bytes: 2556
#include <bits/stdc++.h>
#define int long long
const int MOD = 1e9 + 7;
using pii=std::pair<int,int>;
using namespace std;

int n;
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n;
    int use10 = 1, use9 = 1, use8 = 1;
    for(int i = 0; i < n; i++)
    {
        use10 *= 10;
        use10 %= MOD;
        use9 *= 9;
        use9 %= MOD;
        use8 *= 8;
        use8 %= MOD;
    }
    cout << (use10 - 2 * use9 + use8 + 10 * MOD) % MOD << "\n";
    return 0;
}

Measured memory_bytes: 3648
N = int(input())
A = input()
B = input()
C = input()

ans = 0
for a, b, c in zip(A, B, C):
    if a == b == c:
        continue
    if len(set([a, b, c])) == 2:
        ans += 1
    else:
        ans += 2

print(ans)


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define endl '\n'
using namespace std;

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    string s;
    bool b=0;
    cin>>s;
    for(int i=0;i<3;i++){
    	if(s[i]==55){
    		cout<<"Yes";
    		b=1;
    		break;
		}
	}
	if(b==0){
		cout<<"No";
	}
    
//system("pause");
return 0;

}


Measured memory_bytes: 3652
#include <stdio.h>

int main(void){

  char ac,bc,cc,dc;
	scanf("%c%c%c%c", &ac, &bc, &cc, &dc);
  int a = ac - '0';
  int b = bc - '0';
  int c = cc - '0';
  int d = dc - '0';

  if (a+b+c+d == 7) {
    printf("%d+%d+%d+%d=7\n", a, b, c, d);
  } else if (a+b+c-d == 7) {
    printf("%d+%d+%d-%d=7\n", a, b, c, d);
  } else if (a+b-c+d == 7) {
    printf("%d+%d-%d+%d=7\n", a, b, c, d);
  } else if (a+b-c-d == 7) {
    printf("%d+%d-%d-%d=7\n", a, b, c, d);
  } else if (a-b+c+d == 7) {
    printf("%d-%d+%d+%d=7\n", a, b, c, d);
  } else if (a-b+c-d == 7) {
    printf("%d-%d+%d-%d=7\n", a, b, c, d);
  } else if (a-b-c+d == 7) {
    printf("%d-%d-%d+%d=7\n", a, b, c, d);
  } else if (a-b-c-d == 7) {
    printf("%d-%d-%d-%d=7\n", a, b, c, d);
  }

  return 0;
}

Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define rep(i,a,n) for (long long  i=a;i<n;i++)
#define sz(A) (int)(A.size())
#define all(x) (x).begin(),(x).end()
#define get(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
typedef long long ll;
typedef pair<int, int> PII;
typedef vector<int> VI;
int mod;
ll powmod(ll a, ll b) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1)res = res*a%mod; a = a*a%mod; }return res; }
void solve() {
	int x, y;
	cin >> x >> y;
	for (int i = 0; i <= 100; i++) {
		for (int j = 0; j <= 100; j++) {
			if (i + j == x && 2 * i + 4 * j == y) {
				cout << "Yes";
				return;
			}
		}
	}
	cout << "No";
}
int main() {
	ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
	int T_ = 1;
	//cin >> T_;
	for (int i = 0; i < T_; i++)solve();
	return 0;
}







Measured memory_bytes: 3644
<?php
//Request Question
function getq($get_word=null){
	if($get_word===null){
		return str_replace("\n","",fgets(STDIN));
	}else if($get_word===1){
		return explode(" ",str_replace("\n","",fgets(STDIN)));
	}
}

/*		START		*/
$TEMP=getq(1);
$N=$TEMP[0];
$M=$TEMP[1];
$X=$TEMP[2];
$A=getq(1);
$ans=array();
//左検索
$Xtemp=$X;
$c=0;
for ($i=0; $i < 150; $i++) { 
	$Xtemp--;
	//料金チェック
	for ($w=0; $w < $M; $w++) { 
		if($A[$w]==$Xtemp){
			$c++;
		}
	}
	if($Xtemp==$N||$Xtemp==0){
		array_push($ans,$c);
		break;
	}
}
$Xtemp=$X;
$c=0;
for ($i=0; $i < 150; $i++) { 
	$Xtemp++;
	//料金チェック
	for ($w=0; $w < $M; $w++) { 
		if($A[$w]==$Xtemp){
			$c++;
		}
	}
	if($Xtemp==$N||$Xtemp==0){
		array_push($ans,$c);
		break;
	}
}

echo min($ans)."\n";
?>

Measured memory_bytes: 4856
#include<bits/stdc++.h>
#define F first
#define S second
#define MP make_pair
#define pb push_back
#define endl '\n'

using namespace std;

typedef long long LL;
typedef pair< int, int > P;
typedef pair< LL, LL > LP;
typedef pair< int, P > iP;
typedef pair< P, P > PP;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1000000007;

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

int rec( int pos, int cnt );

bool flg[100005];
int a[100005];

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    
    int n;
    cin >> n;
    for( int i = 0; i < 100005; ++i ) flg[i] = false;
    for( int i = 1; i <= n; ++i ) cin >> a[i];
    cout << rec( 1, 0 ) << endl;
    return 0;
}

int rec( int pos, int cnt )
{
    if( pos == 2 ) return cnt;
    if( flg[pos] == true ) return -1;
    
    flg[pos] = true;
    return rec( a[pos], cnt + 1 );
}



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

using namespace std;
typedef long long ll;

#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep2(i, a, b) for (int i = (a); i < (b); ++i)
#define all(a) (a).begin(), (a).end()

int n, m, q;
vector<int> a, b, c, d;

int ans;
void dfs(vector<int> A)
{
    if (A.size() == n + 1)
    {

        int now = 0;
        rep(i, q)
        {
            if (A[b[i]] - A[a[i]] == c[i])
                now += d[i];
        }
        ans = max(ans, now);
        return;
    }

    A.push_back(A.back());
    while (A.back() < m + 1)
    {
        dfs(A);
        A.back()++;
    }
}

int main()
{
    cin >> n >> m >> q;
    a = b = c = d = vector<int>(q);
    rep(i, q) cin >> a[i] >> b[i] >> c[i] >> d[i];
    dfs(vector<int>(1, 1));
    cout << ans << '\n';

    return 0;
}


Measured memory_bytes: 3640
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cctype>
#include <climits>
#include <string>
#include <bitset>
#include <cfloat>
using namespace std;
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<ll> vll;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<string> > vvs;
typedef vector<vector<ll> > vvll;
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define fin(ans) cout<<(ans)<<endl
#define STI(s) atoi(s.c_str())
#define mp(p,q) make_pair(p,q)
#define pb(n) push_back(n)
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define Sort(a) sort(a.begin(),a.end())
#define Rort(a) sort(a.rbegin(),a.rend())
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
const int P = 1000000007;
const int INF = INT_MAX;
const ll LLINF = 1LL<<60;



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

    int n,k,q;
    cin>>n>>k>>q;
    vi point(n,0);
    rep(i,q){
        int a;
        cin>>a;
        point[a-1]++;
    }
    rep(i,n)point[i]=q-point[i];
    rep(i,n){
        if(point[i]>=k)fin("No");
        else fin("Yes");
    }
    


//////////////////////////////////////////////////////
return 0;}



Measured memory_bytes: 1024
import java.util.*;

public class Main implements Runnable {

    private static int MOD = 1_000_000_007;

    public static void main(String[] args) {
        // Run with 32MB stack
        Thread thread = new Thread(null, new Main(), "", 32 * 1024 * 1024);
        thread.start();
    }

    @Override
    public void run() {
        final Scanner scanner = new Scanner(System.in);
        solve(scanner);
    }

    static void solve(Scanner scanner) {
        long a = Long.parseLong(scanner.next());
        long b = Long.parseLong(scanner.next());
        long k = Long.parseLong(scanner.next());
        if (a > 0) {
            if (a > k) {
                a -= k;
                k = 0;
            } else {
                k -= a;
                a = 0;
            }
        }
        if (k > 0) {
            b = Math.max(0, b - k);
        }

        System.out.printf("%d %d\n", a, b);
    }
}


Measured memory_bytes: 25684
while True:
    n = int(input())
    if n == 0:
        break
    S = list(map(int,input().split()))
    Ave = sum(S)/n
    sum2 = 0
    for x in S:
        sum2 += (x-Ave)**2
    Std = (sum2/n)**0.5
    print(Std)
    


Measured memory_bytes: 5660
#include <stdio.h>

int main(){
        int n,x,ans;
    for(;;){
        scanf("%d %d",&n,&x);
        ans=0;
        if(n==0) break;
        for(int i=1;i<n-1;i++){
            for(int j=i+1;j<n;j++){
                for(int k=j+1;k<=n;k++){
                    if(i+j+k==x){
                        ans++;
                    }
                }
            }
        }
        printf("%d\n",ans);
    }
    return 0;
}


Measured memory_bytes: 2076
const main = (arg) => {
  const lines = arg.trim().split('\n');
  const [a, b] = lines[0].split(' ').map((v) => Number.parseInt(v));
  let ans = 1;
  ans += a <= b ? a - 1 : a - 2;
  console.log(ans);
};
main(require('fs').readFileSync('/dev/stdin', 'utf8'));


Measured memory_bytes: 29512
#include <bits/stdc++.h>
using namespace std;
using pii=pair<int,int>;
using ll=long long;
using pll=pair<ll,ll>;

#define fi first
#define se second
#define pb push_back
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define MOD 1000000007

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

int main() {
	string s;
	cin >> s;
	if(s == "ABC") cout << "ARC" << endl;
	else cout << "ABC" << endl;

  return 0;
}


Measured memory_bytes: 3588
N, P = map(int, input().split())
A = list(map(int, input().split()))
odd = 0
even = 0
for i in range(N):
    if A[i]%2 == 0:
        even += 1
    else:
        odd += 1

C = {(0,0):1}
def comb(n,k):
    if n == 0 or k == 0 or k == n:
        return 1
    else:
        if (n,k) in C:
            return C[(n,k)]
        else:
            C[(n,k)] = comb(n-1,k) + comb(n-1,k-1)
            return C[(n,k)]
m = 0
if P == 0:
    for i in range(0,odd+1,2):
        m += int(comb(odd,i))
else:
    for i in range(1,odd+1,2):
        m += int(comb(odd,i))
print(m*(2**even))


Measured memory_bytes: 3188
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

int main() {
  string s;
  cin >> s;
  for (auto& c : s) {
    if (c == '1') {
      c = '9';
    } else {
      c = '1';
    }
  }
  cout << s << endl;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define SZ(x) ((int)(x).size())
#define rep(i,n) for(int i=0;i<(n);++i)
#define fore(i,a) for(auto &i:a)
#define min(...) min({__VA_ARGS__})
#define max(...) max({__VA_ARGS__})
#define Yes cout << "Yes" << endl;
#define No cout << "No" << endl;
#define answer cout << ans << endl;
signed _main(); signed main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> using v = vector<T>;
template<class T> using vv = vector<v<T>>;
const int MOD=1e9+7;
const long long INF = 1LL << 60;


signed _main(){
  int N;
  int sum=0;
  double M;
  cin >> N >> M;
  v<int> A(N);
  rep(i,N){
    cin >> A[i];
    sum+=A[i];
  }
  int ans=0;
  rep(i,N){
    if((double)A[i]>=(double)sum/4.0/M) ans++;
  }
  if(ans>=M) Yes
  else No
  return 0;
}


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

#define INF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define MODA 1000000007 

int main() {
    double ans = 0;
    int N;
    cin >> N;
    int half;
    half = (N+1)/2;
    ans = (double)half/(double)N;
    cout << setprecision(10) << ans << endl;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
   int N,K,cnt,sabun,ptA,ptB,tmp;
   char s[60];
    //char s[101];
    // 整数の入力
    scanf("%d %d", &N,&K);
    scanf("%s",&s);
    s[K-1]= s[K-1]+0x20;

    // 文字列の入力
    printf("%s\n",s);

    // 出力
    //printf("%d %s\n",a+b+c,s);
   return 0;
}


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


int main(void){
 int N;
  cin >> N;
  double sum = 0;
  double xy[2][N];
  int ar[N];
  long long b = 1;
  for(int i = 0; i < N; i++){
    double x, y;
    cin >> x >> y;
    xy[0][i] = x;
    xy[1][i] = y;
    ar[i] = i;
    b *= i + 1;
  }
  for(int i = 1; i < N; i++){
     sum += (double)(pow((pow(xy[0][ar[i]] - xy[0][ar[i - 1]], 2) + 
                pow(xy[1][ar[i]] - xy[1][ar[i - 1]], 2)),0.5)) / b;
  }
  while(next_permutation(ar, ar + N)){
    for(int i = 1; i < N; i++){
		sum += (double)(pow((pow(xy[0][ar[i]] - xy[0][ar[i - 1]], 2) + 
                pow(xy[1][ar[i]] - xy[1][ar[i - 1]], 2)),0.5)) / b;
    }
  }
  cout << setprecision(10) << sum;
  return 0;
}

Measured memory_bytes: 256
//g++ -std=c++14 test.cpp -o test.out
 
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <cassert>
#include <algorithm>
#include <functional>
#include <iostream>
#include <iomanip>
#include <vector>
#include <queue>
#include <stack>
#include <map> 
#include <unordered_map> 
#include <utility>
#include <limits.h>
#include <bitset>
#include <set>
using namespace std;
 
#define LL long long int
const LL INF = (1LL<<60);
const int INF_INT = 2147483647-1e6-1;
const LL mod = 1000000007ll;
const int mod_int = 1000000007;

//計算量はどちらもO(logN)
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;}

LL N;
vector<LL> A;
 
string ans = "not coprime";

void solve(){
	const int MAX_NUM = 1000000;
	sort(A.begin(),A.end(),greater<LL>());//昇順
	vector<LL> exist(MAX_NUM+1,0);
	for(int i=0;i<N;i++) exist[A[i]]++;
	//まずpairwise coprimeかを判定
	auto PC = [&](){
		//二回同じ数が登場していて、かつそれが1以外ならもうそれは絶対にpairwise coprimeではない
		for(int i=1;i<N;i++){
			if(A[i-1]==A[i] && A[i-1]!=1) return false;
		}
		for(LL i=2;i<=MAX_NUM;i++){
			//GCD(なんか1,なんか2)=iとなるようなiがあると決め打ちする
			int num = 0;
			for(LL j=i;j<=MAX_NUM;j+=i){
				//jが集合Aに含まれていれば
				if(exist[j]){
					num++;
				}
			}
			if(num>=2) return false;
		}
		return true;
	};
	if(PC()){
		ans = "pairwise coprime";
		return;
	}

	//pairwise coprimeでないならsetwise coprimeかを判定
	auto SC = [&](){
		//二回同じ数が登場している回数をカウント
		LL doubled = 0;
		for(int i=1;i<N;i++){
			if(A[i-1]==A[i]) doubled++;
		}
		vector<LL> numof_appeard(MAX_NUM+1,0);
		for(LL i=2;i<=MAX_NUM;i++){
			//GCD(なんか1,なんか2,.......,なんかN)=iとなるようなiがあると決め打ちする
			for(LL j=i;j<=MAX_NUM;j+=i){
				//jが集合Aに含まれていれば
				if(exist[j]){
					numof_appeard[i]++;
				}
			}
		}
		for(int i=0;i<=MAX_NUM;i++){
			if(numof_appeard[i]==N-doubled) return false;
		}
		return true;
	};
	if(SC()){
		ans = "setwise coprime";
		return;
	}
}
 
int main(){
    cin >> N;
    A = vector<LL>(N);
    for(int i=0;i<N;i++) cin >> A[i];
 
    solve();
 
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 26340
/// Bismillahir Rahmanir Rahim

#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define f0(n) for(int i=0;i<n;i++)
#define ms(x) memset(x,0,sizeof(x))
#define ins insert
#define ALL(v) v.begin(),v.end()
#define highest(x) numeric_limits<x>::max()
#define lowest(x) numeric_limits<x>::min()
#define Inf INFINITY
#define minv(v) *min_element(v.begin(),v.end())
#define maxv(v) *max_element(v.begin(),v.end())
#define PI acos(-1)
#define IOS ios::sync_with_stdio(false);
using namespace std;
int dx8[] = {0, 0, 1, 1, 1, -1, -1, -1};
int dy8[] = {1,-1, 1, -1, 0, 0, -1, 1};
int dx4[] = {0, 0, 1, -1};
int dy4[] = {1, -1, 0, 0};
const long long MOD = 1000000007;
template<typename T>inline T Bigmod(T base, T power, T MOD){
    T ret=1;
    while(power)
    {
        if(power & 1)ret=(ret*base)%MOD;
        base=(base*base)%MOD;
        power>>=1;
    }
    return ret;
}

bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}
ll arr[1000006],pre[1000006];
int main()
{
    IOS
    for(int i=1;i<1000006;i++){
        if(i%5!=0 && i%3!=0){
            arr[i]=i;
        }
    }
    for(int i=1;i<1000006;i++){
        pre[i]= arr[i]+pre[i-1];
    }
    ll n;
    while(cin>>n){
        cout << pre[n] << endl;
    }
    return 0;
}
///Alhamdulillah


Measured memory_bytes: 19276
#include<iostream>
using namespace std;
#define sz 100005

char f,g;
bool flag;
///vector < int > v,va,vb;
int arr[sz],brr[sz],crr[sz];



int main(){

    int n,m, i,j,k, x=0,y=0,z=0, a,b,c;

    cin>>n>>m;
    n--;
    m--;
    cout<<n*m<<endl;

    return 0;



}


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

#define int long long
#define rep(i,l,r) for(int i=(int)(l);i<(int)(r);i++)
#define all(x) (x).begin(),(x).end()
#define pb push_back
template<class T>bool chmax(T &a,T b){if(a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a,T b){if(a>b){a=b;return 1;}return 0;}

typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;

const int inf = 1LL<<60;
const int mod = 1e9 + 7;
const double eps = 1e-9;

/*{
}*/

signed main()
{
	int n, k;
	cin >> n >> k;

	cout << n-k+1 << endl;

	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
using namespace std;

//ループマクロ
#define FOR(i , a , b)  for(int i = (a) ; i < (b) ; i++)
#define REP(i , n)      for(int i = 0 ; i < n ; i++)
#define REPR(i , n)     for(int i = n ; 0 <= i ; i--)
#define ROP(i, n)       for(int i = 1 ; i <= n ; i++)

//入出力
#define SCOUT(x) cout << (x) << " "
#define VECCIN(x) for(auto& ele : (x) ) cin >> ele
#define VECOUT(x) for(auto& ele : (x) ) cout << ele << " "; cout << endl;

//その他
#define ALL(obj) (obj).begin() , (obj).end() 
#define SORT(obj) sort(ALL(obj))
#define GSORT(obj) sort(ALL(obj) , greater<int>())
#define P pair<int , int>
#define V vector<int>
#define VLL vector<long long>
#define S set<int>
#define PQ priority_queue<int>
#define PQG priority_queue<int , V , greater<int>>

#define MAX_V 10
int d[MAX_V][MAX_V];
void warshall_floyd(){
		for(int k = 0 ; k < MAX_V ; k++)
				for(int i = 0 ; i < MAX_V ; i++)
						for(int j = 0 ; j < MAX_V ; j++)  d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
}

int main(void) {

	ios::sync_with_stdio(false);	cin.tie(0);
	int H, W;  cin >> H >> W;

	//d[i][j] : i + 1からj + 1に変える最小コスト
	for(int i = 0 ; i < MAX_V ; i++)
		for(int j = 0 ; j < MAX_V ; j++)  cin >> d[i][j];

	warshall_floyd();

	ll ans = 0;
	for(int i = 0 ; i < H ; i++){
		for(int j = 0 ; j < W ; j++){
			int a;  cin >> a;
			if(a >= 0)   ans += d[a][1];
		}
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
n, k = list(map(int, input().split()))
l = [0]*n
for i in range(k):
    d = int(input())
    a = list(map(int, input().split()))
    for i in a:
        l[i-1] = 1
c = 0
for i in l:
    if i == 0:
        c += 1
print(c)


Measured memory_bytes: 9180
#include<stdio.h>
#include<string.h>
#include<stdlib.h>

int main(){
  int n,i,j;
  int p[200001];
  int cnt = 0;
  int min = 1000000000;

  scanf("%d", &n);

  for(i = 0;i < n;i++) scanf("%d", &p[i]);

  for(i = 0;i < n;i++){
    if(min > p[i]) min = p[i];

    if(min == p[i]) cnt++;
  }

  printf("%d\n", cnt);

  return 0;
}


Measured memory_bytes: 896
#include "bits/stdc++.h"
 
typedef long long ll;
#define int ll
#define fi first
#define se second
#define SORT(a) sort(a.begin(),a.end())
#define REP(i,n) for(int i = 0;i < (n) ; i++) 
#define MP(a,b) make_pair(a,b)
#define pb(a) push_back(a)
#define INF LLONG_MAX/2
int MOD = 1000000007;

using namespace std;

signed main(){
    
    int n,k; 
    cin >> n >> k;

    int a[n];
    int p[n+1] = {0};
    int m[n+1] = {0};

    REP(i,n){
        cin >> a[i];
        if(a[i] > 0){
            p[i+1] = a[i] + p[i];
            m[i+1] = m[i];
        }else{
            p[i+1] = p[i];
            m[i+1] = -1*a[i] + m[i];
        }
    }
    int ans = p[n];
    int max_p = 0;
    int max_m = 0;
    int now_p = 0;
    int now_m = 0;
    REP(i,n){
        if(a[i] > 0){
            now_p++;
            max_p = max(now_p,max_p);
            now_m = 0;
        }else if(a[i] < 0){
            now_m++;
            max_m = max(now_m,max_m);
            now_p = 0;
        }else{
            now_m++;
            now_p++;
            max_m = max(now_m,max_m);
            max_p = max(now_p,max_p);
        }
    }

    if(max_p >= k || max_m >= k){
        cout << ans << endl;
        return 0;
    }

    int min_a = INF;

    for(int i = 0; i+k <= n;i++){
        min_a = min({min_a,p[i+k]-p[i],m[i+k]-m[i]});
    }
  
    cout << ans - min_a << endl;

    return 0;
}
// g++ -std=c++14 code1.cpp
// rm -r -f test;oj dl 

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

using namespace std;

int main()
{
	string			line;
	string			line2;

	getline(cin, line);
	getline(cin, line2);

	line += line;

	string::size_type		pos = line.find(line2);
	if (pos != string::npos)
	{
		cout << "Yes\n";
	}
	else
	{
		cout << "No\n";
	}

	return 0;
}

Measured memory_bytes: 3188
#include <iostream>
int main()
{
	using namespace std;
	
	int N;
	int oper = 0;
	cin >> N;
	int Sort[N];
	for (int i = 0; i < N; i++) cin >> Sort[i];
	
	for (int i = 0; i < N; i++){
		int minj = i;
		for (int j = i; j < N; j++){
			if (Sort[j] < Sort[minj]){
				minj = j;
			}	
		}
			int v = 0;
			v = Sort[i];
			Sort[i] = Sort[minj];
			Sort[minj] = v;
			if (Sort[i] != Sort[minj]) oper++;
	}
	for (int i = 0; i < N; i++) {
		if (i) cout << " ";
		cout << Sort[i];
			}
	cout << endl << oper << endl;
	return 0;
}


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

using namespace std;

int main() {
    string S;
    int K;
    cin >> S >> K;
    int count = 1, count1 = 1, count2 = 1;
    long long int ans = 0;
    if(S.at(0) == S.at(S.size() - 1)) {
        for(int i = 1; i < S.size(); i++) {
            if(S.at(i) == S.at(i - 1))
                count1++;
            else 
                break;
        }
        if(count1 != S.size()) {
            for(int i = S.size() - 2; i >= 0; i--) {
                if(S.at(i) == S.at(i + 1))
                    count2++;
                else 
                    break;
            }
        }
    }
    for(int i = count1; i < S.size() - count2 + 1; i++) {
        if(S.at(i) == S.at(i - 1))
            count++;
        else {
            ans += count / 2;
            count = 1;
        }
      	if(i == S.size() - 1) {
        	ans += count / 2;
          	count = 1;
        }
    }
    if(S.at(0) == S.at(S.size() - 1) && count1 != S.size() && ((count1 + count2) % 2))
        ans = (ans + ((count1 + count2) / 2)) * K;
    else if(S.at(0) == S.at(S.size() - 1) && count1 != S.size() && !((count1 + count2) % 2))
        if(!(count1 % 2) && !(count2 % 2))
            ans = (ans + ((count1 + count2) / 2)) * K;
        else 
            ans = (ans + ((count1 + count2) / 2)) * K - 1;
    else if(count1 == S.size()) 
        ans = (K * S.size()) / 2;
    else
        ans *= K;
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/env python3
import sys

MOD = 2019  # type: int


def solve(L: int, R: int):
    list_lr_mod = []
    ans = 2018

    for i, x in enumerate(range(L, R + 1)):
        list_lr_mod.append(x % MOD)

        if i + 1 >= 2019:
            print(0)
            return

    if 0 in list_lr_mod:
        print(0)
        return

    for i in range(len(list_lr_mod) - 1):
        for j in range(i + 1, len(list_lr_mod)):
            tmp = list_lr_mod[i] * list_lr_mod[j]
            ans = min(ans, tmp % MOD)

    print(ans)

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    L = int(next(tokens))  # type: int
    R = int(next(tokens))  # type: int
    solve(L, R)

if __name__ == '__main__':
    main()


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define mt make_tuple
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define forn(i, n) for(int i = 0; i < n; ++i)
#define for1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#define ll long long

#define MOD 1000000007
typedef pair<int, int> pii;
// typedef vector<int> vi;
// typedef vector<pii> vpi;
// typedef vector<vi> vvi;
// typedef long long i64;
// typedef vector<i64> vi64;
// typedef vector<vi64> vvi64;
// typedef pair<i64, i64> pi64;
// typedef double ld;
typedef  long long ui64;

template<class T> bool uin(T &a, T b) { return a > b ? (a = b, true) : false; }
template<class T> bool uax(T &a, T b) { return a < b ? (a = b, true) : false; }
// ui64 mx=1000*1000*1000+3;
// ui64 dp[mx];
double dp[3009][3009];
double arr[3009];

int main()
{
	int n;
	cin>>n;
	forn(i,n)
	{
		cin>>arr[i];
	}
	dp[0][0]=1.0;
	forn(i,n+1)
	{
		forn(j,n+1)
		{
			dp[i+1][j+1]+=dp[i][j]*arr[i];
			dp[i+1][j]+=dp[i][j]*(1-arr[i]);
		}
	}
	double ans=0.0;
			forn(i,n+1)
			{
				if(i>=n-i)
				ans+=dp[n][i];
			}
cout.precision(12);
cout<<ans;
return 0;}


Measured memory_bytes: 70784
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var charSet = []string{
	"A", "C", "G", "T",
}

func main() {
	S := nextString()
	l := len(S)
	ans := 0
	cur := 0
	for i := 0; i < l; i++ {
		if match(string(S[i])) {
			cur += 1
		} else {
			ans = MaxIn2Values(ans, cur)
			cur = 0
		}
		if i == l-1 {
			ans = MaxIn2Values(ans, cur)
		}
	}
	fmt.Printf("%v", ans)
}

func match(s string) bool {
	for _, v := range charSet {
		if v == s {
			return true
		}
	}
	return false
}

func nextInt() int {
	v, _ := strconv.Atoi(nextReader())
	return v
}

func nextString() string {
	return nextReader()
}

func nextInts(n int) []int {
	r := make([]int, n)
	for i := 0; i < n; i++ {
		r[i] = nextInt()
	}
	return r
}

var nextReader func() string

func init() {
	nextReader = NewScanner()
}

func NewScanner() func() string {
	r := bufio.NewScanner(os.Stdin)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)
	return func() string {
		r.Scan()
		return r.Text()
	}
}

func Min(a int, b int) int {
	if a > b {
		return b
	}
	return a
}

func MaxIn2Values(a int, b int) int {
	if a > b {
		return a
	}
	return b
}

func MinIn2Values(a int, b int) int {
	if a < b {
		return a
	}
	return b
}

func Abs(a int) int {
	if a < 0 {
		return a * -1
	}
	return a
}


Measured memory_bytes: 640
#include<iostream>
using namespace std;
int main(){
  int n,math[5010],most,bell;
  while(1){
    cin >> n;
    if(n==0){
      break;
    }


    for(int i=0;i<n;i++){
      cin >> math[i];
    }
    most = math[0];
    for(int i=0;i<n;i++){
      bell=0;
      for(int j=i;j<n;j++){
	bell+=math[j];
	if(most<bell){
	  most=bell;
	}
      }
    }
    cout << most << endl;
  }
}

Measured memory_bytes: 1176
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <cmath>
using namespace std;

const int N = 2e3 + 7;
int dist[N][N];
int ans[N] = {};

int main(){
    memset(dist, -1, sizeof dist);
    int n, x, y;
    cin >> n >> x >> y;
    x--; y--;
    for(int i = 0; i < n-1; i++){
        dist[i][i+1] = 1;
    }
    dist[x][y] = 1;
    for(int i = 0; i < n; i++){
        for(int j = i+1; j < n; j++){
            if(dist[i][j] == -1){
                dist[i][j] = min(
                        min(abs(x-i) + abs(y-j) + 1, abs(i-y) + abs(j-x) + 1),
                        j-i);
            }
            ans[dist[i][j]]++;
        }
    }
    for(int i = 1; i < n; i++){
        cout << ans[i] << '\n';
    }
}


Measured memory_bytes: 16000
#include <bits/stdc++.h>
#define fi first
#define se second
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define rep2(j,n) for(int j = 0; j < (n); ++j)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
#define drep2(j,n) for(int j = (n)-1; j >= 0; --j)
#define srep(i,s,t) for (int i = s; i < t; ++i)
#define srep2(j,s,t) for (int j = s; j < t; ++j)
#define srep3(k,s,t) for (int k = s; j < t; ++k)
#define rng(a) a.begin(),a.end()
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define limit(x,l,r) max(l,min(x,r))
#define lims(x,l,r) (x = max(l,min(x,r)))
#define isin(x,l,r) ((l) <= (x) && (x) < (r))
#define pb push_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define uni(x) x.erase(unique(rng(x)),x.end())
#define snuke srand((unsigned)clock()+(unsigned)time(NULL));
#define show(x) cout<<#x<<" = "<<x<<endl;
#define PQ(T) priority_queue<T,v(T),greater<T> >
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define v(T) vector<T>
#define vv(T) v(v(T))
using namespace std;
typedef long long int ll;
typedef unsigned uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef set<int> S;
typedef queue<int> Q;
typedef queue<P> QP;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<ll> vl;
typedef vector<P> vp;
inline int in() { int x; scanf("%d",&x); return x;}
const ll LINF = 1001002003004005006ll;
const int INF = 1001001001;
#define dame { puts("-1"); return 0;}
#define yn {puts("YES");}else{puts("NO");}
  
int main() {
  int a,b,c;
  cin >> a >> b >> c;
  if((a <= c && c <= b) || (b <= c && c <= a)) {
    cout << "Yes" << endl;
  } else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
/* ****GT_18**** */

#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define	endl		'\n'
#define pii         pair<ll int,ll int>
#define vi          vector<ll int>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll int)x.size()
#define hell        1000000007
#define rep(i,a,b)	for(ll int i=a;i<b;i++)
#define lbnd        lower_bound
#define ubnd        upper_bound
#define bs          binary_search
#define mp          make_pair
using namespace std;

#define N  303

ll n;
ll a[4];
double dp[N][N][N];


double solve(ll ones, ll twos , ll threes){
	if(ones<0 or twos<0 or threes<0)return 0;
	if(dp[ones][twos][threes]!=-1.0)return dp[ones][twos][threes];
	double zeros = n- ones - twos - threes;
	double num = n-zeros;
	double den = n;
	double temp;
	if(num==0){
		temp=0;
	}
	else{
		temp = (den/num);
		double ans1 = solve(ones-1,twos,threes)*ones;
		ans1/=num;
		double ans2 = solve(ones+1,twos-1,threes)*twos;
		ans2/=num;
		double ans3 = solve(ones,twos+1 ,threes-1)*threes;
		ans3/=num;
		temp+=ans1+ans2+ans3;
	}
	// cerr<<ones<<" "<<twos<<" "<<threes<<"    "<<temp<<endl;
	return dp[ones][twos][threes]=temp;
}

int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int TESTS=1;
//	cin>>TESTS;
	rep(i,0,N)rep(j,0,N)rep(k,0,N)dp[i][j][k]=-1.0;
	while(TESTS--)
	{
			cin>>n;
			rep(i,0,n){
				ll x;
				cin>>x;
				a[x]++;
			}
			cout<<fixed<<setprecision(11)<<solve(a[1],a[2],a[3])<<endl;

	}
	return 0;
}

Measured memory_bytes: 221212
n, l = map(int, input().split())
taste = [l+i-1 for i in range(1, n+1)]

if 0 in taste:
    ans = sum(taste)
else:
    if min(taste) > 0:
        ans = sum(taste) - min(taste)
    else:
        ans = sum(taste) - max(taste)

print(ans)

Measured memory_bytes: 3060
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var Arr=(input.trim()).split("\n");
var n=Arr.shift()-0;
for(var j=0;j<n;j++){
   var out=0;
   var runner=0;
   var score=0;
   while(out<3){
      var v=Arr.shift();
      if(v=="HIT"){
         runner++;
         if(runner==4){runner--;score++;}
      }
      if(v=="HOMERUN"){score+=(runner+1);runner=0;}
      if(v=="OUT")out++;
   }
   console.log(score);
}

Measured memory_bytes: 7644
/**
 * JJOOII
 */

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String line;

		while ((line = br.readLine()) != null && !line.isEmpty()) {

			List<Character> cs = new ArrayList<Character>();
			List<Integer> ls = new ArrayList<Integer>();
			int last = 0;

			//parse
			cs.add('X');
			ls.add(1);
			for (int i = 0; i < line.length(); i++) {
				if (cs.get(last) == line.charAt(i)) {
					ls.set(last, ls.get(last) + 1);
				} else {
					cs.add(line.charAt(i));
					ls.add(1);
					last++;
				}
			}
			cs.add('X');
			ls.add(1);

			//solve
			int k = 0;
			for (int i = 0; i < cs.size(); i++) {
				if (cs.get(i) == 'O') {
					int l = ls.get(i);
					if (cs.get(i - 1) == 'J' && cs.get(i + 1) == 'I'
							&& ls.get(i - 1) >= l && ls.get(i + 1) >= l) {
						k = Math.max(k, l);
					}
				}
			}
			System.out.println(k);
		}
	}
}

Measured memory_bytes: 52016
#!/use/bin/env python3

import math
from collections import defaultdict

(d, n) = [int(s) for s in input().split()]

ans = 0

if d == 0:
    ans = 1
elif d == 1:
    ans = 100
else:
    ans = 10000

ans = 101 * ans if n == 100 else n * ans

print(ans)


Measured memory_bytes: 3316
#include<iostream>
#define int64 int64_t
using namespace std;

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


int main()
{
 int64 a,b;
  cin>>a>>b;  
  int64 g=gcd(a,b);
  
  int res=1;
  for(int64 i=2;i*i<=g;i++)
  {  
        if(g%i==0)
        {
             while(g%i==0)
                 g/=i; 
          res++;
        }
  }
    if(g>1)
      res++;
  
  cout<<res<<endl;
  return 0;
  
}


Measured memory_bytes: 256
#include <iostream>

bool checkTriangle(int a, int b, int c)
{
	if((a >= b) && (a >= c)) {
		return (a*a == (b*b + c*c));
	} else if((b >= a) && (b >= c)) {
		return (b*b == (a*a + c*c));
	} else {
		return (c*c == (a*a + b*b));
	}
}

int showResult(int a, int b, int c)
{
	if(checkTriangle(a,b,c)) {
		std::cout << "YES" << std::endl;
	} else {
		std::cout << "NO" << std::endl;
	}
	return 0;
}
	
int main()
{
	int N, a, b, c = 0;
	std::cin >> N;
	
	if(N == 0) {
		return 0;
	}
	for(int i = 0; i < N; i++) {
		std::cin >> a >> b >> c;
		showResult(a, b, c);
	}
	return 0;	
}

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

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

  if (N%10 == N%100/10 && N%100/10 == N%1000/100){
    cout << "Yes" << endl;
  }
  else if(N%100/10 == N%1000/100  && N%1000/100 == N/1000) {
    cout << "Yes" << endl;
    }
  else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 256
n, m, X, Y = map(int, input().split())
x = list(map(int, input().split()))
y = list(map(int, input().split()))
x.append(X)
y.append(Y)

for i in range(len(x)):
	for j in range(len(y)):
		if (x[i] == y[j]):
			print('War')
			exit()

if max(x) >= min(y):
	print('War')
	exit()

print('No War')

Measured memory_bytes: 3064
#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<string>

using namespace std;

const int N = 200001;
int n, k;


int main()
{
	cin >> k;
	if(k % 2 == 0 || k % 5 == 0)
	{
		cout << -1 << endl;
		return 0;
	}
	if(k % 7 == 0) k /= 7;
	k *= 9;
	int x = 10 % k, r = 1;
	while(x != 1)
	{
		x = (x * 10) % k;
		++r;
	}
	cout << r << endl;
	return 0;
}


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

int main () {
  string S;
  cin >> S;
  
  bool ans = false;
  for (int i = 0; i < S.size() - 1; i++) {
    if (S.at(i) == 'A') {
      if (S.at(i + 1) == 'C') {
        ans = true;
      }
    }
  }
  if (ans) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;
typedef long long ll;
const ll M=1000000007;
int n,m,i,j,len,l,r,lt,ls;
ll h2[2000005],h[2000005],m26[2000005];
char s[2000005],t[2000005];
bool check(int m)
{
	int j;
	for(j=m;j<=ls;j++)
		if(((h[j]-h[j-m]*m26[m])%M+M)%M==h2[m])
			return true;
	return false;
}
int main(){
	scanf("%s",s+1);
	len=strlen(s+1);
	ls=2000000/len*len;
	for(i=len+1;i<=2000000/len*len;i++)
		s[i]=s[i-len];
	scanf("%s",t+1);
	lt=strlen(t+1);
	for(j=lt+1;j<=2000000/lt*lt;j++)
		t[j]=t[j-lt];
	for(j=1;j<=ls;j++)
	{
		h2[j]=(h2[j-1]*26+t[j]-'a')%M;
		h[j]=(h[j-1]*26+s[j]-'a')%M;
	}
	m26[0]=1;
	for(i=1;i<=2000000;i++)
		m26[i]=m26[i-1]*26%M;
	l=1;
	r=2000000/lt;
	while(l<r)
	{
		int mid=(l+r)/2;
		if(check(mid*lt))
			l=mid+1;
		else
			r=mid;
	}
	if((l-1)*lt>=1000000)
		printf("-1");
	else
		printf("%d\n",l-1);
}


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

#define ln '\n'
#define REP(i, n) for(int i = 0; i < (int)(n); ++i)
#define FOR(i, a, b) for(int i = (a); i <= (int)(b); ++i)
#define FORR(i, a, b) for(int i = (a); i >= (int)(b); --i)
#define ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
typedef vector<P> VP;
typedef vector<PL> VPL;
typedef vector<string> VS;

int n;
int A, B, C;
VI l;
int dfs(int i, int a, int b, int c) {
    if(i == n) {
        if(a == A or b == B or c == C) return 1e9;
        else return abs(a) + abs(b) + abs(c) - 30;
    }
    int res1 = dfs(i + 1, a - l[i], b, c) + 10;
    int res2 = dfs(i + 1, a, b - l[i], c) + 10;
    int res3 = dfs(i + 1, a, b, c - l[i]) + 10;
    int res4 = dfs(i + 1, a, b, c);
    return min({res1, res2, res3, res4});
}


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n >> A >> B >> C;
    l.resize(n);
    REP(i, n) cin >> l[i];
    cout << dfs(0, A, B, C) << ln;
    return 0;
}


Measured memory_bytes: 256
#![allow(unused_parens)]
#![allow(unused_imports)]
#![allow(non_upper_case_globals)]
#![allow(non_snake_case)]
#![allow(unused_mut)]
#![allow(unused_variables)]
#![allow(dead_code)]

use itertools::Itertools;
use proconio::input;
use proconio::marker::{Chars, Usize1};

#[allow(unused_macros)]
#[cfg(debug_assertions)]
macro_rules! mydbg {
    //($arg:expr) => (dbg!($arg))
    //($arg:expr) => (println!("{:?}",$arg));
      ($($a:expr),*) => {
          eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
      }
}
#[cfg(not(debug_assertions))]
macro_rules! mydbg {
    ($($arg:expr),*) => {};
}

macro_rules! echo {
    ($($a:expr),*) => {
          $(println!("{}",$a))*
      }
}

use std::cmp::*;
use std::collections::*;
use std::ops::{Add, Div, Mul, Sub};

#[allow(dead_code)]
static INF_I64: i64 = 92233720368547758;
#[allow(dead_code)]
static INF_I32: i32 = 21474836;
#[allow(dead_code)]
static INF_USIZE: usize = 18446744073709551;
#[allow(dead_code)]
static M_O_D: usize = 1000000007;
#[allow(dead_code)]
static PAI: f64 = 3.1415926535897932;

trait IteratorExt: Iterator {
    fn toVec(self) -> Vec<Self::Item>;
}

impl<T: Iterator> IteratorExt for T {
    fn toVec(self) -> Vec<Self::Item> {
        self.collect()
    }
}

trait CharExt {
    fn toNum(&self) -> usize;
    fn toAlphabetIndex(&self) -> usize;
    fn toNumIndex(&self) -> usize;
}
impl CharExt for char {
    fn toNum(&self) -> usize {
        return *self as usize;
    }
    fn toAlphabetIndex(&self) -> usize {
        return self.toNum() - 'a' as usize;
    }
    fn toNumIndex(&self) -> usize {
        return self.toNum() - '0' as usize;
    }
}

trait VectorExt {
    fn joinToString(&self, s: &str) -> String;
}
impl<T: ToString> VectorExt for Vec<T> {
    fn joinToString(&self, s: &str) -> String {
        return self
            .iter()
            .map(|x| x.to_string())
            .collect::<Vec<_>>()
            .join(s);
    }
}

trait StringExt {
    fn get_reverse(&self) -> String;
}
impl StringExt for String {
    fn get_reverse(&self) -> String {
        self.chars().rev().collect::<String>()
    }
}

trait UsizeExt {
    fn pow(&self, n: usize) -> usize;
}
impl UsizeExt for usize {
    fn pow(&self, n: usize) -> usize {
        return ((*self as u64).pow(n as u32)) as usize;
    }
}

fn main() {
    input! {
       s: usize,
       w:usize,
    }

    if s <= w {
        echo!("unsafe");
    } else {
        echo!("safe");
    }
}


Measured memory_bytes: 2172
#include<bits/stdc++.h>
using namespace std;
#define N 100010
vector<int>d[N];
bool b[N];
int sg[N];
void dfs(int x){
	b[x]=1;
	for (int i=0;i<d[x].size();i++)
		if (!b[d[x][i]]){
			dfs(d[x][i]);
			sg[x]^=sg[d[x][i]]+1;
		}
}
int main(){
	int n;
	scanf("%d",&n);
	for (int i=1;i<n;i++){
		int x,y;
		scanf("%d%d",&x,&y);
		d[x].push_back(y);
		d[y].push_back(x);
	}
	dfs(1);
	if (sg[1]) printf("Alice\n");
	else printf("Bob\n");
	return 0;
}

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

int main(void){
  long double a, b, x;
  cin >> a >> b >> x;
  a = ceil(a / x);
  b = floor(b / x);
  long long ans = b - a + 1;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
<?php
//error_reporting(0);
$N = trim(fgets(STDIN));
$S = trim(fgets(STDIN));
//list($A,$B,$C) =  explode(" ",trim(fgets(STDIN)));

$sumB=array(0);
$sumW=array(0);
for($i=0;$i<$N;$i++) {
  $sumB[$i+1]=$sumB[$i]+($S[$i]==="#"?1:0);;
  $sumW[$i+1]=$sumW[$i]+($S[$i]==="."?1:0);;
}
$m = $N;
for($i=0;$i<$N+1;$i++) {
  $cntB = $sumB[$i];
  $cntW = $sumW[$N]-$sumW[$i];
  $m = min($m,$cntB+$cntW);
}
printf("%d\n",$m);


Measured memory_bytes: 23152