akhauriyash/Code-Regression huggingface dataset:
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <string>
#define BIG 1000000000
#define BIGNUM 100000
#define SIZE 1000
using namespace std;

struct Node {
	int key;
	Node *prev, *next;
};

Node*nil;

void init() {
	nil = (Node*)malloc(sizeof(Node));
	nil->next = nil;
	nil->prev = nil;
}


void insert(int key) {
	Node *x = (Node*)malloc(sizeof(Node));
	x->key = key;
	x->next = nil->next;
	nil->next->prev = x;
	nil->next = x;
	x->prev = nil;
}

Node* listSearch(int key) {
	Node *cur = nil->next;
	while (cur != nil && cur->key != key) cur = cur->next;
	return cur;
}

void deleteNode(Node *t) {
	if (t == nil) {
		return;
	}
	t->prev->next = t->next;
	t->next->prev = t->prev;
	free(t);
}

void deleteFirst() {
	deleteNode(nil->next);
}

void deleteLast() {
	deleteNode(nil->prev);
}

void deleteKey(int key) {
	deleteNode(listSearch(key));
}

void show() {
	Node *cur = nil->next;
	while (cur != nil) {
		cout << cur->key;
		if (cur->next != nil) cout << ' ';
		cur = cur->next;
	}
	cout << "\n";
}

int main() {
	int n;
	int x;
	char cmd[15];
	scanf("%d",&n);
	init();
	for (int i = 0; i < n; i++){
		scanf("%s%d", cmd, &x);
		if (cmd[0] == 'i') {
			insert(x);
		}
		else if (cmd[0]=='d' && strlen(cmd)<=6) {
			deleteKey(x);
		}
		else if (cmd[6]=='F') {
			deleteFirst();
		}
		else if (cmd[6]=='L') {
			deleteLast();
		}
		else {
			cout << "Error\n";
			exit(1);
		}
	}
	show();
	return 0;
}

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

int main()
{
    double n,m,d,ans;
    cin>>n>>m>>d;
    if(d==0) ans=(m-1)/n;
    else ans=((n-d)*2*(m-1))/(n*n);
    printf("%.8lf\n",ans);

    return 0;
}

Measured memory_bytes: 256
use std::io::{self, Stdin};
use std::str::{self, FromStr};
use std::error::Error;

fn exec() {
    let mut sc = Scanner::new();
    let n: usize = sc.ne();
    let a: Vec<usize> = (0..n).map(|_| sc.ne()).collect();
    const N: usize = 10010;
    let mut dp = vec![false; 10010];
    dp[0] = true;
    for &x in &a {
        for j in (0..N - x).rev() {
            if dp[j] == false {
                continue;
            }
            dp[j + x] = true;
        }
    }
    let mut ans = 0;
    for i in 0..N {
        if dp[i] && i % 10 != 0 {
            ans = i;
        }
    }
    println!("{}", ans);
}

fn main() {
    const STACK: usize = 16 * 1024 * 1024;
    let _ = std::thread::Builder::new()
        .stack_size(STACK)
        .spawn(|| { exec(); })
        .unwrap()
        .join()
        .unwrap();
}

#[allow(dead_code)]
struct Scanner {
    stdin: Stdin,
    id: usize,
    buf: Vec<u8>,
}

#[allow(dead_code)]
impl Scanner {
    fn new() -> Scanner {
        Scanner {
            stdin: io::stdin(),
            id: 0,
            buf: Vec::new(),
        }
    }
    fn next_line(&mut self) -> Option<String> {
        let mut res = String::new();
        match self.stdin.read_line(&mut res) {
            Ok(0) => None,
            Ok(_) => Some(res),
            Err(why) => panic!("error in read_line: {}", why.description()),
        }
    }
    fn next<T: FromStr>(&mut self) -> Option<T> {
        while self.buf.len() == 0 {
            self.buf = match self.next_line() {
                Some(r) => {
                    self.id = 0;
                    r.trim().as_bytes().to_owned()
                }
                None => return None,
            };
        }
        let l = self.id;
        assert!(self.buf[l] != b' ');
        let n = self.buf.len();
        let mut r = l;
        while r < n && self.buf[r] != b' ' {
            r += 1;
        }
        let res = match str::from_utf8(&self.buf[l..r])
                  .ok()
                  .unwrap()
                  .parse::<T>() {
            Ok(s) => Some(s),
            Err(_) => {
                panic!("parse error, {:?}",
                       String::from_utf8(self.buf[l..r].to_owned()))
            }
        };
        while r < n && self.buf[r] == b' ' {
            r += 1;
        }
        if r == n {
            self.buf.clear();
        } else {
            self.id = r;
        }
        res
    }
    fn ne<T: FromStr>(&mut self) -> T {
        self.next::<T>().unwrap()
    }
}


Measured memory_bytes: 8572
#include <bits/stdc++.h>
#include <iostream>
#include <string>
using namespace std;
int sum=0;
int main() {
    int n;
    cin>>n;
    vector<int> a(n);
    for(int i=0;i<n;i++) cin>>a.at(i);
    while(true){
        bool ok=false;
        for(int i=0;i<n;i++){
            if(a.at(i)%2!=0) ok=true;
        }
        if(ok) break;
        for(int i=0;i<n;i++){
            a.at(i)/=2;
        }
        sum++;
    }
    cout<<sum<<endl;
}

Measured memory_bytes: 3632
#include <cstdio>
#include <functional>
#include <algorithm>
#include <vector>
#include <limits>
#include <numeric>
#include <type_traits>
#include <iostream>
#include <queue>
#include <math.h>
#include <bits/stdc++.h>
#include <queue>
#include <map>

using namespace std;

#define INF (1ll<<60)
#define INFint (1<<30)
#define MOD 1000000007
#define BOUND 27182818284

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

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

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

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

// gcd
template<typename T>
T gcd(T a, T b){
    if(a==0)
        return b;
    return gcd(b%a,a);
}

// gcd array
int findGCD(int arr[], int n){
    int result = arr[0];
    for (int i=1; i < n; i++)
        result = gcd(arr[i], result);
    return result;
}

template<typename T>
T lcm( T m, T n ){
    // 引数に0がある場合は0を返す
    if ( ( 0 == m ) || ( 0 == n ) )
        return 0;
    return ((m/gcd(m, n)) * n); // lcm = m * n / gcd(m,n)
}

