akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <climits>
using namespace std;

bool comp(pair<int, string> a, pair<int, string> b){
    if(a.first != b.first) return a.first > b.first;
    else return a.second < b.second;
}

long int jou(long int x, long int y){
    long int f = 1;
    for(int i = 0; i < y; ++i){
        f = f * x % int(powl(10,9) + 7);
    }

    return f;
}

bool pn(long int x){
    if(x != 2 && x % 2 == 0)
        return false;

    for(int i = 3; i < x; ++i){
        if(x != i && x % i == 0)
            return false;
    }
    return true;
}

int main(){
    long int n;
    cin >> n;
    vector<long int> v;

    for(int i = 2; i <= n; ++i){
        long int count = 0;
        if(!pn(i))
            continue;
        for(long int j = 1; j <= n; ++j){
            long int x = j;
            while(x > 1){
                if(x % i == 0)
                {
                    count++;
                    x = x / i;
                }
                else
                {
                    break;
                }
            }
        }
        v.push_back(count);
    }
    long int an = 1;
    for(int i = 0; i < v.size(); ++i){
        an = an*(v[i] + 1) % ((int)pow(10,9) + 7);
    }

    cout << an% ((int)pow(10,9) + 7) << endl;

    return 0;
}

Measured memory_bytes: 256
using System;

public class Spreadsheet
{
    //??¨????????°r??¨?????°c???r ?? c ???????´????????????¨?????????????????§???????????¨??????????¨?????????\????????°????????¨???????????????????????°??????
    static void Main(string[] args)
    {
        /*---??£?¨???¨---*/
        string[] rowAndLine;
        string[] tableNumBuffer;
        int tableRow;
        int tableLine;
        int tableRowIndex;
        int tableLineIndex;
        /*---??£?¨???¨---*/

        /*?????°??¨?????°?????????????????¨?????????*/
        rowAndLine = Console.ReadLine().Split();
        tableRow = int.Parse(rowAndLine[0]);
        tableLine = int.Parse(rowAndLine[1]);

        int[,] table = new int[tableRow + 1, tableLine + 1];

        /*??¨?????????????????????*/
        for (tableRowIndex = 0; tableRowIndex < tableRow; tableRowIndex++)
        {
            tableNumBuffer = Console.ReadLine().Split(' ');
            for (tableLineIndex = 0; tableLineIndex < tableLine; tableLineIndex++)
            {
                table[tableRowIndex, tableLineIndex] = int.Parse(tableNumBuffer[tableLineIndex]);
            }
        }

        /*?????¨?????????????¨?????????\???*/
        for (tableRowIndex = 0; tableRowIndex < tableRow; tableRowIndex++)
        {
            for (tableLineIndex = 0; tableLineIndex < tableLine; tableLineIndex++)
            {
                table[tableRowIndex, tableLine] += table[tableRowIndex, tableLineIndex];
                table[tableRow, tableLineIndex] += table[tableRowIndex, tableLineIndex];
            }
            //??¨??????????¨?
            if (tableRowIndex == tableRow - 1)
            {
                for (int i = 0; i < tableLine; i++)
                {
                    table[tableRow, tableLine] += table[tableRow, i];
                }
            }
        }

        /*?¨????????????¨?????¨???*/
        for (tableRowIndex = 0; tableRowIndex <= tableRow; tableRowIndex++)
        {
            for (tableLineIndex = 0; tableLineIndex <= tableLine; tableLineIndex++)
            {
                if (tableLineIndex != tableLine)
                    Console.Write("{0} ", table[tableRowIndex, tableLineIndex]);
                else
                    Console.Write("{0}", table[tableRowIndex, tableLineIndex]);

            }
            Console.Write("\n");
        }
    }
}

Measured memory_bytes: 9364
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string s; cin >> s;
  bool a,b,c;
  a = false;
  b = false;
  c = false;
  for (int i=0;i<s.length();i++){
    if (s[i] == 'a') a =true;
    if (s[i] == 'b') b =true;
    if (s[i] == 'c') c =true;
  }
  if (a && b && c) cout << "Yes" << endl;
  else cout << "No" << endl;
  return 0;
}


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

int main() {
  char str;
  cin >> str;

  if ( str == 'a' || str == 'i' || str == 'u' || str == 'e' || str == 'o') {
  	cout << "vowel" << endl;
  } else {
    cout << "consonant" << endl;
  }
}


Measured memory_bytes: 256
#include <stdio.h>

int main(){
  int n = 0, s;
	scanf("%d", &n);
  while(n/10>0){
	n = n%10;
  }
  s = n;
  if(s==2 || s==4 || s==5 || s==7 || s==9){
	printf("hon\n");
  }else if(s==0 || s==1 || s==6 || s==8){
	printf("pon\n");
  }else{
	printf("bon\n");
  }
  
  return 0;
}

Measured memory_bytes: 1620
import sys

#+++++

def rot_n(c, n):
	ci=ord(c)-ord('A')
	nci = (ci + n )%26
	nci+=ord('A')
	ret = chr(nci)
	return ret

def main():
	n = int(input())
	s = input()
	
	c=['A']*len(s)
	for i in range(len(s)):
		c[i]=rot_n(s[i], n)
	
	print(''.join(c))
	
	
#+++++
isTest=False

def pa(v):
	if isTest:
		print(v)

if __name__ == "__main__":
	if sys.platform =='ios':
		sys.stdin=open('inputFile.txt')
		isTest=True
	else:
		pass
		#input = sys.stdin.readline
			
	ret = main()
	if ret is not None:
		print(ret)

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

using namespace std;

int main() {
    long long n, k, min = 0, max = 0, ans = 0;
    int m = 1000000007;

    cin >> n >> k;

    for (long long i=k;i<n+2;i++) {
        min = i*(i-1)/2;
        max = i*(2*n-i+1)/2;
        ans += max - min + 1;
    }

    cout << ans % m << endl;
}

Measured memory_bytes: 3624
#include<iostream>
#include<algorithm>
#include<vector>
#include<numeric>
#include<string>
#include<cmath>
#include<set>
#include<queue>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cctype>
#include<map>
#include<cstring>
#include<bitset>
#include<cassert>

#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(x) (x).begin(),(x).end()

using namespace std;
using ll = long long int;

const int inf = 1001001000;
const long long int Inf = 1001001001001001000;