template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    fill( (T*)array, (T*)(array+N), val );
}


int dx[5]={1,0,-1,0};
int dy[5]={0,1,0,-1};
// v.front() = -BOUND;
// v.back() = BOUND;

struct edge{
    int cost, to;

    edge(int in_cost, int in_to){
        cost=in_cost;
        to=in_to;
    }
    bool operator<(const edge &a) const
    {
        return cost > a.cost;
    }
};

vector<ll>A;
vector<ll>a;
int N,K;
void sum_part(){
    for(int i=0; i<N; i++){
        ll sum=0LL;
        for(int j=i; j<N; j++){
            sum+=a[j];
            A.push_back(sum);
        }
    }
}


bool isJudge(int shift){
    int cnt=0;
    vector<ll>temp;
    ll cp=(1LL<<shift);

    for(auto& x:A){
        if( (x&cp) != 0){
           temp.push_back(x);
           cnt++;
        }
    }

    if(cnt>=K){
        A.clear();

        for(auto& x:temp){
            A.push_back(x);
        }
        return true;
    }

    return false;
}
int main() {
    cin >> N >> K;
    ll ans=0LL;
    rep(i,N){
        ll x;
        cin >> x;
        a.push_back(x);
    }
    sum_part();

    int shift=40;
    while(shift>=0){
        if(isJudge(shift)){
            ans+=1LL<<shift;
        }
        shift--;
    }

    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 6524
#include <stdio.h>

int main(void) {
  int a,b;
  char op;
while(1){
  scanf("%d %c %d",&a,&op,&b);
  if(op=='+'){
    printf("%d\n",a+b);
  }
  if(op=='-'){
    printf("%d\n",a-b);
  }
  if(op=='*'){
    printf("%d\n",a*b);
  }
  if(op=='/'){
    printf("%d\n",a/b);
  }
  if(op=='?'){
    break;
  }
}
  return 0;
}


Measured memory_bytes: 2100
#include <functional>
#include <algorithm>
#include <iostream>
#include <numeric>
#include <iomanip>
#include <utility>
#include <cstdlib>
#include <sstream>
#include <bitset>
#include <vector>
#include <cstdio>
#include <ctime>
#include <queue>
#include <deque>
#include <cmath>
#include <stack>
#include <list>
#include <map>
#include <set>

using namespace std;

typedef vector<int> vi;
typedef pair<int,int> pii;
typedef long long ll;

#define dump(x)  cerr << #x << " = " << (x) << endl
#define rep(i,n) for(int i=0;i<(n);i++)
#define ALL(a)  (a).begin(),(a).end()
#define pb push_back
#define sz size()

const double EPS = 1e-10;
const int INF = 100000000;


int solve(int sx,int sy,int gx,int gy){
    int ret=0;
    if(sx<gx){
        swap(sx,gx);
        swap(sy,gy);
    }
    if( (sx>gx && sy>gy) || (sx<gx && sy<gy) ){
        int val=min( sx-gx , sy-gy );
        sx-=val;
        sy-=val;
        ret+=val;
    }
    ret+=abs(sy-gy)+abs(sx-gx);
    
    return ret;
}

int main(){
    int c=0;
    int w,h,n;
    cin>>w>>h>>n;
    int nowx,nowy;
    cin>>nowx>>nowy;
    rep(i,n-1){
        int x,y;
        cin>>x>>y;
        c+=solve(nowx,nowy,x,y);
        
        nowx=x;nowy=y;
    }
    cout<<c<<endl;
    return 0;
    
}

Measured memory_bytes: 1160
#! /usr/bin/env python3

n = int(input())
s = input()
t0 = 0
t1 = 0
ans = s
for i in s:
    if i == '(' : t0 += 1
    if i == ')' : t1 += 1
    if t0 < 1 and t1 > 0:
        t1 -= 1
        ans = '(' + ans
    if t0 > 0 and t1 > 0:
        t0 -= 1
        t1 -= 1
print(ans + ')' * t0)

Measured memory_bytes: 3060
#include <stdio.h>

int main(void) 
{
	int n=0;
	scanf("%d",&n);
	int t=n%10;
	if(t==3)
	printf("bon");
	else if(t==0||t==1||t==6||t==8)
	printf("pon");
	else
	printf("hon");
	return 0;
}


Measured memory_bytes: 1732
import java.util.*;
public class Main {

    public static void main(String[] args) {
        Scanner  yomi = new Scanner(System.in);
        int k = yomi.nextInt();
        int a = yomi.nextInt();
        int b = yomi.nextInt();
        for (int i=a;i<=b;i++){
            if (i%k==0){
                System.out.println("OK");
                return;
            }
        }
        System.out.println("NG");

    }
}

Measured memory_bytes: 35520
//AGC#015 A
# include <bits/stdc++.h>
typedef long long ll;
using namespace std;
int main(){
	ll N,A,B;
	cin >> N >> A >> B;
	if (N == 1 && A!=B){ cout << 0 << endl; return 0; }
	if (A>B){ cout << 0 << endl; return 0; }
	cout << ((N-1)*B+A) - ((N-1)*A+B) + 1 << endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
const int maxn=1e6+5;
std::map<int,int> M;
int main() {
    int x,n;cin>>x>>n;
    for(int i=1;i<=n;i++) {
    	int tem;cin>>tem;M[tem]=1;
    }
    int ans=-100;
    for(int i=-100;i<=1000;i++) {
    	if(M[i]) continue;
    	if(abs(x-i)<abs(x-ans)) ans=i; 
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3676
import sys
S = input()
N = len(S)
for i in range(N):
    if(S[i] != S[N-1-i]):
        print("No")
        sys.exit()
for i in range(int((N-1)/2)):
    if(S[i] != S[int((N-1)/2-1-i)]):
        print("No")
        sys.exit()
for i in range(int((N+1)/2-1),N):
    if(S[i] != S[N-1-i]):
        print("No")
        sys.exit()
print("Yes")

Measured memory_bytes: 3064
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;

struct Node{
    int key;
    struct Node *prev;
    struct Node *next;
};

struct Node *nil;

void init(){
    nil=(Node *)malloc(sizeof(struct Node));
    nil->next=nil;
    nil->prev=nil;
}

void insert(int key){
    struct Node *x=(Node *)malloc(sizeof(struct Node));
    x->key=key;
    x->next=nil->next;
    x->next->prev=x;
    nil->next=x;
    x->prev=nil;
}

Node *listsearch(int key){
    Node *cur=nil->next;
    while(cur!=nil&&cur->key!=key){
        cur=cur->next;
    }
    return cur;
}

void deletenode(Node *t){
    if(t==nil)return;
    t->prev->next=t->next;
    t->next->prev=t->prev;
    free(t);
}

void deletefirst(){
    deletenode(nil->next);
}

void deletelast(){
    deletenode(nil->prev);
}

void deletekey(int key){
    deletenode(listsearch(key));
}

void printList(){
    struct Node *cur=nil->next;
    int s=0;
    while(1){
        if(cur==nil)break;
        if(s>0)printf(" ");
        s++;
        printf("%d",cur->key);
        cur=cur->next;
    }
    printf("\n");
}

int main(void){
    int n,key;
    char command[10];
    scanf("%d",&n);
    
    init();
    
    for(int i=0;i<n;i++){
        scanf("%s%d",command,&key);
        if(command[0]=='i'){
            insert(key);
        }else if(command[0]=='d'){
            if(strlen(command)>6){
                if(command[6]=='F')deletefirst();
                else if(command[6]=='L')deletelast();
            }else{
                deletekey(key);
            }
        }
    }
    printList();
    return 0;
}



Measured memory_bytes: 34368
N,X=map(int,input().split())

# レベル0バーガーの厚さ：1
# レベルLバーガーの厚さ：A(L-1) * 2 + 3

# レベル0バーガーのパティの数：1
# レベルLバーガーのパティの数：P(L-1) * 2 + 1

a=[1]
p=[1]
for i in range(N):
  a+=[a[i]*2+3]
  p+=[p[i]*2+1]
  
def search(n,x):
  if n==0:
    return (1,0)[x<=0]
  elif x<=1+a[n-1]:
    return search(n-1,x-1)
  else:
    return p[n-1]+1+search(n-1,x-2-a[n-1])
  
print(search(N,X))


Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
constexpr long long MOD = 1000000007;
constexpr long long INF = 1LL << 60;
const long double PI = acosl(-1.0);
constexpr long double EPS = 1e-11;
template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
int main(){
ll n;
cin>>n;
vector<ll> a(n);
for (ll i = 0;i<n;i++){
    cin >> a[i];
}
ll streak = 0;
ll ans = 0;
for (ll i = 0;i<n-1;i++){
    if(streak==0){
        if (a[i] < a[i + 1]) streak = 1;
        else if(a[i]>a[i+1])
            streak = 2;
    }
    if(streak==1&&a[i]>a[i+1]){
        ans++;
        streak = 0;
    }
    if(streak==2 and a[i]<a[i+1]){
        ans++;
        streak = 0;
    }
}
cout << ans+1 << endl;
}

Measured memory_bytes: 4052
#include <bits/stdc++.h>
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
const ll mod = 1e9+7;
#define all(x) (x).begin(),(x).end()

template<class T> inline void chmin(T& a, T b) {
    if (a > b) {
        a = b;
    }
}

template<class T> inline void chmax(T& a, T b) {
    if (a < b) {
        a = b;
    }
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);std::cout<<std::fixed<<std::setprecision(10);
    int A,B;
    cin >> A >> B;
    A--;
    int ans;
    if((B-1)%A!=0){
        ans = (B-1)/A + 1;
    }else{
        ans = (B-1)/A;
    }
    cout <<ans<< "\n";
}

Measured memory_bytes: 256
import copy
import itertools
import sys

if sys.version[0] == '2':
    range, input = xrange, raw_input

drc = [(-1, 0), (0, 1), (1, 0), (0, -1)]
C_NUM = 6


while True:
    H, W, C = map(int, input().split())
    if not (H | W | C):
        break
    board = [[int(x) - 1 for x in input().split()] for _ in range(H)]
    ans = 0
    for ope in itertools.product(range(C_NUM), repeat=4):
        # print(ope)
        ps = [(0, 0)]
        tmp_board = copy.deepcopy(board)
        for color in itertools.chain(ope, (C - 1,)):
            now_c = tmp_board[0][0]
            if now_c == color:
                continue

            for r, c in ps:
                tmp_board[r][c] = color
            stack = ps[:]
            while stack:
                r, c = stack.pop()
                for dr, dc in drc:
                    nr, nc = r + dr, c + dc
                    if 0 <= nr < H and 0 <= nc < W and tmp_board[nr][nc] == now_c:
                        tmp_board[nr][nc] = color
                        stack.append((nr, nc))
                        ps.append((nr, nc))
        for r, c in ps:
            tmp_board[r][c] = -1
        stack = ps[:]
        while stack:
            r, c = stack.pop()
            for dr, dc in drc:
                nr, nc = r + dr, c + dc
                if 0 <= nr < H and 0 <= nc < W and tmp_board[nr][nc] == C - 1:
                    tmp_board[nr][nc] = -1
                    stack.append((nr, nc))
        cand = sum(row.count(-1) for row in tmp_board)
        if cand > ans:
            ans = cand
    print(ans)

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef vector<ll> vl;
typedef vector<vl> vvl;
template<typename T> using v = vector<T>;
template<typename T> using pq = priority_queue<T>;
template<typename T> using minpq = priority_queue<T, vector<T>, greater<T>>;
template<typename T, typename K> using ump = unordered_map<T, K>;
const ll dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
const ll mod = 1000000007;
const ll inf = ll(1e9);
const ll e5 = ll(1e5);
const ll ll_inf = ll(1e9) * ll(1e9);

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)
#define repr(i, n) for(ll i = n - 1; i >= 0; i--)
#define repone(i, n) for(ll i = 1; i <= (ll)(n); i++)
#define each(i, mp) for(auto& i:mp)
#define eb emplace_back
#define F first
#define S second
#define all(obj) (obj).begin(), (obj).end()

template<class T>
void dump_debug(T list) {
#ifdef MY_DEBUG
    each(e, list) cout << e << " ";
    printf("\n");
#endif
}

inline ll inl() {
    ll x;
    cin >> x;
    return x;
}

inline string ins() {
    string x;
    cin >> x;
    return x;
}

/* ------------- ANSWER ------------- */
/* ---------------------------------- */

int main() {
#ifdef MY_DEBUG
    while (true) {
#endif
        ll r = inl();
        cout << 3 * r * r << endl;
#ifdef MY_DEBUG
    }
#endif
    return 0;
}

Measured memory_bytes: 256
#define _DEBUG 1
#define _GLIBCXX_DEBUG

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

using ll = long long;

#ifdef _DEBUG
#define dump(x) cerr << #x << "=" << x << endl
#define dump2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define dump3(x, y, z)                                                         \
  cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z     \
       << endl
#define check(s) cerr << s << endl
#else
#define dump(x)
#define dump2(x, y)
#define dump3(x, y, z)
#define check(s)
#endif

#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((int)(x).size())
#define unique(v) v.erase(unique(v.begin(), v.end()), v.end());

const ll LINF = 2e18;
const int INF = 1e9;

void solve(ll W, ll a, ll b) {
  ll d = abs(b - a);
  if (d >= W) {
    cout << d - W << endl;
  } else {
    cout << 0 << endl;
  }
}

int main() {
  ll W;
  scanf("%lld", &W);
  ll a;
  scanf("%lld", &a);
  ll b;
  scanf("%lld", &b);
  solve(W, a, b);
  return 0;
}


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

using namespace std;

const int N = 1e5 + 9;

int n, m, x[N], y[N];
long long xCum[N], yCum[N];

const int MD = 1e9 + 7;

inline void add(long long& lhs, long long rhs) {
    lhs = (lhs + rhs) % MD;
}

inline long long mul(long long lhs, long long rhs) {
    return 1LL * lhs * rhs % MD;
}

inline long long sub(long long lhs, long long rhs) {
    long long res = ((lhs - rhs) % MD + MD) % MD;
    return res;
}

long long modPow(long long n, long long k, int MOD){
    long long r=1;
    while(k){
        if(k & 1){
            r = (r * n) % MOD;
        }
        n = (n * n) % MOD;
        k >>= 1;
    }
    return r % MOD;
}

inline long long Div(long long num, long long den) {
    return 1LL * num * modPow(den, MD - 2, MD) % MD;
}

void readInput() {
    
    scanf("%d %d", &n, &m);

    for(int i = 0; i < n; i ++) {
        scanf("%d", &x[i]);
    }

    for(int i = 0; i < m; i ++) {
        scanf("%d", &y[i]);
    }

    sort(x, x + n);
    sort(y, y + m);

    xCum[0] = x[0];
    for(int i = 1; i < n; i ++) {
        xCum[i] = xCum[i - 1] + x[i];
    }

    yCum[0] = y[0];
    for(int i = 1; i < m; i ++) {
        yCum[i] = yCum[i - 1] + y[i];
    }
}

int main(int argc, char const *argv[]) {
    
    readInput();

    long long ans = 0, xDiffSum = 0, yDiffSum = 0;

    for(int i = 0; i < n; i ++) {
        int ahead = n - i - 1;
        add(xDiffSum, sub(sub(xCum[n - 1], xCum[i]), mul(ahead, x[i])));
        int behind = i;
        add(xDiffSum, sub(mul(behind, x[i]), (i ? xCum[i - 1] : 0)));
    }

    for(int i = 0; i < m; i ++) {
        int ahead = m - i - 1;
        add(yDiffSum, sub(sub(yCum[m - 1], yCum[i]), mul(ahead, y[i])));
        int behind = i;
        add(yDiffSum, sub(mul(behind, y[i]), (i ? yCum[i - 1] : 0)));
    }    

    ans = Div(mul(xDiffSum, yDiffSum), 4);
    cout << ans;

    return 0;
}

Measured memory_bytes: 2560
// A - Garden
// https://abc106.contest.atcoder.jp/tasks/abc106_a

import scala.io.StdIn.readLine

object Main extends App {

  val Array(a, b) = readLine.split(" ").map(_.toInt)

  val area = (a - 1) * (b - 1)

  println(area)

}

Measured memory_bytes: 25288
#include <iostream>
using namespace std;
int main(void){
    // Your code here!
    string s;
    cin >> s;
    
    if( s.at(2) == s.at(3) && s.at(4) == s.at(5)){
        cout << "Yes" << endl;
    }
    
    else{
        cout << "No" << endl;
    }
}

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#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 srep(i,s,t) for (int i = s; i < t; ++i)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#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 show(x) cout << #x << " = " << (x) << endl
#define show2(x,y) cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl
#define show3(x,y,z) cout << #x << " = " << (x) << ", " << #y << " = " << (y) <<  ", " << #z << " = " << (z) << endl
#define showv(v) rep(i,v.size()) printf("%d%c", v[i], i==v.size()-1?'\n':' ')
#define showv2(v) rep(j,v.size()) showv(v[j])
#define showt(t,n) rep(i,n) printf("%d%c", t[i], i==n-1?'\n':' ')
#define showt2(t,r,c) rep(j,r) showt(t[j],c)
#define showvp(p) rep(i,p.size()) printf("%d %d\n", p[i].first, p[i].second)
#define printv(v) rep(i,v.size()) printf("%d\n", v[i])
#define printt(t,n) rep(i,n) printf("%d\n", t[i])
#define incl(v,x) (find(all(v),x)!=v.end())
#define incls(s,c) (s.find(c)!=string::npos)
#define lb(a,x) distance((a).begin(),lower_bound(all(a),(x)))
#define ub(a,x) distance((a).begin(),upper_bound(all(a),(x)))
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define pcnt __builtin_popcountll
#define bit(n,k) ((n>>k)&1) // nのk bit目
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define newline puts("")
#define uni(x) x.erase(unique(all(x)),x.end())
#define SP << " " <<
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using vc = vector<char>;
using vvc = vector<vc>;
using vs = vector<string>;
using vb = vector<bool>;
using vvb = vector<vb>;
using P = pair<int, int>;
using T = tuple<int, int, int>;
using vp = vector<P>;
using vt = vector<T>;
const int mod = 1000000007;
const double EPS = 1e-9;
//const long double EPS = 1e-14;
const int INF = (1<<30)-1;
const ll LINF = (1LL<<62)-1;
#define dame { puts("No"); return 0;}
#define yn {puts("Yes");}else{puts("No");}
inline int in() { int x; cin >> x; return x;}
inline ll lin() { ll x; cin >> x; return x;}
inline char chin() { char x; cin >> x; return x;}
inline string stin() { string x; cin >> x; return x;}
inline double din() { double x; cin >> x; return x;}
//template<class T = int> inline T in() { T x; cin >> x; return (x);}
template<typename T>inline ll suma(const vector<T>& a) { ll res(0); for (auto&& x : a) res += x; return res;}
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
char itoa(int n) { return n + '0';}
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;}
const int dx[4] = {1, 0,-1, 0};
const int dy[4] = {0, 1, 0,-1};

int main () {
  int x = in();
  cout << x*x*x << endl;
  return 0;
}


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

int t[1002][1002];

int main(){
  int n, m, a;

  while(cin >> n >> m >> a, n || m || a){
    memset(t, -1, sizeof(t));

    for(int i = 0; i < m; i++){
      int h, p, q;
      cin >> h >> p >> q;
      t[1000 - h][p - 1] = q - 1;
      t[1000 - h][q - 1] = p - 1;
    }

    a--;

    for(int i = 0; i < 1000; i++){
      if(t[i][a] == -1) continue;
      a = t[i][a];
    }

    cout << a + 1 << endl;
  }
}

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

using namespace std;

int main(){
  int n;
  string s;
  vector<int> ans(4);
  fill(ans.begin(), ans.end(), 0);
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> s;
    if(s=="AC") ans.at(0)++;
    if(s=="WA") ans.at(1)++;
    if(s=="TLE") ans.at(2)++;
    if(s=="RE") ans.at(3)++;
  }
  cout << "AC x " << ans.at(0) << endl;
  cout << "WA x " << ans.at(1) << endl;
  cout << "TLE x " << ans.at(2) << endl;
  cout << "RE x " << ans.at(3) << endl;

  return 0;
}


Measured memory_bytes: 3628
#include <bits/stdc++.h>
using namespace std;
 
#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define cout(d) cout<<d<<endl;
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);
#define replace_all(s, b, a) replace(s.begin(),s.end(), b, a);
 
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;
 
template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }
 
int main()
{
  cin.tie( 0 );
  ios::sync_with_stdio( false );
  
  int x,y,z;cin>>x>>y>>z;
  int ans=x/(y+z);
  if(ans!=0&&z>x%(y+z))ans--;
  cout(ans);
  return 0;
}

Measured memory_bytes: 256
use std::cmp::min;

const MOD: i64 = 1000000007;


fn main() {
    let (x, y) = read_tuple::<usize>();
    let c = Comb::new(1e6 as i64 as usize + 1, MOD);

    let mut ans = 0;
    for s in 0..min(x+1, y/2+1) {
        let t = y - 2 * s;
        if (x - s) % 2 == 0 && t == (x - s) / 2 {
            ans += c.nck(s + t, s);
            ans %= MOD;
        }
    }

    println!("{}", ans);
}

/// for nCk
pub struct Comb {
    max: usize,
    m: i64,
    fac: Vec<i64>,
    finv: Vec<i64>,
}

impl Comb {
    /// initialize table 
    /// max: maximum that n as nCk takes
    /// m: MOD, a prime number
    /// O(n)
    pub fn new(max: usize, m: i64) -> Comb {
        let n = max;
        let mut fac = Vec::with_capacity(n);
        fac.push(1);
        fac.push(1);
        let mut finv = Vec::with_capacity(n);
        finv.push(1);
        finv.push(1);
        let mut inv = Vec::with_capacity(n);
        inv.push(1);
        inv.push(1);

        for i in 2..n {
            let i = i as i64;
            let tmp = fac.last().unwrap() * i % m;
            fac.push(tmp);
            let tmp = m - inv[(m % i) as usize] * (m / i) % m;
            inv.push(tmp);
            let tmp = finv.last().unwrap() * inv.last().unwrap() % m;
            finv.push(tmp);
        }

        Comb {
            max: max,
            m: m,
            fac: fac,
            finv: finv
        }
    }