void print(vector<vector<int>> a){
	for (int i = 0; i < a.size(); i++)
	{
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<vector<long long int>> a){
	for (int i=0;i<a.size();i++){
		for (int j=0;j<a[i].size();j++){
			cout << a[i][j] << " ";
		}
		cout << endl;
	}
}

void print(vector<int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(vector<long long int> a){
    int n = a.size();
    for (int j=0;j<n;j++) {
        if (j != n-1) cout << a[j] << " ";
        else cout << a[j] << endl;
    }
}

void print(set<int> a){
	for (auto x:a)
		cout << x << " ";
	cout << endl;
}


int main()
{
	int sx, sy, tx, ty;
	cin >> sx >> sy >> tx >> ty;
	string ans;

	rep(i, ty - sy) {
		ans.push_back('U');
	}
	rep(i, tx - sx) {
		ans.push_back('R');
	}

	rep(i, ty - sy) {
		ans.push_back('D');
	}
	rep(i, tx - sx) {
		ans.push_back('L');
	}

	ans.push_back('L');
	rep(i, ty - sy + 1) {
		ans.push_back('U');
	}
	rep(i, tx - sx + 1) {
		ans.push_back('R');
	}
	ans.push_back('D');

	ans.push_back('R');
	rep(i, ty - sy + 1) {
		ans.push_back('D');
	}
	rep(i, tx - sx + 1) {
		ans.push_back('L');
	}
	ans.push_back('U');

	cout << ans << endl;
	// cout << "UURRURRDDDLLDLLULUUURRURRDDDLLDL" << endl;

	return 0;
}

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

fn main() {
    let n: usize = read();
    let mut a: Vec<i64> = (0..n).map(|_| read::<i64>()).collect();
    a.sort();
    let mut rui: Vec<i64> = vec![0; n + 1];
    for i in 0..n {
        rui[i + 1] += rui[i] + a[i];
    }

    let mut lastng: usize = 0;
    for i in 1..n {
        if rui[i] * 2 < a[i] {
            lastng = i;
        }
    }
    println!("{}", n - lastng);
}

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")
}


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

int main(){
  int n,drogagon;
  cin>>n>>drogagon;

  int count=0;
  int ans=0;
  while(true){
    if(count>=n){
      break;
    }
    count+=drogagon+drogagon+1;
    ans++;
  }
  cout<<ans<<endl;

  return 0;
}
      


Measured memory_bytes: 256
#include <iostream>
#include <cstring>
#include <algorithm>
#include <vector>
#include <string>
#include <math.h>
#include <stdio.h>
#include <iomanip>
#include <limits>
#include <list>
#include <string>
#include <queue>
#include <deque>
#include <tuple>
#include <map>
#include <sstream>
using namespace std;
#define MOD (long long int)(1e9+7)
#define ll long long int
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define reps(i,n) for(int i=1; i<=(int)(n); i++)
#define REP(i,n) for(int i=n-1; i>=0; i--)
#define REPS(i,n) for(int i=n; i>0; i--)
#define FOR(i,a,b) for(int i=a; i<(int)(b); i++)
#define ALL(x) (x).begin(),(x).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define SORT(c) sort(ALL(x))
#define CLR(a) memset((a), 0 ,sizeof(a))
#define PB push_back
#define MP make_pair
#define SP << " " <<
const int INF = 1001001001;
const ll LINF = 100100100100100100;
const double EPS = 1e-10;
const long double PI  = acos(-1.0L);
typedef pair<int,int> PII;
typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<ll> VL;
#define chmax(a,b) a = (((a)<(b))?(b):(a))
#define chmin(a,b) a = (((a)>(b))?(b):(a))

__attribute__((constructor))
void initial(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	cout << fixed << setprecision(15);
}

signed main(){
	int a[] = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
	int k; cin>>k;
	cout << a[k-1];



  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <math.h>

using namespace std;

int N;

bool isPrime(int a) {
  if (a == 2) 
    return true;
  if (a % 2 == 0)
    return false;

  for (int i = 3; i <= sqrt(a); i += 2) {
    if (a % i == 0) 
      return false;
  }

  return true;
}

int main() {
  cin >> N;
  
  int count = 0;
  for (int i = 0; i < N; i++) {
    int a;
    cin >> a;
    if (isPrime(a))
      count++;
  }
  
  cout << count << endl;

  return 0;
}

Measured memory_bytes: 1164
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<set>
#include<vector>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define ALL(C)     (C).begin(),(C).end()

main(){
  int t;
  while(cin>>t && t){
    rep(i,9){
      int a;cin>>a;t-=a;
    }
    cout << t << endl;
  }
  return false;
}  

Measured memory_bytes: 0
#include<stdio.h>
#include<string.h>
 
#define LEN 100005
#define MAX 100
 
typedef struct pp{
  char name[MAX];
  int t;
}P;
 
P Q[LEN+1];
int head, tail, n;
 
void initialize(void);
 
void enqueue(P);
P dequeue(void);
 
 
int main(){
  P u;
  int elaps = 0, n;
  int i, q;
  
  scanf("%d %d", &n, &q);
 
  for ( i = 1; i <= n; i++){
    scanf("%s", u.name);
    scanf("%d", &u.t);
    enqueue(u);
  }
  
  while(head != tail){
    u=dequeue();
    if(u.t>q){
      u.t=u.t-q;
      enqueue(u);
      elaps+=q;
    }
    else{
      printf("%s %d\n",u.name,u.t+elaps);
      elaps+=u.t;
    }
  }
   
  return 0;
}
void initialize(void){
  head=0;
  tail=0;
}
  
 
void enqueue(P x){
  
    Q[tail]=x;
    if(tail+1==LEN)
      tail=0;
    else
      tail++;
 
}
P dequeue(void){
  P x;
   
    x=Q[head];
    if(head+1==LEN)
      head=0;
    else
      head++;
 
  return x;
}

Measured memory_bytes: 12888
#include <iostream>
#include <map>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <sstream>
#include <cmath>
#include <math.h>
#include <string>
using namespace std;
typedef long long ll;
#define rep(n) for( int i = 0 ; i < n ; i++ )
#define REP(n) for( int i = 1 ; i <= n ; i++ )
#define repll(n) for( ll i = 0 ; i < n ; i++ )
#define REPll(n) for( ll i = 1 ; i <= n ; i++ )
#define rep2(n) for( int j = 0 ; j < n ; j++ )
#define REP2(n) for( int j = 1 ; j <= n ; j++ )
#define repll2(n) for( ll j = 0 ; j < n ; j++ )
#define REPll2(n) for( ll j = 1 ; j <= n ; j++ )

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int a, b;
  	cin >> a >> b;
  	if( a % b == 0 ) cout << 0;
    else cout << 1;
}


Measured memory_bytes: 3600
#include <stdio.h>
#include <math.h>

int main(){
	int n,i;
	double xa,ya,ra,xb,yb,rb,d;
	scanf("%d",&n);
	for(i = 0;i < n;i++){
		scanf("%lf %lf %lf %lf %lf %lf",&xa,&ya,&ra,&xb,&yb,&rb);
		d = sqrt((xb - xa) * (xb - xa) + (yb - ya) * (yb - ya));
		if(d + rb < ra) printf("2\n");
		else if(d + ra < rb) printf("-2\n");
		else if(d > ra + rb) printf("0\n");
		else printf("1\n");
	}
	return 0;
}

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

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

    string s[N], check[N], word;

    vector <string> vector;
    cin >> word;

    for (int i = 1; i < N; ++i)
    {
        vector.push_back(word);
        cin >> word;
    }
    vector.push_back(word);

    sort(vector.begin(),vector.end());

    int count=0,j=0;

    check[0] = vector.at(0);
    count++;

    for (int i = 1; i < N; ++i)
    {
        if(vector.at(i) != check[count-1]){
            check[count] = vector.at(i);
            count++;
        }
    }
    std::cout << count << std::endl;

    
    return 0;
}

Measured memory_bytes: 24104
#include"bits/stdc++.h"

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define REP(i, n) for (int i = 1; i <= (int)(n); i++)
#define all(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using pi = pair<int, int>;
const ll INF = 1LL << 60;

int main() {
    int n, a, res = 1, exep = 0;
    cin >> n;
    rep(i, n) {
        cin >> a;
        if (a % 2 == 0)res *= 2;
    }
    cout << pow(3, n) - res << endl;
    return 0;

}


Measured memory_bytes: 4092
#include<bits/stdc++.h>
using namespace std;
#define INF 1e9
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
const int MOD = 1000000007;

void solve() {
  int n; 
  cin >> n;
  vi v(n);
  rep(i,n) cin >> v[i];
  int ans = 0;
  int prev = 0;
  rep(i,n) {
    if (prev <= v[i]) ans += (v[i] - prev);
    prev = v[i];
  }
  cout << ans << endl;
}

int main() {
  solve();
  return 0;
}

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

int main() {
  string s;
  bool flag = false;
  flag = false;
  cin >> s;
  for (int i = 0; i < 3; i++) {
    if (s.at(i) == s.at(i + 1)) {
      flag = true;
    }
  }
  if (flag){
    cout <<"Bad"<<endl;
  }
  else {
    cout << "Good" << endl;
  }
}



Measured memory_bytes: 256
lst = [True for i in range(52)]
n = int(input())
for i in range (n):
    suit, rank = input().split()
    rankn = int(rank)
    if suit == 'S':
        lst[rankn-1] = False
    elif suit == 'H':
        lst[rankn+12] = False
    elif suit == 'C':
        lst[rankn+25] = False
    else:
        lst[rankn+38] = False
for i in range(52):
    tf = lst[i]
    if i <= 12 and tf:
        print ('S %d' % (i+1))
    elif 12 < i <= 25 and tf:
        print ('H %d' % (i-12))
    elif 25 < i <= 38 and tf:
        print ('C %d' % (i-25))
    elif tf:
        print ('D %d' % (i-38))






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

typedef long long ll;

ll n,k;
ll w[100001];

bool C( int p ) {
  ll sum = 0;
  ll cnt = 0;

  for ( ll i = 0; i < n; i++ ) {
    sum += w[i];
    while ( sum > p ) {
      sum = w[i];
      cnt++;
      if ( cnt == k )return false;
    }
  }
  return true;
}

int main() {
  cin >> n >> k;
  for ( ll i = 0; i < n; i++ ) cin >> w[i];
  ll lb = 0,ub = 1000000000;
  for ( int i = 0; i < 1000; i++ ) {
    ll mid = (lb + ub) / 2;
    if (C(mid)) ub = mid;
    else lb = mid;
  }

  cout << ub << endl;
  return 0;
}

Measured memory_bytes: 1936
import sys

def solve():
    input = sys.stdin.readline
    N = int(input())
    A = [int(a) for a in input().split()]
    aDict = dict()
    for i, a in enumerate(A):
        if a in aDict: aDict[a] += 1
        else: aDict[a] = 1
    indivisual = dict()
    total = 0
    for key in aDict:
        n = aDict[key]
        total += n * (n - 1) // 2
        indivisual[key] = n * (n - 1) // 2
    for i, a in enumerate(A):
        ans = total - indivisual[a]
        n = aDict[a]
        ans += (n-1) * (n-2) // 2
        print(ans)


    return 0

if __name__ == "__main__":
    solve()

Measured memory_bytes: 31936
#include<iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int main(){
	string O, E;
	cin >> O >> E;
	int l = O.size() + E.size();

	for(int i=0;i<l;i++){
		if(i%2==0) cout << O[i/2];
		else cout << E[i/2];
	}
	cout <<endl;
	return 0;
}


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

using namespace std;

struct dice {
public:
    int soko;
    int r;
    int oku;
    dice(int soko,int r,int oku):soko(soko),r(r),oku(oku) {}

    dice rotr(){
        return dice(r,7-soko,oku);
    }

    dice rotd(){
        return dice(7-oku,r,soko);
    }

    dice rotl() {
        return dice(7-r,soko,oku);
    }

    dice rotu(){
        return dice(oku,r,7-soko);
    }


};
bool operator< (dice a,dice b){
    return true;
}

int main() {
    int h,w;
    cin>>h>>w;
    vector<string> mp(h);
    for(int i = 0;i < h;++i) {
        cin>>mp[i];
    }
    queue<pair<pair<int,int>,dice>> q;
    q.push(make_pair(make_pair(0,0),dice(6,3,5)));
    bool ok=false;
    vector<vector<bool>> visited(h,vector<bool>(w,false));
    while(!q.empty()){
        auto t=q.front();
        int y=t.first.first;
        int x=t.first.second;
    //cerr<<"y:"<<y<<" x:"<<x<<endl;
        auto d=t.second;
        q.pop();
        if(y==h-1&&x==w-1){
            ok=true;
            break;
        }
//cerr<<d.rotr().soko<<endl;

        if(x+1<w&&!visited[y][x+1]&&mp[y][x+1]!='#'&&d.rotr().soko+'0'==mp[y][x+1]){
            q.push(make_pair(make_pair(y,x+1),d.rotr()));
            visited[y][x+1]=true;
        }
        if(y+1<h&&!visited[y+1][x]&&mp[y+1][x]!='#'&&d.rotd().soko+'0'==mp[y+1][x]){
            q.push(make_pair(make_pair(y+1,x),d.rotd()));
            visited[y+1][x]=true;
        }
        if(x-1>=0&&!visited[y][x-1]&&mp[y][x-1]!='#'&&d.rotl().soko+'0'==mp[y][x-1]){
            q.push(make_pair(make_pair(y,x-1),d.rotl()));
            visited[y][x-1]=true;
        }
        if(y-1>=0&&!visited[y-1][x]&&mp[y-1][x]!='#'&&d.rotu().soko+'0'==mp[y-1][x]){
            q.push(make_pair(make_pair(y-1,x),d.rotu()));
            visited[y-1][x]=true;
        }
    }
    if(ok)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}



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