    /// nCk
    pub fn nck(&self, n: usize, k: usize) -> i64 {
        // since n, k are usize, do not need to check `n < 0 || k < 0`
        if n < k || n > self.max {
            panic!("Invalid query (n, k) = ({}, {})", n, k);
        } else {
            self.fac[n] * (self.finv[k] * self.finv[n - k] % self.m) % self.m
        }
    }
}


fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}
fn read_tuple<T: std::str::FromStr + Copy>() -> (T, T) {
    let temp = read_vec();
    (temp[0], temp[1])
}



Measured memory_bytes: 28924
#include<bits/stdc++.h>
 
using namespace std;
 
#define LL long long int
#define FASTIO ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const int N = 1e5 + 5;
const int M = 21;
const int oo = 1e9 + 5;
const LL ooll = (LL)1e18 + 5;
const int MOD = 1e9 + 7;

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define rand(l, r) uniform_int_distribution<int>(l, r)(rng)

clock_t start = clock();

LL powermod(LL a, LL b) {
    LL pw = 1, mul = a, res = 1;
    while(pw <= b) {
        if (b & pw) res = (res * mul)%MOD;
        mul = (mul * mul)%MOD;
        pw <<= 1;
    }
    return res;
}

void solve() {
    LL n;
    cin >> n;
    LL sum = 0, sumsq = 0;
    while(n--) {
        LL x;
        cin >> x;
        sum += x; if (sum >= MOD) sum -= MOD;
        sumsq += (x * x)%MOD; if (sumsq >= MOD) sumsq -= MOD;
    }
    cout << ((((sum * sum)%MOD - sumsq)%MOD + MOD)%MOD * powermod(2, MOD-2))%MOD << '\n';
}