int main(){
    int a, b, c, t;
    cin >> a >> b >>c;
    
    //a = (a < b)?a:b;
    //b = (a < b)?b:a;
    //b = (b < c)?b:c;
    //c = (b < c)?c:b;
    //a = (a < b)?a:b;
    //b = (a < b)?b:a;
    
    
    if (a > b) t = a, a = b, b = t;
    if (b > c) t = b, b = c, c = t;
    if (a > b) t = a, a = b, b = t;
    
    
    cout << a << " " << b << " " << c << endl;

    return 0;
    
    
}

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

int main()
{
	int N;
	cin >> N;
	vector<int>V(N+1);
	vector<int>C(N+1);
	for (int i = 1; i <=N ; i++)
	{
		cin >> V[i];
	}
	for (int i = 1; i <= N; i++)
	{
		cin >> C[i];
	}
	int ans = 0;
	for (int i = 1; i <= N; i++)
	{
		if (V[i]-C[i]>0)
		{
			ans += V[i] - C[i];
		}
	}
	cout<<ans << endl;
	return 0;
}

Measured memory_bytes: 256
/*
このコード、と～おれ!
Be accepted!
∧＿∧　
（｡･ω･｡)つ━☆・*。
⊂　　 ノ 　　　・゜+.
　しーＪ　　　°。+ *´¨)
 　　　　　　　　　.· ´¸.·*´¨) ¸.·*¨)
		  　　　　　　　　　　(¸.·´ (¸.·'* ☆
					*/

#include <stdio.h>
#include <algorithm>
#include <string>
#include <cmath>
#include <cstring>
#include <vector>
#include <numeric>
#include <iostream>
#include <random>
#include <map>
#include <unordered_map>
#include <queue>
#include <regex>

#pragma GCC optimize("Ofast")
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define rep1(i, n) for(int i = 1; i <= (n); ++i)
#define rep2(i, n) for(int i = 2; i < (n); ++i)
#define repr(i, n) for(int i = n; i >= 0; --i)
#define reprm(i, n) for(int i = n - 1; i >= 0; --i)
#define printynl(a) printf(a ? "yes\n" : "no\n")
#define printyn(a) printf(a ? "Yes\n" : "No\n")
#define printYN(a) printf(a ? "YES\n" : "NO\n")
#define printin(a) printf(a ? "possible\n" : "inposible\n")
#define printdb(a) printf("%.50lf\n", a)//少数出力
#define printdbd(a) printf("%.16lf\n", a)//少数出力(桁少なめ)
#define prints(s) printf("%s\n", s.c_str())//string出力
#define all(x) (x).begin(), (x).end()
#define allsum(a, b, c) ((a + b) * c / 2)//等差数列の和、初項,末項,項数
#define pb push_back
#define priq priority_queue
#define rpriq priq<int, vector<int>, greater<int>>
#define deg_to_rad(deg) (((deg)/360.0)*2.0*PI)
#define rad_to_deg(rad) (((rad)/2.0/PI)*360.0)
#define Please return
#define AC 0

using ll = long long;

constexpr int INF = 1073741823;
constexpr int MINF = -1073741823;
constexpr ll LINF = ll(4661686018427387903);
constexpr ll MOD = 1000000007;
const double PI = acos(-1);

using namespace std;

void scans(string& str) {
	char c;
	str = "";
	scanf("%c", &c);
	if (c == '\n')scanf("%c", &c);//最初の改行対策
	while (c != '\n' && c != -1) {
		str += c;
		scanf("%c", &c);
	}
}

void scanc(char& str) {
	char c;
	scanf("%c", &c);
	if (c == -1)return;
	while (c == '\n') {
		scanf("%c", &c);
	}
	str = c;
}

double acot(double x) {
	return PI / 2 - atan(x);
}

/*-----------------------------------------ここからコード-----------------------------------------*/


int main() {
	
	int a, b;
	scanf("%d%d", &a, &b);
	printYN((a + 1) / 2 >= b);
	
	Please AC;
}


Measured memory_bytes: 256
// Example program

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

int main() {
   int n,k;
   cin >> n >> k;
   map<int,int> ok;
   for(int i = 0; i < n; i++) {
        int x;
        cin >> x;
        if(ok.find(x) == ok.end()) ok[x] = 0;
        ok[x]++;
    }
    int size = ok.size();
    if(size <= k) {
        cout << 0 << endl;    
    } else {
        vector<int> nums;
        for(auto it = ok.begin(); it != ok.end(); it++) {

            nums.push_back(it->second);
        }
        int need = size-k;
        sort(nums.begin(), nums.end());
        int cnt =  0;
        for(int i = 0; i < need; i++) {
            cnt += nums[i];    
        }
        cout << cnt << endl;
    }
}


Measured memory_bytes: 10748
#include <stdio.h>
void dump_arr (int arr[], int len) {
  for (int i = 0; i < len; i++) {
    printf("[%d] = %d\n", i, arr[i]);
  }
}

#define min(a, b) ((a) < (b)) ? (a) : (b)
#define max(a, b) ((a) > (b)) ? (a) : (b)

int main(int argc, const char *argv[])
{
  int n, k;
  char s[100001];
  int m[100002], mc = 0;
  int sum_m[100003];
  scanf("%d%d%s", &n, &k, s);

  char cur, last_cur;
  int count = 0;
  cur = s[0];
  last_cur = s[0];
  if (s[0] == '0') {
    m[mc++] = 0;
  }
  for (int i = 1; i <= n; i++) {
    cur = s[i];
    count++;
    if (cur != last_cur){
      m[mc++] = count;
      count = 0;
    }
    last_cur = cur;
  }
  // Array must be odd number like 1...1
  if (mc % 2 == 0)
    m[mc++] = 0;

  // 累積和
  sum_m[0] = 0;
  for (int i = 0; i < mc; i++) {
    sum_m[i+1] = sum_m[i] + m[i];
  }
  // dump_arr(sum_m, mc);

  int tmp_sum = 0, max_sum = 0;
  // 0, 2, 4 ... even number is zero
  for (int a = 0; a < mc; a += 2) {
    int right = a + k * 2 + 1;
    int left = a;
    if ( right > mc )
      right = mc;
    // printf("[%d] - [%d]\n", right, left);
    tmp_sum = sum_m[right] - sum_m[left];
    max_sum = max(max_sum, tmp_sum);
  }
  printf("%d\n", max_sum);
  // dump_arr(m, mc);
  return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
using namespace std;
#define rep(i,n) for (int i = 0; i < (n); ++i)
typedef pair<int, int> P;
typedef long long ll;
const int INF = 1001001001;
const ll LINF = 1001002003004005006ll;
const ll MOD = 1e9+7;

int main() {
	int n;
	cin >> n;
    vector<int> h(n);
    rep(i, n) {
        cin >> h[i];
    }
    int ans = 0, tmp = 0;
    rep(i, n-1) {
        if (h[i] >= h[i+1]) {
            ++tmp;
        } else {
            ans = max(ans, tmp);
            tmp = 0;
        }
    }
    ans = max(ans, tmp);
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 640
#include<iostream>
#include<algorithm>
#include<math.h>
#include<vector>
#include<map>
#include<set>

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, a, n) for (int i = a; i <= (n); ++i)

using namespace std;
using ll = long long;

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

    if (N == M) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
int main(){
 
    int n;
    scanf("%d", &n);
    int n3=n%10, n1=n/100;
    if(n1==n3)
        printf("%s","Yes");
    else
        printf("%s","No");
 return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<bits/stdc++.h>
using namespace std;
int gcd(int a,int b)
{
    if(b==0){
        return a;
    }
    return gcd(b,a%b);
}
int main()
{
    long long int a,b,c,d,num1,num2,num3,num;
    cin>>a>>b>>c>>d;
    num=b-a+1;
    long long int lcd=(c*d)/gcd(c,d);
    if(a%c==0){
        num1=(b/c)-(a-1)/c;
    }
    else{
         num1=(b/c)-(a/c);
    }
    if(a%d==0){
        num2=(b/d)-(a-1)/d;
    }
    else{
         num2=(b/d)-(a/d);
    }
    if(a%lcd==0){
        num3=(b/lcd)-(a-1)/lcd;
    }
    else{
         num3=(b/lcd)-(a/lcd);
    }

   cout<<(num-num1-num2+num3);
}




Measured memory_bytes: 256
import java.util.Scanner;
public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = a / 3600;
        int c = (a-b*3600) / 60;
        int d = a-b*3600-c*60;
        System.out.println(b+":"+c+":"+d);
    }
}


Measured memory_bytes: 26260
K, N = map(int, input().split())
l = list(map(int, input().split()))

l.append(K+l[0])
l.insert(0, 0)

lsub = list()
for i in range (1, N+2):
    lsub.append(l[i] - l[i-1])

print(K - max(lsub))

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

using namespace std;

int main(){
   int N,A,B;
   cin >> N >> A>> B;
   cout << min(A*N,B) << endl;
   return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) begin(x),end(x)
typedef long long ll;
int OO = 0x3f3f3f3f;

int n, m, u, v;
vector<int> adj[100005];
bool src[100005];

int mem[100005];

int dps(int x)
{
    if(mem[x])
        return mem[x];

    for(int k : adj[x])
    {
        mem[x] = max(mem[x], dps(k)+1);
    }
    return mem[x];
}

int main()
{
    cin >> n >> m;
    for(int i = 0; i< m ; i++)
    {
        cin >> u >> v;
        adj[u].push_back(v);
    }
    int mx = 0;
    memset(mem, 0 ,sizeof mem);
    for(int i = 1 ; i <= n; i++)
    {
        mx = max(mx, dps(i));
    }
    cout << mx << endl;
    return 0;
}


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

signed main() {
    int N;
    cin >> N;
    vector<int> A(N);
    vector<int> B(N);
    vector<int> C(N);
    for(int i = 0;i < N;i++) {
      	int a,b,c;
        cin >> a >> b >> c;
        A.at(i) = a;
        B.at(i) = b;
        C.at(i) = c;
    }
    int dp[100010][3];
  	dp[0][0] = A.at(0);
  	dp[0][1] = B.at(0);
  	dp[0][2] = C.at(0);
    for(int i = 1;i < N;i++) {
        dp[i][0] = max(dp[i - 1][1] + A.at(i),dp[i - 1][2] + A.at(i));
        dp[i][1] = max(dp[i - 1][0] + B.at(i),dp[i - 1][2] + B.at(i));
        dp[i][2] = max(dp[i - 1][0] + C.at(i),dp[i - 1][1] + C.at(i));
    }
    cout << max(dp[N - 1][0],max(dp[N - 1][1],dp[N - 1][2])) << endl;
}

Measured memory_bytes: 2560
N = int(input())
ac, wa, tle, re = 0, 0, 0, 0

for i in range(N):
    s = input()
    if s == "AC":
        ac += 1
    elif s == "WA":
        wa += 1
    elif s == "TLE":
        tle += 1
    elif s == "RE":
        re += 1

print("AC x "+str(ac))
print("WA x "+str(wa))
print("TLE x "+str(tle))
print("RE x "+str(re))

Measured memory_bytes: 9144
var input = require('fs').readFileSync('/dev/stdin', 'utf8');
var [a, b, c] = input.trim().split(" ").map(Number);
var time = Math.ceil(c/a)
        var sum = 0
        while(time > 6){
            
            sum = sum + 7
            c = c-(b+7*a)
            time = Math.ceil(c/a)
        }
        
console.log(sum + (time > 0 ? time: 0))



Measured memory_bytes: 16880
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

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

    ll n;
    cin >> n;

    vector<P> p;
    ll x, y;
    REP(i, n){
        cin >> x >> y;
        p.push_back(P{x, y});
    }
    VSORT(p);
    map<P, ll> mp;
    REP(i, n){
        REP(j, n){
            if(j <= i) continue;
            ll dx = p[j].first - p[i].first;
            ll dy = p[j].second - p[i].second;
            mp[P(dx, dy)]++;
        }
    }
    ll res = 0;
    for(auto v : mp){
        res = max(res, v.second);
    }
    res = n - res;
    cout << res << endl;
    return 0;
}