int main() {
    FASTIO;
    int T = 1;
    // cin >> T;
    for (int t=1;t<=T;++t) {
        solve();
    }
    // cerr << fixed << setprecision(10);
    // cerr << (clock() - start) / ((long double)CLOCKS_PER_SEC) << '\n';
    return 0;
} 

Measured memory_bytes: 3668
#include <stdio.h>
int main(){
    int i,n;
    scanf("%d",&n);
    for(i=1;i<=n;i++){
        int ten=0;
        int rui[4]={0},out=0;
        while(out!=3){
            char input[10];
            scanf("%s",input);
            if(strcmp(input,"HIT")==0){
                rui[3]=rui[2];
                rui[2]=rui[1];
                rui[1]=rui[0];
                rui[0]=1;
                if(rui[3]==1){
                    ten+=rui[3];
                    rui[3]=0;
                }
            }
            if(strcmp(input,"OUT")==0){
                out++;
            }
            if(strcmp(input,"HOMERUN")==0){
                ten+=rui[0]+rui[1]+rui[2]+1;
                rui[0]=0;
                rui[1]=0;
                rui[2]=0;
                rui[3]=0;
            }
        }
        printf("%d\n",ten);
    }
    return 0;
}

Measured memory_bytes: 596
#include<bits/stdc++.h>
using namespace std;
string s;
bool vis[222];
int main()
{
    int ans=0;
    cin>>s;
    for(int i=0;i<s.size();i++)
    {
        int t=s[i]-'A';
        if(!vis[t])
        {
            ans++;
            vis[t]=true;
        }
    }
    printf(ans==2?"Yes":"No");
}


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