Measured memory_bytes: 384
import java.util.*;

public class Main {
	static final long MOD = 1000000007;

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		long n = sc.nextLong();
		long k = sc.nextLong();
		if(k>=n)
			k = n-1;
		
		long ans = 1;
		long comb0 = 1;
		long comb1 = 1;
		for(int i=1; i<=k; i++) {
			comb0 = (comb0*(n-i+1)) % MOD;
			comb0 = (comb0*rev(i)) % MOD;
			comb1 = (comb1*(n-i)) % MOD;
			comb1 = (comb1*rev(i)) % MOD;
			ans = (ans + comb0 * comb1) % MOD;
//			ans = (ans + comb(n, i) * comb(n-1, i)) % MOD;
		}
		
		System.out.println(ans);
		sc.close();
	}
	
	static long pow(long a, long b) {
		long ans = 1;
		while(b>0) {
			if((b&1)!=0)
				ans = (ans * a)%MOD;
			b>>=1;
			a = (a*a)%MOD;
		}
		return ans;
	}
	
	static long rev(long a) {
		return pow(a, MOD-2);
	}

	static long comb(long a, long b) {
		long ans = 1;
		for(long i=0; i<b; i++) {
			ans = (ans * (a-i)) % MOD;
			ans = (ans * rev(i+1)) % MOD;
		}
		
		return ans;
	}

}



Measured memory_bytes: 21972
import java.awt.Point;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;
import java.io.IOException;
import java.util.Scanner;

public class Main {
	
	static int n;
	
	static int[] arr;
	
	public static void main(String[] args) throws NumberFormatException, IOException {
		
		//BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		
		Scanner in = new Scanner(System.in);
		
		
		int n = in.nextInt();
		
		int e = in.nextInt();
		
		int[] to = new int[n];
		int[] exit = new int[n];

		for(int i=0; i<e; i++) {
			
			
			int x = in.nextInt()-1;
			int y = in.nextInt()-1;
			
			if(x > y) {
				int temp = x;
				x = y;
				y = temp;
			}
			
			if(x == 0) {
				to[y] = 1;
			}
			
			if(y == n-1) {
				exit[x] = 1;
			}
		}
		
		for(int i=1; i<n-1; i++) {
			if(to[i] ==1 && exit[i] == 1) {
				System.out.println("POSSIBLE");
				return;
			}
		}
		
		System.out.println("IMPOSSIBLE");

		
		
	}
	
}



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


long long A[1000];
int main(){
	long long n,ans=0;
	cin >> n;
	for(int i=0;i<n;i++){
		cin >> A[i];
	}
	
	for(int i=0;i<n;i++){
		for(int j=i+1;j<n;j++){
			ans+=A[i]*A[j];
		}
	}
	
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
#include <algorithm>
#include <vector>
using namespace std;
#define N (500010)
typedef long long LL;
#define PB push_back
char s[N];
int f[N][3];
int n;
int main(){
    scanf("%d", &n);
    scanf("%s", s+1);
    int ans = 0;
    s[n+1] = s[n+2] = s[0] = s[n+3] = '0';
    for (int i = 1, c1 = 0, last = 0; i <= n+2; ++i){
        if (s[i] == '0'){
            if (s[i-1] == '1'){
                //printf("%d %d\n", last, i);
                if (!last || s[last-1] == '0'){
                    if (s[last+1] == '1') f[i][1] = c1;
                }
                else {
                    f[i][0] = max(f[last][0], max(f[last][1],f[last][2]+c1));
                    f[i][1] = max(f[last][0]+c1, f[last][1]+c1-1);
                    f[i][2] = max(f[last][0], f[last][2]+c1-1);
                    if (c1 > 1){
                        f[i][2] = max(f[last][1], f[i][2]);
                        //f[i][1] = max(f[last][2], );
                    }
                }
            }
            else if (s[i-1] == '0'){
                ans += f[i-1][0];
            }
            c1 = 0;
            last = i;
            //printf("%d %d %d %d\n", i, f[i][0], f[i][1], f[i][2]);
        }
        else {
            c1++;
        }
    }
    printf("%d\n", ans);
}

Measured memory_bytes: 6528
object Main {
  def main(args: Array[String]): Unit = {
    solve
  }

  def solve(): Unit = {
    val sc = new java.util.Scanner(System.in)
    val n, c, k = sc.nextInt
    var list = Array.fill(n)(sc.nextInt).sorted

    var count = 1
    var g = list(0) + k
    var num = 1
    for(t <- list.tail) {
      if(t > g || num == c) {
        count += 1
        num = 1
        g = t + k
      }else{
        num += 1
      }
    }

    println(count)
  }
}


Measured memory_bytes: 58796
s = str(input())
y = int(s[0:4])
if int(s[5]) == 0:
    m = int(s[6])
else:
    m = int(s[5:7])
if int(s[8]) == 0:
    d = int(s[9])
else:
    d = int(s[8:10])
if y < 2019:
    print('Heisei')
elif y == 2019 and m not in [1,2,3,4]:
    print('TBD')
else:
    print('Heisei')

Measured memory_bytes: 3064
###############################################################################

from sys import stdout
from bisect import bisect_left as binl
from copy import copy, deepcopy

def intin():
    input_tuple = input().split()
    if len(input_tuple) <= 1:
        return int(input_tuple[0])
    return tuple(map(int, input_tuple))


def intina():
    return [int(i) for i in input().split()]


def intinl(count):
    return [intin() for _ in range(count)]


def modadd(x, y):
    global mod
    return (x + y) % mod


def modmlt(x, y):
    global mod
    return (x * y) % mod


def lcm(x, y):
    while y != 0:
        z = x % y
        x = y
        y = z
    return x


def get_divisors(x):
    retlist = []
    for i in range(1, int(x**0.5) + 3):
        if x % i == 0:
            retlist.append(i)
            retlist.append(x // i)
    return retlist


def make_linklist(xylist):
    linklist = {}
    for a, b in xylist:
        linklist.setdefault(a, [])
        linklist.setdefault(b, [])
        linklist[a].append(b)
        linklist[b].append(a)
    return linklist


def calc_longest_distance(linklist, v=1):
    distance_list = {}
    distance_count = 0
    distance = 0
    vlist_previous = []
    vlist = [v]
    nodecount = len(linklist)

    while distance_count < nodecount:
        vlist_next = []
        for v in vlist:
            distance_list[v] = distance
            distance_count += 1
            vlist_next.extend(linklist[v])
        distance += 1
        vlist_to_del = vlist_previous
        vlist_previous = vlist
        vlist = list(set(vlist_next) - set(vlist_to_del))

    max_distance = -1
    max_v = None
    for v, distance in distance_list.items():
        if distance > max_distance:
            max_distance = distance
            max_v = v

    return (max_distance, max_v)


def calc_tree_diameter(linklist, v=1):
    _, u = calc_longest_distance(linklist, v)
    distance, _ = calc_longest_distance(linklist, u)
    return distance


###############################################################################


def main():
    a, b, c = intin()

    abc = [a, b, c]
    abc.sort()

    print(abc[2] * 10 + abc[1] + abc[0])


if __name__ == '__main__':
    main()


Measured memory_bytes: 3540
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
#define rep(i, n) for(int i=0;i<(int)n;i++)
#define PI acos(-1)
#define fast_io ios_base::sync_with_stdio(false) ; cin.tie(0); cout.tie(0);
ll mod=1e9+7;

int main(){
    fast_io

    string s;
    cin>>s;

    if(s[0]==s[1] && s[1]==s[2]){
        cout<<"No"<<endl;
    }else{
        cout<<"Yes"<<endl;
    }

    return 0;
}

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

void print(int h, int w) {
  for (int ia=0; ia<w; ia++) { // ヘッダー
    cout << "#";
  }
  cout << endl;
  for (int ib=0; ib<(h-2); ib++) {
    cout << "#";
    for (int iba=0; iba<(w-2); iba++) {
      cout << ".";
    }
    cout << "#" << endl;
  }
  for (int ic=0; ic<w; ic++) { // フッター
    cout << "#";
  }
  cout << endl;
}

int main() {
  while (true) {
    int H, W;
    cin >> H >> W;
    if (H!=0 && W!=0) {
      print(H, W);
      cout << endl;
    } else {
      break;
    }
  }
}



Measured memory_bytes: 3092
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<string>
 
using namespace std;
 
int main() {
	string s;
	cin >> s;
	for (int i = 0; i < 5; i++)cout << s[i];
	cout << " ";
	for (int i = 6; i < 13; i++)cout << s[i];
	cout << " ";
	for (int i = 14; i < 19; i++)cout << s[i];
	cout << endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <set>
#include <string>
#include <vector>
#define SORT(a) sort((a).begin(), (a).end())
#define RSORT(a) sort((a).rbegin(), (a).rend())
#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(a) a.begin(), a.end()
using namespace std;

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

    int h, w;
    cin >> h >> w;

    vector<string> s(h);
    REP(i, h) cin >> s[i];

    vector<bool> row(h, false);
    vector<bool> col(w, false);
    REP(i, h) {
        REP(j, w) {
            if (s[i][j] == '#') {
                row[i] = true;
                col[j] = true;
            }
        }
    }

    REP(i, h) {
        if (row[i]) {
            REP(j, w) {
                if (col[j]) {
                    cout << s[i][j];
                }
            }
            cout << endl;
        }
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<vector>
#include<algorithm>
#include<cstring>
#include<string>
#include <set>
#include <cassert>
#include<cmath>
#include<climits>
using namespace std;
#define MOD 1000000007
class UnionFind {
	vector<int> data;
public:
	UnionFind(int size) : data(size, -1) { }
	bool unionSet(int x, int y) {
		x = root(x); y = root(y);
		if (x != y) {
			if (data[y] < data[x]) swap(x, y);
			data[x] += data[y]; data[y] = x;
		}
		return x != y;
	}
	bool findSet(int x, int y) {
		return root(x) == root(y);
	}
	int root(int x) {
		return data[x] < 0 ? x : data[x] = root(data[x]);
	}
	int size(int x) {
		return -data[root(x)];
	}
};


int find(vector<long long> &arr, long long obj) {
	if (arr[arr.size() - 1] < obj)return arr.size()-1;
	if (arr[0] > obj)return -1;

	int min = 0; int max = arr.size() - 1;
	for (int i = 0; i < arr.size(); i++) {
		if (arr[min+(max-min) / 2] > obj) {
			max = min + (max - min) / 2;
		}
		else {
			min = min + (max - min) / 2;
		}
		if (max - min == 1) {
			return min;
		}
	}


}


int main() {
	string s;
	cin >> s;
	int min = INT_MAX;
	for (int i = 0; i < s.size() - 2; i++) {
		char temp[3];
		temp[0] = s[i]; temp[1] = s[i + 1]; temp[2] = s[i + 2];
		int ans = stoi(temp);
		if (abs(753 - ans) < min)min = abs(753 - ans);
	}
	cout << min;


	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#define db(x) (cerr << #x << ": " << (x) << '\n')
#define cps CLOCKS_PER_SEC
#define tests(t) int t; cin >> t; while(t--)
#define iceil(n, x) (((n) + (x) - 1) / (x))
#define ll long long
#define ld double
#define eb emplace_back
#define pb push_back
#define pf push_front
#define pob pop_back
#define pof pop_front
#define sz size()
#define all(v) (v).begin(), (v).end()
#define uni(v) sort(all(v)), (v).erase(unique(all(v)), (v).end())
#define fi first
#define se second
#define bitcount(x) __builtin_popcount(x)
#define PI acos(-1.0)
#define EPS 1e-9
#define mod 1000000007
#define bit(x) (1 << x)
#define par pair<int,int>
#define maxn 1005

using namespace std;
///All indexing is 0-based
using namespace __gnu_pbds;
template<class key, class cmp = std::less<key>>
using ordered_set = tree<key, null_type, cmp, rb_tree_tag, tree_order_statistics_node_update>;
///methods: find_by_order(k); & order_of_key(k);
///To make it an ordered_multiset, use pairs of (value, time_of_insertion)
///to distinguish values which are similar

int N,M,K,sol=1<<30,T[11][maxn];
char A[11][maxn];
vector<int> v;

int calc()
{
    int cant[11],cont=0,f1,f2;
    fill(cant,cant+N+1,0);
    for(int i=1;i<=M;i++){
        for(int j=0;j<(int)v.size()-1;j++)              {
            f1 = v[j]+1,f2 = v[j+1];
            if(cant[j] + T[f2][i] - T[f1-1][i] > K ){
                cont++ ;
                for(int k=0;k < (int)v.size()-1;k++) {
                    f1 = v[k]+1,f2 = v[k+1];
                    cant[k] = T[f2][i] - T[f1-1][i];
                    if(cant[k]>K)
                        return -1;
                }
               break;
            }
            else
                cant[j] += T[f2][i] - T[f1-1][i];
        }
    }

    return cont;
}

int main()
{
    #ifdef acm
    freopen("a.in","r",stdin);
    #endif // acm
    ios_base::sync_with_stdio(0);
    cin.tie(0);

    cin >> N >> M >> K;

    for(int i=1;i<=N;i++){
        cin >> (A[i]+1);
        for(int j=1;j<=M;j++)
            T[i][j] = T[i-1][j]+(A[i][j]=='1');
    }


    for(int i=0;i<(1 << (N-1));i++){
        int a,b=0;
        v.pb(0);
        for(int j=0;j<N-1;j++)
            if(bit(j) & i)
                v.pb(j+1) , b++;
        v.pb(N);

        a = calc();
        v.clear();
        if(a!=-1)
            sol = min(sol,a + b);
    }

    cout << sol << "\n";


}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define all(x) (x).begin(),(x).end()
const int mod=998244353,MAX=1<<18;
const ll INF=1LL<<50;

int main(){
    
    double x1,y1,x2,y2,x3,y3;cin>>x1>>y1>>x2>>y2>>x3>>y3;
    double a,b,c,d;
    a=hypot(x2-x1,y2-y1);b=hypot(x3-x2,y3-y2);c=hypot(x3-x1,y3-y1);d=(a+b+c)/2.0;
    if(a>b) swap(a,b);
    if(b>c) swap(b,c);
    if(a>b) swap(a,b);
    
    double S=sqrt(d*(d-a)*(d-b)*(d-c));
    double h=S*2.0/c;
    
    cout<<setprecision(25)<<S*2.0/(a+b+c+h*2.0)<<endl;
}


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

int main()
{
    string s;
    cin>>s;

    int i,j,flag;
    for(i=s.length()-1;i>=0;i--)
    {
        flag=0;
        if(i%2!=0)
        {
            int mid=(i+1)/2;
            string b="",c="";

            for(j=0;j<mid;j++)
                b=b+s[j];

            for(j=mid;j<i+1;j++)
                c=c+s[j];

            if(b==c)
                flag=1;
        }
        if(i+1==s.length())
            flag=0;

        if(flag==1)
            break;
    }
    cout<<i+1<<endl;

    return 0;
}

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

using namespace std;



int n;
int a[216000];
int main(){
  cin >> n;
  for(int i = 0;i < n;i++)cin >> a[i];
  int p = n - 1;
  int k = -2;
  for(int i = 0;i < n;i++){
    cout << a[p] << " ";
    p += k;
    if(p == -1 && k == -2){
      p = 0;
      k = 2;
    }
    if(p == -2 && k == -2){
      p = 1;
      k = 2;
    }
  }cout << endl;
  
  return 0;
}

Measured memory_bytes: 2944
#define _USE_MATH_DEFINES
#include <iomanip>
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <tuple>
#include <climits>
#include <algorithm>
#include <cmath>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<double> VD;
typedef vector<LL> VLL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef vector<vector<bool>> VVB;
typedef vector<vector<double>> VVD;

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

const int MOD = 1000000007;

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

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

void debug(VVI &board){
	int h = board.size();
	int w = board.at(0).size();
	rep(i,h){
		rep(j,w){
			cout << board.at(i).at(j) << " ";
		}
		cout<<endl;
	}
}

int main(){
	string s,t;
	cin>>s>>t;
	int cnt=0;
	for(int i=0;i<3;i++){
		if(s.at(i)==t.at(i))cnt++;
	}
	cout<<cnt<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <atcoder/dsu>
#include <bits/stdc++.h>
using namespace std;
///////////////////////////////////////////
const long long int INF = 1LL<<60;
const long long int Mod = 1000000007;
using ll = long long int; using ci = const int;
using vi = vector<int>;  using Vi = vector<long long int>;
using P = pair<int, int>;  using PLL = pair<ll, ll>;
using matrix = vector<vector<ll>>;
#define pb(x) push_back(x)
#define mp(x,y) make_pair(x,y)
#define all(x) (x).begin(),(x).end()
#define rp(i,N) for(ll i = 0; i < (ll)N; i++)
#define repi(i,a,b) for(ll i = ll(a); i < ll(b); ++i)
template<class T>bool chmax(T &former, const T &b) { if (former<b) { former=b; return true; } return false; }
template<class T>bool chmin(T &former, const T &b) { if (b<former) { former=b; return true; } return false; }
template<class T>T sqar(T x){ return x*x; }//sqrt(x)は平方根;
#define Sort(v) std::sort(v.begin(), v.end(), std::greater<decltype(v[0])>()) //降順でVをソート
#define p_queue(v) priority_queue<v, vector<v>, greater<v> >
template<class T> inline void princ(T x){cout<<x<<" ";}; 
template<class T> inline void print(T x){cout<<x<<"\n";};
template<class T> inline void Yes(T condition){ if(condition) cout << "Yes" << endl; else cout << "No" << endl; }
template<class T> inline void YES(T condition){ if(condition) cout << "YES" << endl; else cout << "NO" << endl; }
///////////////////////////////////////////////////////////////////////////////////

void solve(){
    ll n,q;
    cin >> n >> q;
    atcoder::dsu uf(n);
    while(q--){
        ll t,u,v;
        cin >> t >> u >> v;
        if(t==0){
            uf.merge(u,v);
        }else{
            if(uf.same(u,v)){
                print(1);
            }else{
                print(0);
            }
        }
    }
    return;
}
int main(){
    cin.tie(0);ios::sync_with_stdio(false);
    std::cout<<std::fixed<<std::setprecision(30);
    solve();
    return 0;
}

Measured memory_bytes: 3832
#include <algorithm>
#include <array>
#include <cmath>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <vector>
using namespace std;
#define int long long

signed main() {
    cin.tie(0);
    ios::sync_with_stdio(0);

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

    const bool ans =
        (c - a - b > 0) && ((c - a - b) * (c - a - b) > 4 * a * b);

    cout << (ans ? "Yes" : "No") << endl;
}


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

using namespace std;
typedef long long ll;
const int INF = 1e9;
const int MOD = 1e9 + 7;
const ll LINF = 1e18;

int main() {

    ll w, h, x, y; cin >> w >> h >> x >> y;

    ll m = 0;

    if (w == 2 * x && h == 2 * y) {
        m = 1;
    }

    cout << fixed << setprecision(10) << (double)(w * h) / 2.0 << ' ' << m << endl;
}

Measured memory_bytes: 256