int main()
{
    long long n;
    cin>>n;
    long long count=0;
    for(int i=1;i<=n;i++)
    {
        if(i%3==0 || i%5==0)
        {
            continue;
        }
        else
            count+=i;

    }
    cout<<count<<endl;
    return 0;
}


Measured memory_bytes: 3536
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
    
    Scanner sc = new Scanner(System.in);
    String S  = sc.next();
    char[]ss = S.toCharArray();
    
    int all = 0;
    for(int i=0; i<S.length(); i++) {
    	all += ss[i]-48;
    }	
    	if(all%9 == 0) {
    		System.out.println("Yes");
    	}else {
    		System.out.println("No");
    }
}
}

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

int main()
{
	long long a,b;
	cin >> a >> b;
	if(a < 0 && b >= 0){
		cout << "Zero" << endl;
	}
	else if(a == 0){
		cout << "Zero" << endl;
	}
	else if(a < 0 && b < 0){
		if((b - a) % 2 == 1){
			cout << "Positive" << endl;
		}
		else cout << "Negative" << endl;
	}
	else cout << "Positive" << endl;

	return 0;
}

Measured memory_bytes: 256
N, M = map(int,input().split())
PY = [list(map(int,input().split())) + [0] for _ in range(M)]
sort_PY = sorted(PY, key = lambda x: x[1])

city = {}
for i in range(M):
  p, y = sort_PY[i][0], sort_PY[i][1]
  if p in city:
    city[p] += 1
  else:
    city[p] = 1
  sort_PY[i][2] = city[p]
for p, y, z in PY:
  print(str(p).zfill(6)+str(z).zfill(6))


Measured memory_bytes: 30040
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
using namespace std;
int main() {
	int a, b, c = 1, d = 0, e;
	cin >> a >> b;
	for (int h = 1; h <= a; h++) {
		if (b >= c) {
			c = c + c;
		}
		else {
			c = c + b;
		}
	}
	cout << c << "\n";
	cin >> e;
}

Measured memory_bytes: 256
#include <iostream>
using namespace std ;
int main()
{
    int x;
   string s,t;
   cin >> s ;
   cin>> t;
   int ans=0 ;
for (int i=0;i<3;i++)
{
    if(s[i]==t[i])
    {
        ans++ ;
    }

}

cout<<ans;

    return 0 ;
}


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

int main()
{
    string s;
    cin >> s;
    int sum = 0;
    for(int i = 0; i < (int)s.size(); i++) {
        sum += s[i] - '0';
    }
    cout << sum << endl;
    return 0;
}

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

using namespace std;

#ifdef LOCAL
#define DBG_MACRO_NO_WARNING
#include <dbg.h>
#else
#define dbg(...) 0
#endif

using ll = long long;
using ull = unsigned long long;

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

#ifdef LOCAL
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
#endif

  ll a, b;
  cin >> a >> b;

  if ((a + b) % 2 == 0) {
    cout << (a + b) / 2 << "\n";
  } else {
    cout << "IMPOSSIBLE"
         << "\n";
  }

  return 0;
}

Measured memory_bytes: 3616
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define mp make_pair
#define fi first
#define si second
using namespace std;

long long a,b,c,n,r,m,k,p,arr[100100];

int main()
{
    while(cin>>a>>b>>c){
        if(c>=a && c<=b) cout<<"Yes"<<endl;
        else cout<<"No"<<endl;
    }
}



Measured memory_bytes: 256
def examA():
    X = I()
    if X<30:
        ans = "No"
    else:
        ans = "Yes"
    print(ans)
    return

def examB():
    N, D = LI()
    cnt = 0
    for _ in range(N):
        x, y = LI()
        if x**2+y**2<=D**2:
            cnt += 1
    ans = cnt
    print(ans)
    return

def examC():
    ans = 0
    print(ans)
    return

def examD():
    ans = 0
    print(ans)
    return

def examE():
    ans = 0
    print(ans)
    return

def examF():
    ans = 0
    print(ans)
    return

def test():
    i = I()
    li = LI()
    lsi = LSI()
    si = LS()
    print(i)
    print(li)
    print(lsi)
    print(si)
    return

from decimal import getcontext,Decimal as dec
import sys,bisect,itertools,heapq,math,random
from copy import deepcopy
from heapq import heappop,heappush,heapify
from collections import Counter,defaultdict,deque
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
def I(): return int(input())
def LI(): return list(map(int,sys.stdin.readline().split()))
def DI(): return dec(input())
def LDI(): return list(map(dec,sys.stdin.readline().split()))
def LSI(): return list(map(str,sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def SI(): return sys.stdin.readline().strip()
global mod,mod2,inf,alphabet,_ep,alphabet_convert
mod = 10**9 + 7
mod2 = 998244353
inf = 10**18
_ep = dec("0.000000000001")
alphabet = [chr(ord('a') + i) for i in range(26)]
alphabet_convert = {chr(ord('a') + i): i for i in range(26)}

getcontext().prec = 28

sys.setrecursionlimit(10**7)

if __name__ == '__main__':
    examB()

"""
142
12 9 1445 0 1
asd dfg hj o o
aidn
"""

Measured memory_bytes: 78796
#include <iostream>
#include <cmath>
#include <complex>
using namespace std;
typedef complex<double> xy_t;
double cross_product(xy_t a, xy_t b){
  return (conj(a)*b).imag();
}

const double eps = 1e-11;
double x[4], y[4];
int N;
int main(){
  cin >> N;
  for(int t=0; t<N; t++){
    for(int i=0; i<4; i++){
      cin >> x[i] >> y[i];
    }
    xy_t a[2] = {
      xy_t(x[0],y[0]) - xy_t(x[1],y[1]),
      xy_t(x[2],y[2]) - xy_t(x[3],y[3])
    };
    bool p = abs(cross_product(a[0], a[1])) < eps;
    cout << (p ? "YES" : "NO") << endl;

  }
}



Measured memory_bytes: 3052
N = gets.to_i
D = gets.chomp.split(" ").map(&:to_i)

countD = Array.new(D.max + 1, 0)

D.each{|d|
  countD[d] += 1
}

if D[0] != 0 then
  puts 0
elsif countD[0] != 1 then
  puts 0
else
  ans = (1...countD.length).inject(1){|times, i|
    times * countD[i-1] ** countD[i]
  }
  puts ans % 998244353
end


Measured memory_bytes: 70936
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <map>
#include <vector>
#include <set>
#include <cstdlib>
#include <deque>
#include <stack>

using namespace std;
const long long P = 1000000007;
const long long INF = 1LL << 60;

int main() {
  int n;
  cin >> n;
  string s;
  set<string> st;
  for(int i = 0; i < n; i++) {
    cin >> s;
    st.insert(s);
  }
  cout << st.size() << endl;
  return 0;
}


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

using ll = long long;
using pii = pair<int, int>;

template <typename T> constexpr T inf;
template <> constexpr int inf<int> = 1e9;
template <> constexpr ll inf<ll> = 1e18;
template <> constexpr double inf<double> = 1e18;

template<typename T>
std::vector<T> table(int n, T v) { return std::vector<T>(n, v); }
 
template <class... Args>
auto table(int n, Args... args) {
    auto val = table(args...);
    return std::vector<decltype(val)>(n, std::move(val));
}


int main() {
    int N;
    cin >> N;
    if(N == 3) {
        cout << 2 << ' ' << 5 << ' ' << 63 << endl;
        return 0;
    }

    vector<int> two, three, six;
    for(int i = 2; i <= 30000; ++i) {
        if(i % 6 == 0) {
            six.push_back(i);
        } else if(i % 2 == 0) {
            two.push_back(i);
        } else if(i % 3 == 0) {
            three.push_back(i);
        }
    }
    reverse(begin(six), end(six));
    reverse(begin(two), end(two));
    reverse(begin(three), end(three));

    vector<int> ans;
    int m = N;
    ans.push_back(two.back()); two.pop_back();
    ans.push_back(two.back()); two.pop_back();
    ans.push_back(three.back()); three.pop_back();
    ans.push_back(three.back()); three.pop_back();
    m -= 4;
    while(m >= 2 && two.size() >= 2) {
        ans.push_back(two.back()); two.pop_back();
        ans.push_back(two.back()); two.pop_back();
        m -= 2;
    }
    while(m >= 2 && three.size() >= 2) {
        ans.push_back(three.back()); three.pop_back();
        ans.push_back(three.back()); three.pop_back();
        m -= 2;
    }
    while(m > 0) {
        ans.push_back(six.back());
        six.pop_back();
        m--;
    }
    sort(begin(ans), end(ans));

    for(int i = 0; i < N; ++i) {
        cout << ans[i] << " \n"[i + 1 == N];
    }

    // debug
    bool check = true;
    int sum = accumulate(begin(ans), end(ans), 0);
    int g = 0;
    for(int i = 0; i < N; ++i) {
        g = __gcd(ans[i], g);
        check &= __gcd(sum - ans[i], ans[i]) != 1;
    }
    check &= g == 1;
    assert(check);
}

Measured memory_bytes: 640
//** aman**/
#include<bits/stdc++.h>
#define ll          long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define dl          double
#define hell        1000000007
#define endl        '\n'
#define rep(i,a,b) for(int i=a;i<b;i++)
#define lb lower_bound
#define ub upper_bound
#define bs          binary_search
#define ios         ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0)
using namespace std;
int main(){
	int n,x,y;cin>>n>>x>>y;
	int d[n]={0};
	for(int i=1;i<=n;i++){
		for(int j=i+1;j<=n;j++){
			int k=100000;
			k=min(abs(i-j),min(abs(i-x)+1+abs(j-y),abs(i-y)+1+abs(j-x)));
			d[k]++;
		}
	}
	for(int i=1;i<n;i++)cout<<d[i]<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <string.h>
//s#define rep(i, n) for (int i = 0; i < (n); i++)
#define MAX 10000

using namespace std;

#define ll long long
#define pb push_back
#define mp make_pair
#define all(a) (a).begin(),(a).end()
#define rep(i,a,n) for(int i=a; i<n; i++)
#define r0 return 0
#define INF (int)1e15

int const N = 1e5+1;
long long a[N];


int main(){

 long long n;
 cin>>n;

 a[0] = 2,a[1] = 1;

 for(int i=2;i<N;i++){

    a[i] = a[i-2] + a[i-1];

 }

  cout<<a[n]<<endl;

 return 0;
}


Measured memory_bytes: 4404
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;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());
#define INF 999999999
#define M_PI 3.14159265358979323846
// #define __LOCAL

#ifdef __LOCAL
#define DBG(X) cout << #X << " = " << (X) << endl;
#define SAY(X) cout << (X) << endl;
#else
#define DBG(X)
#define SAY(X)
#endif

using namespace std;

using ll = long long int;
using ull = unsigned long long int;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

int dx[]={1, 0, -1, 0, 0};
int dy[]={0, 1, 0, -1, 0};
const int INT_INF = (int)(2e9);
const ll  LL_INF = (ll)(2e18);
const int NIL = -1;
static mt19937 _g(time(nullptr));
 
std::string pad(int num){ char buffer[4]; std::snprintf(buffer, sizeof(buffer), "%03d", num); return buffer;}
inline ll randint(ll a, ll b) { ll w = (_g() << 31LL) ^ _g(); return a + w % (b - a + 1); }
inline void fast_io() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); };
template<typename T> inline T sign(T x) { return T(x > 0) - T(x < 0); }
template<typename T, typename S> inline ostream& operator<<(ostream& os, const pair<T, S> p) { cout << "[" << p.first << ";" << p.second << "]"; return os; }
template<typename T> inline ostream& operator<<(ostream& os, const vector<T>& v) { for (auto el : v) cout << el << " "; return os; }
template<typename T> inline T fetch() { T ret; cin >> ret; return ret; }
template<typename T> inline vector<T> fetch_vec(int sz) { vector<T> ret(sz); for (auto& elem : ret) cin >> elem; return ret; }

#ifdef _MSC_VER
#  include <intrin.h>
#  define __builtin_popcount __popcnt
#endif

int main()
{
    string S,T;
    cin >> S >> T;
    cout << T << S << endl;

}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

#define REP(i, start, end) for (int(i) = (start); (i) < (end); (i)++)

// N = 4 * a + 7 * b
// => 'Yes' 'No'

int main() {
  int N;
  cin >> N;
  for (int a = 0; a <= N; a += 4) {
    for (int b = 0; a + b <= N; b += 7) {
      if (N == (a + b)) {
        cout << "Yes";
        return 0;
      }
    }
  }
  cout << "No";
  return 0;
}

Measured memory_bytes: 256
/*  -*- coding: utf-8 -*-
 *
 * b.cc: B - Good Distance
 */

#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<cmath>
#include<iostream>
#include<string>
#include<vector>
#include<map>
#include<set>
#include<stack>
#include<list>
#include<queue>
#include<deque>
#include<algorithm>
#include<numeric>
#include<utility>
#include<complex>
#include<functional>
 
using namespace std;

/* constant */

const int MAX_N = 10;
const int MAX_D = 10;

/* typedef */

typedef long long ll;
typedef vector<int> vi;
typedef queue<int> qi;
typedef pair<int,int> pii;

/* global variables */

int xs[MAX_N][MAX_D];

/* subroutines */

/* main */

int main() {
  int n, d;
  scanf("%d%d", &n, &d);

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

  int cnt = 0;
  for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
      int d2 = 0;
      for (int k = 0; k < d; k++) {
	int dx = xs[j][k] - xs[i][k];
	d2 += dx * dx;
      }
      //printf("(%d,%d)=%d\n", i, j, d2);

      for (int p = 1; p * p <= d2; p++)
	if (p * p == d2) cnt++;
    }

  printf("%d\n", cnt);
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

/**
 * We Love Golf.
 */
public class Main {
    public static void main(String[] args) {
        var scanner = new Scanner(System.in);
        var k = Integer.parseInt(scanner.next());
        var a = Integer.parseInt(scanner.next());
        var b = Integer.parseInt(scanner.next());

        var achieved = false;
        for (int i = a; i <= b; i++) {
            if (i % k == 0) {
                achieved = true;
                break;
            }
        }
        System.out.println(achieved ? "OK" : "NG");
    }
}


Measured memory_bytes: 35684
#include<iostream>
#include <algorithm>
#include <string>
#define syso(s) std::cout<<s<<endl;
#define sc(i) std::cin>>i;
#define rep(i,n)for(i=0;i<n;i++)
using namespace std;
int main() {
	int a,b,c,d;
	sc(a);
	sc(b)
	sc(c)
	sc(d)
	int A=a*b;
	int B=c*d;
	if (A > B) {
		syso(A)
	}
	else {
		syso(B)
	}
	return 0;
}

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

int main()
{
    int n, t;
    while(cin >> n && n) {
        int hist[10];
        memset(hist, 0, sizeof(hist));
        for(int i = 0; i < n; i++) {
            cin >> t;
            hist[t]++;
        }
        for(int i = 0; i < 10; i++) {
            if(hist[i] == 0) {
                cout << "-" << endl;
            } else {
                for(int j = 0; j < hist[i]; j++) 
                    cout << "*";
                cout << endl;
            }
        }
    }
}

Measured memory_bytes: 0
//              +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+              \\

#include <bits/stdc++.h>

#define F first
#define S second
#define _sz(x) (int)x.size()

using namespace std ;
using ll = long long ;
using ld = long double ;
using pii = pair <int , int> ;

int const N = 1e5 + 20 ;
int n , a[3][N] ;
int b[2][N] , sz[2] , inv[2] , num[2] ;

int fen[N] ;

inline void add (int p) {
	for (p ++ ; p < N ; p += p & -p) fen[p] ++ ;
}

inline int get (int p) {
	int res = 0 ;
	for (; p ; p -= p & -p) res += fen[p] ;
	return res ;
}

inline int get (int l , int r) { return get(r) - get(l) ; }

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

	cin >> n ;
	for (int i = 0 ; i < 3 ; i ++)
		for (int j = 0 ; j < n ; j ++)
			cin >> a[i][j] ;

	for (int i = 0 ; i < n ; i ++) {
		if (a[1][i] % 3 != 2) return cout << "No\n" , 0 ;
		if (abs(a[0][i] - a[1][i]) != 1 || abs(a[2][i] - a[1][i]) != 1) return cout << "No\n" , 0 ;
		
		int x = a[1][i] / 3 ;

		if ((x & 1) ^ (i & 1)) return cout << "No\n" , 0 ;
	
		b[i & 1][sz[i & 1] ++] = x ;
		num[i & 1] += (a[0][i] > a[1][i]) ;
	}

	for (int d = 0 ; d < 2 ; d ++) {
		memset(fen , 0 , sizeof fen) ;

		for (int i = 0 ; i < sz[d] ; i ++) {
			add(b[d][i]) ;
			inv[d] += get(b[d][i] + 1 , n) ;
		}
	}

	if ((inv[0] & 1) != (num[1] & 1) || (inv[1] & 1) != (num[0] & 1)) return cout << "No\n" , 0 ;

	cout << "Yes\n" ;
}


Measured memory_bytes: 2176
x, y, a, b, c = map(int, input().split())
p = list(map(int, input().split()))
q = list(map(int, input().split()))
r = list(map(int, input().split()))

sortp = sorted(p)[::-1]
sortq = sorted(q)[::-1]
redpoints = sortp[:x]
greenpoints = sortq[:y]
sortedpoints = sorted(redpoints+greenpoints+r)[::-1]
print(sum(sortedpoints[:x+y]))

Measured memory_bytes: 24496
using System;
class Program
{
    static void Main(string[] args)
    {
        string[] str = Console.ReadLine().Split(' ');
        var a = int.Parse(str[0]); //700
        var b = int.Parse(str[1]); //600
        var c = int.Parse(str[2]); //780
        if (a > b)
        {
            if (a > c)
            {
                Console.Write(b + c);
            }
            else
            {
                Console.Write(a + b);
            }
        }
        else
        {
            if (b > c)
            {
                Console.Write(a + c);
            }
            else
            {
                Console.Write(a + b);
            }
        }
    }
}

Measured memory_bytes: 11092