akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, ll> pll;
#define PI 3.14159265358979
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define repp(i, s, e) for(int i = (s); i <= (e); ++i)
#define sz(x) ((int)x.size())
#define all(x) x.begin(), x.end()
#define FAST_IO() ios::sync_with_stdio(0); cin.tie(0)
template<typename T>
ostream& operator<<(ostream &os, const vector<T> &v) { for (auto x : v) os << x << " "; return os << "\n"; }
template<class U, class V>
ostream& operator<<(ostream &os, const pair<U, V> &p) { return os << "(" << p.first << "," << p.second << ")";}

int main() {
    FAST_IO();
    int N, A, B, C, D; cin >> N >> A >> B >> C >> D;
    string S; cin >> S;
    // case 1 : C < D
    // F - F no ## && S - S no ##
    if(C < D) {
        bool ans = true;
        for(int i = A - 1; i < C - 1; ++i) {
            if(S[i] == '#' && S[i + 1] == '#') ans = false;
        }
        for(int i = B - 1; i < D - 1; ++i) {
            if(S[i] == '#' && S[i + 1] == '#') ans = false;
        }
        cout << (ans ? "Yes" : "No") << "\n";
    }
    // case 2 : C > D
    // B-1 ... D-1 appear "..."
    else {
        bool ans = false;
        for(int i = B - 2; i <= D - 2; ++i) {
            if(S[i] == '.' && S[i + 1] == '.' && S[i + 2] == '.') ans = true;
        }
        for(int i = A - 1; i < C - 1; ++i) {
            if(S[i] == '#' && S[i + 1] == '#') ans = false;
        }
        for(int i = B - 1; i < D - 1; ++i) {
            if(S[i] == '#' && S[i + 1] == '#') ans = false;
        }
        cout << (ans ? "Yes" : "No") << "\n";
    }
}


Measured memory_bytes: 592
// Why am I so dumb? :c
#include<bits/stdc++.h>

#define pb push_back
#define mp make_pair

#define all(x) (x).begin(), (x).end()

#define fi first
#define se second

using namespace std;

typedef long long ll;

ll n, x;

void solve() {
    scanf("%lld %lld", &n, &x);
    printf("%lld\n", 3 * (n - __gcd(n, x)));
}

int main() {
    int tt = 1;

    while (tt--) {
        solve();
    }

    return 0;
}

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

int main() {
    
    int w, h, n;
    int i, j, k;
    int x, y, a;
    bool square[100][100];
    int count = 0;

    for(i=0; i<100; i++){
        for(j=0; j<100; j++){
            square[i][j] = false;
        }
    }

    cin >> w >> h >> n;

    for(i=0; i<h; i++){
        for(j=0; j<w; j++){
            square[i][j] = true;
        }
    }

    for(k=0; k<n; k++){
        cin >> x >> y >> a;
        
        switch(a){
            case 1:
                for(i=0; i<h; i++){
                    for(j=0; j<x; j++){
                        square[i][j] = false;
                    }
                }
                break;
            case 2:
                for(i=0; i<h; i++){
                    for(j=x; j<w; j++){
                        square[i][j] = false;
                    }
                }
                break;
            case 3:
                for(i=0; i<y; i++){
                    for(j=0; j<w; j++){
                        square[i][j] = false;
                    }
                }
                break;
            case 4:
                for(i=y; i<h; i++){
                    for(j=0; j<w; j++){
                        square[i][j] = false;
                    }
                }
                break;
        }
    }

    for(i=0; i<h; i++){
        for(j=0; j<w; j++){
            if(square[i][j]){
                count++;
            }
        }
    }

    cout << count << endl;

    return 0;
}



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

using namespace std;

#define REP(i, n) for(int i = 0; i < (n); i++)
#define SORT(v, n) sort(v, v+n);
#define SSORT(v, n) sort(v, v+n, greater<int>())

int main(){
	int a,b,c;
	cin >> a >> b >> c;
	REP(i,10){
		c = a*c-b;
		cout << c << endl;
	}
}

Measured memory_bytes: 256
#include <iostream>
using namespace std;
int n,W;
int w[100],v[100];
int dp[101][10100];
int main(void){
    cin>>n>>W;
    for(int i=0;i<n;i++){
        cin>>v[i]>>w[i];
    }
    for(int i=0;i<n;i++){
        for(int j=0;j<=W;j++){
         if(j<w[i]) dp[i+1][j]=dp[i][j];
         else {
             dp[i+1][j]=max(dp[i][j],dp[i][j-w[i]]+v[i]);
          }
        }
    }
    cout<<dp[n][W]<<endl;
    // Your code here!
    
}

Measured memory_bytes: 7016
program prediction_and_Restriction
    implicit none
    integer(4):: n, k, r, s, p
    integer(8):: tot = 0
    integer(4):: i, j
    character(100000):: t
    logical, allocatable:: can_win(:)

    read*, n, k
    read*, r, s, p
    read*, t
    allocate(can_win(n))


can_win(:) = .true.

    do i=k+1,n
            if (t(i:i) /= t(i-k:i-k)) cycle
            if (can_win(i-k)) can_win(i) = .false.
    end do

    tot = 0
    do i=1,n
        if (.not.can_win(i)) cycle
        if (t(i:i) == 'r') tot = tot + p
        if (t(i:i) == 'p') tot = tot + s
        if (t(i:i) == 's') tot = tot + r
    end do
    
    print*, tot
end program prediction_and_Restriction


Measured memory_bytes: 932
#include<stdio.h>

void output(int A[],int N);
void insertionSort(int A[],int N);

int main(void)
{
  int A[100];
  int N;
  int i,j;

  scanf("%d",&N);
  
  for(i = 0;i < N;i++){
    scanf("%d",&A[i]);
  }

  output(A,N);
  insertionSort(A,N);

  return 0;
}


void output(int A[],int N){
  int i = 0;
  
  while(i < N){
    if(i > 0){
      printf(" ");
    }
    printf("%d",A[i]);
    i++;
  }
  printf("\n");
}

void insertionSort(int A[],int N){
  int i,j;
  int v = 0;

  for(i = 1;i < N;i++){
    v = A[i];
    j = i - 1;
    
    while(j >= 0 && A[j] > v){
      A[j+1] = A[j];
      j--;
    }
    
    A[j+1] = v;
    output(A,N);
  }
}



Measured memory_bytes: 2060
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
ll MOD = 1000000007;
ll INFL = 1ll << 60;
ll INF = 1 << 30;

int main() {
  ll k, a, b;
  cin >> k >> a >> b;
  bool henkan = (b - a >= 3);
  ll m = 1;
  ll yen = 0;
  for (int e = 0; e < k; e++) {
    if ((yen == 0 && m < a) || (yen == 0 && e == k - 1) || henkan == 0) {
      m++;
    } else {
      if (yen == 0) {
        yen++;
        m -= a;
      } else {
        yen--;
        m += b;
      }
    }
  }
  cout << m << endl;
}


Measured memory_bytes: 256
#include<cmath>
#include<string>
#include<algorithm>
using namespace std;
const int MaxN = 1e5;
long long x,y;

int main()
{
	int ans = 0;
	scanf("%lld %lld",&x,&y);
	for(;;)
	{
		ans++;
		x = x*2;
		if(x > y) break;
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 128
import java.util.*;

public class Main{
	private static final Scanner scan = new Scanner(System.in);
	private static final int MAX = 100_001;
	private static String[] P = new String[MAX];
	private static int[] Q = new int[MAX];
	private static int head, tail;
	private static int headQ, tailQ;

	public static void main(String[] args){

		initialize();
		initializeQ();
		int n = scan.nextInt();
		int q = scan.nextInt();
		String[] p = new String[n];
		for(int i = 0; i < n; i++){
			String s = scan.next();
			int m = scan.nextInt();
			enqueue(s);
			enqueueQ(m);
		}
		int total = 0;
		for(;;){
			String s = dequeue();
			int m = dequeueQ();
			if(m >q){
				total += q;
				m = m - q;
				enqueue(s);
				enqueueQ(m);
			}else{
				total += m;
				System.out.printf("%s ", s);
				System.out.printf("%d\n", total);
				if(isEmpty() && isEmptyQ())
					break;
			}
		}
	}

	private static void initializeQ(){
		headQ = tailQ = 0;
	}
	private static boolean isEmptyQ(){
		return headQ == tailQ;
	}
	private static boolean isFullQ(){
		return headQ == (tailQ + 1) % MAX;
	}
	public static void enqueueQ(int y){
		if(isFullQ())
			System.out.printf("%s\n", "???????????????????????§???");
		Q[tailQ] = y;
		if(tailQ + 1 == MAX)
			tailQ = 0;
		else
			tailQ++;
	}
	public static int dequeueQ(){
		if(isEmptyQ())
			System.out.printf("%s\n", "??¢????????????????????§???");
		int y = Q[headQ];
		if(headQ + 1 == MAX)
			headQ = 0;
		else
			headQ++;
		return y;
	}

	private static void initialize(){
		head = tail = 0;
	}
	private static boolean isEmpty(){
		return head == tail;
	}
	private static boolean isFull(){
		return head == (tail + 1) % MAX;
	}
	public static void enqueue(String x){
		if(isFull())
			System.out.printf("%s\n", "???????????????????????§???");
		P[tail] = x;
		if(tail + 1 == MAX)
			tail = 0;
		else
			tail++;
	}
	public static String dequeue(){
		if(isEmpty())
			System.out.printf("%s\n", "??¢????????????????????§???");
		String x = P[head];
		if(head + 1 == MAX)
			head = 0;
		else
			head++;
		return x;
	}
}

Measured memory_bytes: 120932
#pragma GCC optimize ("O2")
#pragma GCC target ("avx2")
//#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please

const int CM = 1 << 17, CL = 12;
char cn[CM + CL], * ci = cn + CM + CL, * owa = cn + CM, ct;
const ll ma0 = 1157442765409226768;
const ll ma1 = 1085102592571150095;
const ll ma2 = 71777214294589695;
const ll ma3 = 281470681808895;
const ll ma4 = 4294967295;
inline int getint() {
	if (ci - owa > 0) {
		memcpy(cn, owa, CL);
		ci -= CM;
		fread(cn + CL, 1, CM, stdin);
	}
	ll tmp = *(ll*)ci;
	if ((tmp & ma0) ^ ma0) {
		int dig = 68 - __builtin_ctzll((tmp & ma0) ^ ma0);
		tmp = tmp << dig & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += (72 - dig >> 3);
	}
	else {
		tmp = tmp & ma1;
		tmp = tmp * 10 + (tmp >> 8) & ma2;
		tmp = tmp * 100 + (tmp >> 16) & ma3;
		tmp = tmp * 10000 + (tmp >> 32) & ma4;
		ci += 8;
		if ((ct = *ci++) >= '0') {
			tmp = tmp * 10 + ct - '0';
			if (*ci++ == '0') {
				tmp = tmp * 10;
				ci++;
			}
		}
	}
	return tmp;
}

int A[200000];
int main() {
	//cin.tie(0);
	//ios::sync_with_stdio(false);


	int N = getint();
	int saidai = 1;
	rep(i, N) {
		A[i] = getint();
		if (A[i] > saidai) saidai = A[i];
	}
	nth_element(A, A + N / 2, A + N);

	if (N % 2) {
		ll kotae = -A[N / 2] - saidai;
		for (int i = N / 2; i < N; i++) {
			kotae += 2 * A[i];
		}
		printf("%lld\n", kotae);
	}
	else {
		ll kotae = - saidai;
		for (int i = N / 2; i < N; i++) {
			kotae += 2 * A[i];
		}
		printf("%lld\n", kotae);
	}


	Would you please return 0;
}

Measured memory_bytes: 2484
#include <bits/stdc++.h>
#include<cmath>
#define N 100005
#define A 1000005
#define MOD 1000000007 // //100000000 998244353 //
#define inf 1000000000000000000
#define ll long long
//#define M_PI 3.141592653589793238463

using namespace std;

#define pii pair<ll, ll>
#define piii pair<ll, pii>
#define ft first
#define sd second
#define pb push_back
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repr(i, n) for(ll i = n-1; i >= 0; i--)
#define itr(it, x) for(auto it = x.begin(); it != x.end(); it++)
#define mem(a, b) memset(a, (ll)b, sizeof(a))
#define all(v) v.begin(), v.end()
#define allr(v) v.rbegin(), v.rend()
#define edge(v, x, y) v[x].pb(y); v[y].pb(x);
#define popcount __builtin_popcount
#define ANS(s) {cout << s << "\n"; return;}

//~~~~~~fancy print~~~~~~~//
#define printpii(a) cout << a.ft << " " << a.sd << endl;
#define printpiii(a) cout << a.ft << " " << a.sd.ft << " " << a.sd.sd << endl;
#define print(a, n) rep(i, n) cout << a[i] << " "; cout << endl;
#define printv(v) for(auto x: v)cout << x << " "; cout << endl;
#define printm(a, n, m) rep(i, n) { rep(j, m) cout << a[i][j] << "\t"; cout << endl;}

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

void fast(){ios_base::sync_with_stdio(false);cin.tie(0);cout << setprecision(12) << fixed;}


void solve(){
    ll n;
    cin >> n;
    ll a[n] ;
    rep(i, n) cin >> a[i];
    ll p[n+1]; mem(p, 0);
    rep(i, n) p[i+1] = p[i] + a[i];
    ll ans = inf;
    rep(i, n-1)
    {
        ans = min(ans, abs(p[n]-p[i+1] - p[i+1])); //cout << p[n]-p[i+1] - p[i+1] << " ";
    }
    cout << ans;
}
main(){
    /*#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif*/
    fast();
    ll t = 1; //cin >> t;
    while(t--){
        solve();
    }
}


Measured memory_bytes: 3328
/* Cut the Cake */
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <vector>
#include <map>
#define pb push_back
using namespace std;
typedef pair<int,int> pii;

int main(void){
  int n,w,d,p,s;
  int i,j,x,y;
  vector<pii> ps;
  vector<int> res;
  while(cin>>n>>w>>d){
    if((n|w|d)==0) break;
    ps.clear();
    res.clear();
    ps.pb(pii(w,d));

    for(i=0;i<n;i++){
      cin>>p>>s;
      p--;
      x=ps[p].first;
      y=ps[p].second;
      s%=x*2+y*2;
      if(x+y<=s&&s<=x+y+x) s=x+x+y-s;
      if(x+y+x<=s) s=x+x+x+y+y-s;
      //if(x+y<=s&&s<=x+y+x) s-=x+y;
      //if(x+y+x<=s) s-=x+y;
      if(s==x||s==x+y) cout<<"kusowarota"<<endl;
      if(s<=x){
	if(s<=x/2){
	  //ps[p].first=s;
	  //ps[p].second=y;
	  ps.erase(ps.begin()+p);
	  ps.pb(pii(s,y));
	  ps.pb(pii(x-s,y));
	}
	else{
	  //ps[p].first=x-s;
	  //ps[p].second=y;
	  ps.erase(ps.begin()+p);
	  ps.pb(pii(x-s,y));
	  ps.pb(pii(s,y));
	}
      }
      else {
	s-=x;
	if(s<=y/2){
	  //ps[p].first=x;
	  //ps[p].second=s;
	  ps.erase(ps.begin()+p);
	  ps.pb(pii(x,s));
	  ps.pb(pii(x,y-s));
	}
	else{
	  //ps[p].first=x;
	  //ps[p].second=y-s;
	  ps.erase(ps.begin()+p);
	  ps.pb(pii(x,y-s));
	  ps.pb(pii(x,s));
	}
      }
    }
    
    for(i=0;i<ps.size();i++){
      res.pb(ps[i].first*ps[i].second);
    }
    sort(res.begin(),res.end());
    for(i=0;i<res.size();i++){
      cout<<res[i];
      if(i!=res.size()-1) cout<<" ";
    }
    cout<<endl;
  }
  return 0;
}

Measured memory_bytes: 3068
#include<iostream>
#include<vector>
#include<algorithm>

#define REP(n) for(int i = 0;i < n;i++)
using namespace std;

int main(){

    int h,w;
    cin >> h >> w;
    //cout << "ab" << endl;

    vector<string> P(h);
    //cout << "h" << endl;
    REP(h){
        //cout << "in" << endl;
        cin >> P[i];
    }
    //cout << "a" << endl;
    REP(w+2){
        cout << "#";
    }
    cout << endl;

    
    REP(h){
        cout << '#' << P[i] << '#' << endl;
    }
    REP(w+2){
        cout << '#';
    }
    cout << endl;





    
   
    return 0;
}

Measured memory_bytes: 256
N, L = list(map(int, input().split()))
sum = 0

if L >= 0:
    sum = (L+L+N-1)*N/2 - L
elif 1 - N < L < 0:
    sum = (L+L+N-1)*N/2
else:
    sum = (L++L+N-1)*N/2 - (L + N - 1)
print(int(sum))

Measured memory_bytes: 3060
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using static System.Math;

namespace ConsoleApp
{
    class Program
    {

        static void Main(string[] args)
        {
            
            var ar = ReadLine().Split().Select(int.Parse).ToArray();
            var n = ar[0];
            var k = ar[1];

            WriteLine(Calc(n,k));
        }

        static int Calc(int n,int k){
            if(n < k)return 1;

            var next = (int)Math.Floor((double)n/k);
            return 1 + Calc(next, k);
        }


    }

}


Measured memory_bytes: 11348
H,W = map(int, input().split())
N = int(input())
src = list(map(int, input().split()))

ci = 0
for i in range(H):
    arr = []
    while len(arr) < W:
        l = min(W - len(arr), src[ci])
        arr += [ci+1] * l
        src[ci] -= l
        if src[ci] == 0: ci += 1
    if i%2 == 1:
        arr.reverse()
    print(' '.join(map(str,arr)))


Measured memory_bytes: 3188
n = int(input())
a = [int(x) for x in input().split()]

sm_e = []
sm_o = []

e = 0
o = 0

for i in range(n):
    if i % 2 == 0:
        e += a[i]
        sm_e.append(e)
    else:
        o += a[i]
        sm_o.append(o)

tot_e = sm_e[-1]
tot_o = sm_o[-1]

m = len(sm_o)

if n % 2 == 0:
    ans = max(tot_e, tot_o)
    for i in range(m):
        ans = max(ans, sm_e[i] + tot_o - sm_o[i])
    # for i in range(m-1):
    #     ans = max(ans, sm_o[i] + tot_e - sm_e[i+1])
    print(ans)
    exit()

ans = tot_o

for i in range(m):
    ans = max(ans, sm_e[i]+tot_o-sm_o[i])


l = [0]*m
for i in range(m):
    l[i] = sm_e[i]-sm_o[i]

val = l[0]
tmp = 0

for i in range(m-1):
    ans = max(ans, sm_o[i] + tot_e - sm_e[i+1])
    if i != 0:
        if val < l[i]:
            val = l[i]
    ans = max(ans, sm_o[i] + tot_e - sm_e[i+1] + val)

for i in range(n):
    if i % 2 == 0:
        ans = max(ans, tot_e - a[i])

print(ans)


Measured memory_bytes: 101484
// AOJ NTL_1- C Elementary Number Theory - Least Common Multiple
// 2017.10.31 bal4u@uu

#include <stdio.h>

int gcd(int a, int b)
{
	int r;
	while (b != 0) r = a % b, a = b, b = r;
	return a;
}

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

int main()
{
	int n, i, a, b;

	scanf("%d", &n);
	scanf("%d%d", &a, &b);
	a = lcm(a, b);
	for (i = 2; i < n; i++) {
		scanf("%d", &b);
		a = lcm(a, b);
	}
	printf("%d\n", a);
	return 0;
}

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


int main() {
  int n;
  int a[4][14] = {{}};
  cin >> n;
  for (int i = 0; i < n; i++) {
    char c;
    int num;
    cin >> c >> num;
    if (c == 'S'){
      a[0][num] = true;
    } else if (c == 'H') {
      a[1][num] = true;
    } else if (c == 'C') {
      a[2][num] = true;
    } else {
      a[3][num] = true;
    }
  }
  for (int i = 0; i < 4; i++) {
    for (int j = 1; j < 14; j++) {
      if(a[i][j] == false) {
        if (i == 0) {
          cout << "S "; 
        } else if (i == 1){
          cout << "H "; 
        } else if (i == 2) {
          cout << "C ";
        } else {
          cout << "D ";
        }

        cout << j << endl;
      }
    }
  }
  return 0;
}


Measured memory_bytes: 3104
s = list(map(int,input()))
li = []
for i in range(len(s) - 2):
    k = s[i] * 100 + s[i+1] * 10 + s[i + 2]
    if k < 753:
        a = 753 - k
        li.append(a)
    else:
        a = k - 753
        li.append(a)
print(min(li))

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

int main(){
    int a;
    cin >> a;
    int b[a];
    for(int i = 0; i < a; i++){
        cin >> b[i];
    }
    int cnt = 0;
    int num = 1;
    for(int i = 0; i < a; i++){
        if(b[i] == num){
            num++;
        }
        else cnt++;
    }
    if(num == 1){
        cnt = -1;
    }
    cout << cnt << endl;
    return 0;
}

Measured memory_bytes: 1024
n=int(input())
a=[int(j) for j in input().split()]

def nimod(n):
    ans=0
    while n:
        if n%2==0:
            ans+=1
            n=n//2
        else:
            break
    return ans

ans=0
for i in a:
    ans+=nimod(i)
    
print(ans)

Measured memory_bytes: 4148
#include <iostream>
#include <cstdio>
#include <string>
#include <cstring>
#include <algorithm>
#include <set>
#include <vector>
#include <queue>
#define pb push_back
using namespace std;
typedef pair<int,int> pii;
#define inf 1e9

int n,a,b,c;
vector<int> l;

int dfs(int cur, int x, int y, int z){
  if(cur == n){
    //printf("%d %d %d %d\n",cur,x,y,z);
    if(min(x,min(y,z))>0) return abs(a-x) + abs(b-y) + abs(c-z) -30;
    else return inf;
  }
  int ret0,ret1,ret2,ret3;
  ret0 = dfs(cur+1, x,y,z);
  ret1 = dfs(cur+1, x+l[cur],y,z) +10;
  ret2 = dfs(cur+1, x,y+l[cur],z) +10;
  ret3 = dfs(cur+1, x,y,z+l[cur]) +10;
  return min(min(ret0,ret1),min(ret2,ret3));
}


int main(){
  
  cin>>n>>a>>b>>c;
  l.resize(n);
  for(auto &x : l){
    cin>>x;
  }
  
  cout<<dfs(0,0,0,0)<<endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.List;
import java.util.Scanner;

//Search Engine
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		List<String> w = new ArrayList<String>();
		String[] s = sc.nextLine().replace(",", " ").replace("."," ").split(" ");
		for(String e:s)if(3<=e.length()&&e.length()<=6)w.add(e);
		boolean f = true;
		for(String e:w){
			if(!f)System.out.print(" ");
			System.out.print(e);
			f = false;
		}
		System.out.println();
	}
}

Measured memory_bytes: 25848
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi std::vector<std::vector<int> >
#define vvl std::vector<std::vector<ll> >
#define MODs 1000000007;
typedef long long int ll;
using namespace std;

vvl dot(vvl a, vvl b, ll M){
  vvl c = vv(a.size(), b[0].size(), 0, ll);
  for(int i=0;i<a.size();i++){
    for(int j=0;j<b[0].size();j++){
      for(int k=0;k<b.size();k++){
        c[i][j] = (c[i][j] + (a[i][k]*b[k][j])%M)%M;
      }
    }
  }
  return c;
}
int main(int argc, char const *argv[]) {
  ll L, A, B, M;
  cin >> L >> A >> B >> M;
  vector<ll> keta(19, 0);
  ll now = 1, wa=0;
  for(int i=0;i<18;i++){
    now *= 10;
    if(A >= now) keta[i+1]=0;
    else{
      keta[i+1] = (now-1 - A)/B + 1;
      keta[i+1]-=wa;
    }
    if(i==17) keta[i+1] = L - wa;
    if(wa + keta[i+1] <= L) wa += keta[i+1];
    else keta[i+1] = L - wa, wa = L;
  }
  now = 1;
  vvl ans = vv(1, 3, 0, ll);
  ans[0][0] = 0, ans[0][1] = A%M, ans[0][2] = 1;
  for(ll i=1;i<19;i++) {
    now *= 10;
    vvl c = vv(3, 3, 0, ll);
    c[0][0] = now%M, c[1][0] = 1, c[1][1] = 1, c[2][1] = B%M, c[2][2]=1;
    while(keta[i]>0){
      if(keta[i]%2==1) ans = dot(ans, c, M);
      c = dot(c, c, M);
      keta[i]/=2;
    }
  }
  std::cout << ans[0][0] << '\n';
  return 0;
}


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

long long a[7];
int main()
{
  for (int i = 0; i < 7; i++){
    cin >> a[i];
  }

  long long m = min(min(a[0], a[3]), a[4]);
  /*
  a[0] -= m;
  a[3] -= m;
  a[4] -= m;
  */

  long long ans = 0;
  for (int i = 0; i <= min(m, 1000000ll); i++){
    ans = max(ans, 3 * i + (a[0] - i) / 2 * 2 + (a[3] - i) / 2 * 2 + (a[4] - i) / 2 * 2);
  }

  cout << ans + a[1] << endl;
}


Measured memory_bytes: 384
N = int(input())
a = 2
ans = ""
for i in range(1000):
    if N % a == 0:
        ans = "0"+ans
    else:
        ans = "1"+ans
        if i % 2 == 0:
            N -= 2**i
        else:
            N += 2**i
    a *= 2
    if N == 0:
        break
print(ans)


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

template<class T> void vin(vector<T>& v, int n) {
    v.resize(n);
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
    }
}

int main() {
    ll K, A, B;
    cin >> K >> A >> B;

    ll b = 1, mon = 0;

    if (B - A - 1 <= 0 or K < A) {
        b += K;
        cout << b << endl;
        return 0;
    }

    b = A;
    K -= (A-1);

    b += (K/2)*(B-A);
    b += (K%2);

    cout << b << endl;


    //
    // rep(i, K) {
    //     if (B - A - 1 > 0 and B > 1) {
    //         if (mon > 0) {
    //             mon--;
    //             b += B;
    //         }
    //         else if (A > b) {
    //             b++;
    //         }
    //         else {
    //             if (i + 1 < K) {
    //                 mon++;
    //                 b -= A;
    //             }
    //             else {
    //                 b++;
    //             }
    //         }
    //     }
    //     else {
    //         b++;
    //     }
    // }
    // cout << b << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i <(n); ++i)
#define ALL(v) v.begin(), v.end()
using namespace std;
using ll = long long;
using P = pair<int,int>;
static const double PI = acos(-1);



int main(){
  int x,y;
  cin >> x >> y;
  int ans = x + y/2;
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3596
#include <iostream>
#include <fstream>
#include <iomanip>
#include <math.h>
#include <limits.h>
#include <algorithm>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <string>
#include <string.h>
#include <sstream>
#include <ctime>

using namespace std;

#define eps 1e-12
#define pi 3.14159265358979323846
#define pb push_back
#define mp make_pair
#define st first
#define nd second
#define bgn begin
#define ll long long
#define ld long double
#define ull unsigned long long
#define ii pair<ll,ll>











char x,y;


void solve()
{
	cin>>x>>y;
	if(x<y)cout<<"<\n";
	else if(x>y)cout<<">\n";
	else cout<<"=\n";
}

int main()
{
	std::ios::sync_with_stdio(0);
	cin.tie(0);
#ifdef localProject
	freopen("in.txt","r",stdin);
#endif
	solve();
	return 0;
}

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

namespace AtCoder.Abc
{
    class QuestionB
    {
        public static void Main(string[] args)
        {
            var sw = new System.IO.StreamWriter(Console.OpenStandardOutput()) { AutoFlush = false };
            Console.SetOut(sw);

            var inputLongArray = Console.ReadLine().Split(' ').Select(i => int.Parse(i)).ToArray();
            var x = inputLongArray[0];
            var y = inputLongArray[1];

            var a = 4 * x - y;
            var b = y - 2 * x;
            if(a<0 || a%2!=0 || b<0 || b%2!=0)
                Console.WriteLine("No");
            else
                Console.WriteLine("Yes");

            Console.Out.Flush();
        }
    }
}


Measured memory_bytes: 27988
S=list(input())
for i in range(4):
  S[i]=int(S[i])
for i in range(8):
  ans=S[0]
  s=format(i,"05b")
  A=[]
  for j in range(3):
    if s[-1-j]=="1":
      A.append(j)
  for i in range(3):
    if i in A:
      ans=ans+S[i+1]
    else:
      ans=ans-S[i+1]
  if ans==7:
    print(S[0],end="")
    for i in range(3):
      if i in A:
        print("+",end="")
      else:
        print("-",end="")
      print(S[i+1],end="")
    print("=7")
    break

Measured memory_bytes: 3064
#include<stdio.h>
int main(){
    int x, y;
    while(1){
        scanf("%d %d", &x, &y);
        if(x==0 && y==0){
            break;
        }
        if(x<y){
            printf("%d %d\n", x, y);
        }else{
            printf("%d %d\n", y, x);
        }
    }
    return 0;
}


Measured memory_bytes: 2048
/*
 *
 */
#include <cstdio>
#include <iostream>

#define DEBUG 0

using namespace std;

int main(){
    //freopen("d2.in", "r", stdin);

    string s;
    cin >> s;
    for (int i = 0; i < s.size() - 1; ++i) {
        if (s[i] == s[i+1]) {
            cout << (i+1) << " " << (i+2) << endl;
            return 0;
        }
        if (i < s.size() - 2) {
            if (s[i] == s[i+2]) {
                cout << (i+1) << " " << (i+3) << endl;
                return 0;
            }
        }
    }

    // impossible
    cout << -1 << " " << -1 << endl;

    return 0;
}


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

ll a(ll n) {
    if (n == 0) return 1;
    return 2 * a(n-1) + 3;
}

ll p(ll n) {
    if (n == 0) return 1;
    return 2 * p(n-1) + 1;
}

ll f(ll n, ll x) {
    if (x == 0) return 0;
    else if (n == 0) return 1;
    else if (1 <= x && x <= 1+a(n-1)) {
        return f(n-1, x-1);
    }
    else if (2+a(n-1) <= x && x <= 2+2*a(n-1)) {
        return p(n-1) + 1 + f(n-1, x-2-a(n-1));
    }
    else if (x == 3+2*a(n-1)) {
        return 2*p(n-1) + 1;
    }
    return 0;
}

int main() {
    ll n, x;
    cin >> n >> x;
    cout << f(n, x) << endl;
    return 0;
}

Measured memory_bytes: 256
N = int(input())
ans = ""
i = 0
while N != 0:
	if N % (2 ** (i + 1)) == 0:
		ans += "0"
	else:
		ans += "1"
		N -= (-2) ** i
	i += 1
if ans == "":
	print(0)
else:
	print(ans[::-1])

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

const ll mod = 1000000007;

int power(ll a, ll b=mod-2){
  ll res=1;
  while(b>0){
   if(b & 1) res=res*a%mod;
    a=a*a%mod;
    b>>=1;
  }
  
  return res;
  
}

int main(){
  ll n,k; 
  cin >> n >> k;
  k=min(k,n-1);
  vector<ll>fact1(n+1),fact2(n+1);
  fact1[0]=1;
  for(int i=1; i<=n; i++) fact1[i]=fact1[i-1]*i,fact1[i]%=mod;
  fact2[n]=power(fact1[n]);
  for(int i=n; i>=1; i--) fact2[i-1]=fact2[i]*i,fact2[i-1]%=mod;
  
  ll ans = 0;
  for(int i=0; i<=k; i++){
    ll x=1;
    x*=fact1[n];
    x%=mod;
    x*=fact1[n-1];
    x%=mod;
    x*=fact2[i];
    x%=mod;
    x*=fact2[i];
    x%=mod;
    x*=fact2[n-i];
    x%=mod;
    x*=fact2[n-i-1];
    ans+=x;
    ans%=mod;
  }
  
  cout << ans << endl; 
  
}
  
  


Measured memory_bytes: 3328
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = n - 1; i >= 0; i--)
using namespace std;
using Graph = vector<vector<int>>;
#define MOD 1000000007
#define MOD2 998244353
#define INF ((1<<30)-1)
#define LINF (1LL<<60)
#define EPS (1e-10)
typedef long long ll;
typedef pair<ll, ll> P;

int main(){
    string s;
    cin >> s;
    int ans = 0;
    rep(i, 6) ans += s[i] - '0';
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for(int i=0; i<(int)(n); ++i)
#define FOR(i, s, n) for(int i=(int)(s); i<(int)(n); ++i)
#define ALL(n) (n).begin(), (n).end()
#define pb push_back

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> mat;

const ll MAX_V = 100000;
const ll INF = 1e9;
const ll MOD = 998244353;

int main(){
    int n; cin >> n;
    vi a(n);
    int ans = 0;
    REP(i, n){
        cin >> a[i];
        ans += a[i];
    }
    ans -= n;
    cout << ans << endl;
}

Measured memory_bytes: 256
n,*t=map(int,open(0).read().split())
x=sorted(zip(t[1:n*2:2],t[:n*2:2]))
y=sorted(zip(t[n*2::2],t[n*2+1::2]))[::-1]
c=0
while y:
  i,j=y.pop()
  k=len(x)-1
  while k>=0:
    b,a=x[k]
    if a<i and b<j:
      c+=1
      del x[k]
      break
    k-=1
print(c)

Measured memory_bytes: 38768
#include<bits/stdc++.h>
#define rep(i,n)for(int i=0;i<(n);i++)
using namespace std;
#ifndef MAX
#define MAX 400000
#endif

//Range Add Query+Range Sum Query
template<class T>
class RAQ_RSQ {
public:
	int n;
	T dat[MAX], lazy[MAX], ZERO;
	void init(int n_) {
		ZERO = T();
		n = 1; while (n < n_)n <<= 1;
		for (int i = 0; i < 2 * n - 1; i++) {
			dat[i] = lazy[i] = ZERO;
		}
	}
	inline void push(int k, int s) {
		dat[k] = dat[k] + lazy[k] * s;
		if (k < n - 1) {
			lazy[k * 2 + 1] = lazy[k * 2 + 1] + lazy[k];
			lazy[k * 2 + 2] = lazy[k * 2 + 2] + lazy[k];
		}
		lazy[k] = ZERO;
	}
	inline void update_node(int k) {
		dat[k] = dat[k * 2 + 1] + dat[k * 2 + 2];
	}
	inline void update(int a, int b, T x, int k, int l, int r) {
		push(k, r - l);
		if (r <= a || b <= l)return;
		if (a <= l&&r <= b) {
			lazy[k] = lazy[k] + x; push(k, r - l); return;
		}
		update(a, b, x, k * 2 + 1, l, (l + r) / 2);
		update(a, b, x, k * 2 + 2, (l + r) / 2, r);
		update_node(k);
	}
	inline T query(int a, int b, int k, int l, int r) {
		push(k, r - l);
		if (r <= a || b <= l)return ZERO;
		if (a <= l&&r <= b)return dat[k];
		T lb = query(a, b, k * 2 + 1, l, (l + r) / 2);
		T rb = query(a, b, k * 2 + 2, (l + r) / 2, r);
		update_node(k);
		return lb + rb;
	}
	inline void update(int a, int b, T x) {
		update(a, b, x, 0, 0, n);
	}
	inline void update(int a, T x) {
		update(a, a + 1, x);
	}
	inline T query(int a, int b) {
		return query(a, b, 0, 0, n);
	}
	inline T query(int a) {
		return query(a, a + 1);
	}
};
RAQ_RSQ<long long>seg;
int main() {
	int n, q; scanf("%d%d", &n, &q);
	seg.init(n);
	rep(i, q) {
		int a, s, t; scanf("%d%d%d", &a, &s, &t); s--;
		if (a == 0) {
			int x; scanf("%d", &x);
			seg.update(s, t, x);
		}
		else printf("%lld\n", seg.query(s, t));
	}
}

Measured memory_bytes: 7324
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <list>
#include <vector>
using namespace std;

int main(int argc, char const *argv[]) {
  double x, y;
  double a, b, c, d, e, f;
  while (!(cin >> a >> b >> c >> d >> e >> f).eof()) {
    x = (e * c - b * f) / (a * e - b * d);
    y = (a * f - c * d) / (a * e - b * d);
    if (x == 0) {
      x = 0;
    }
    if (y == 0) {
      y = 0;
    }
    std::cout << fixed << setprecision(3) << x << " " << y << '\n';
  }
  return 0;
}



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

#define ALL(a) (a).begin(), (a).end()
#define llong long long

using namespace std;

signed main(){
	int n; cin >> n;
	vector<pair<string, pair<int,int>>> m;
	for(int i = 0; i < n; i++){
		string k; cin >> k;
		int p; cin >> p;
		m.push_back(make_pair(k,make_pair(-p,i+1)));
	}
	sort(ALL(m));
	for(auto e : m){
		cout << e.second.second << endl;
	}

	return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<fstream>
#include<algorithm>
using namespace std;
int n,k,a[55],h;
bool cmp(int a,int b)
{
    return a>b;
}
int main()
{
     cin>>n>>k;
     for(int i=1;i<=n;i++) cin>>a[i];
     sort(a+1,a+n+1,cmp);
     for(int i=1;i<=k;i++) h+=a[i];
     cout<<h<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define FOR(i, a, b) for (int i=(a); i<(b); i++)
using Graph = vector<vector<int>>;
int main() {
  string S,T;
  cin >> S >> T;
  int s = S.size();
  int t = T.size();
  int ans = t;
  FOR(i,0,s-t+1) {
    int dif = 0;
    FOR(j,i,i+t) {
      if(S[j] != T[j-i]) dif++;
    }
    ans = min(dif, ans);
  }
  cout << ans << endl;
      
  return 0;
}

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

int main() {
  int N;
  cin >> N;
  vector<int> vec(N, 0);
  for(int i=0; i< N; i++){
    int n;
    cin >> n;
    vec.at(i) = n;
  }
  sort(vec.begin(), vec.end()); 
  
  int count = 1;
  int point = vec.at(N-1);
  for(int i=N-2; i >= 0; i--){
    
    if(point > vec.at(i)){
      count++;
      point = vec.at(i);
    }
  }
  cout << count;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
using namespace std;
#include <bits/stdc++.h>
#include<utility>
#include <algorithm>
#include<iterator>
#define  go return 0
#define rep(i,n) for(int i=0;i<n;++i)
#define rep(j,m) for(int j=0;j<m;++j)
#define REP(i,n) for(int i=1;i<=n;++i)
#define all(v)   ((v).begin()), ((v).end())
#define len(s)   ((int)s.size())
#define F first
#define S second
#define pb push_back
#define pf push_front
#define mp make_pair
typedef long long ll;
typedef double db;
typedef vector<int> ve;
typedef vector<pair<char,int> >vepa;
typedef set<string>se;
typedef map<char ,int> mpp;
const ll N=1e5+5 ,OO=1e18;
const int di[]={1,-1,0,0};
const int dj[]={0,0,1,-1};
int TC,n,mx,a,arr[N];
bool vis[N],f;
int main()
{
ios::sync_with_stdio(0);
cin.tie(0);
  int i=1;
        while(cin>>n){
            if(n==0){ cout<<i;return 0; }
            i++;
        }

go;
}


Measured memory_bytes: 3612
import java.util.HashMap;
import java.util.Map;
import java.util.*;
import java.util.Arrays;
class Main {
    public static void main(String[] args) {
       int M = 0;
       Scanner scner = new Scanner(System.in);
        int T = 0;
        int n = scner.nextInt();
        int[] S = new int[n];
        for (int i=0; i<n; i++) {
            S[i] = scner.nextInt();
        }
        int f = scner.nextInt();
        for(int i = 0; i<f; ++i){
         int b = scner.nextInt();
        
       
       
       if(sSearch(S,b)){
                 System.out.println("yes");
             }else{
                 System.out.println("no");
             }

         }
      }
         public static Boolean sSearch(int[] a, int b){
        
        Boolean res=false;
        
        for(int j=0; j<a.length; ++j){
            if(seSearch(a,b,j)){
                res=true;
                break;
                
                
               }
        }
        return res;
    }

    public static Boolean seSearch(int[] a, int b,int k){
   
    if(b==0){
            return true;
        }else if(k>=a.length){
            return false;
        }
        
        
    
Boolean res=seSearch(a,b,k+1)||seSearch(a,b-a[k],k+1);
return res;

}
}


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


int main () {
    vector<long long int> vec;
    vector<long long int> vec2;
    int n, z;
    int ptr = 0;
    int ptr2 = 0;
    cin >> n;

    for (int i = 0 ; i < n; i++ ) {
        cin >> z;
        vec.push_back(z);

    }

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

    ptr2 = ptr;
    while (ptr < n) {
        while (ptr2+ptr < n && vec[ptr] == vec[ptr+ptr2]) {
            ptr2++;
        }
        if (ptr2 % 2 != 0) vec2.push_back(vec[ptr]);
        ptr += ptr2;
        ptr2 = 0;

    }

    cout << vec2.size() << endl;
    return 0;
}



Measured memory_bytes: 2548
x, y = map(int, input().split())
ans = 0
ans = abs(abs(x) - abs(y))
if x == y:
    print(0)
    exit()
if ans == 0:
    print(1)
    exit()
if x < 0 and y == 0:
    print(ans)
    exit()
if x > 0 and y == 0:
    print(ans + 1)
    exit()
if (x < 0 and y < 0) or (x >= 0 and y >= 0):
    if x > y:
        ans += 2
else:
    ans += 1

print(ans)


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

#define int long long
#define ll long long
#define pb push_back
#define mp make_pair
#define f(i,a,n) for(int i=a ; i<n ; i++)
#define rf(i,n,a) for(int i=n ; i>=a ; i--)
#define F first
#define S second
#define all(c) (c).begin(),(c).end()
#define sz(v) (int)(v).size()
#define fast ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)

typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef pair<pii,int> ppi;
typedef vector<pii> vpi;

const int inf = 1e9;
const int inf64 = 1e18;
const int MOD = inf + 7;

bool ok(int a , int b , int c , int k){
   if(b > a && c > b) return 1;
   if(k == 0) return 0;
   bool res = false;
   res |= ok(2*a , b , c , k-1) | ok(a , 2*b , c , k-1) | ok(a , b, 2*c , k-1);
   return res;
}

void solve(){
   int a,b,c,k;
   cin >> a >> b >> c >> k;

   if(ok(a,b,c,k)){
      cout << "Yes\n";
   }
   else{
      cout << "No\n";
   }
}

int32_t main(){
   fast;
   int t = 1;
   // cin >> t;
   while(t--)  solve();   
}

Measured memory_bytes: 3648
package main

import (
	"math"
	"fmt"
)

func main() {
	var S float64
	fmt.Scanf("%f", &S)
	if 0 >= S || S <= 86400 {
		if S < 60 {
			fmt.Printf("0:0:%d\n",int(S))
		}else if 60 >= S || S < 3600 {
			m := math.Floor(S / 60.0 )
			s := S - m*60
			fmt.Printf("0:%d:%d\n",int(m),int(s))
		}else if 3600 >= S || S <= 86400 {
			h := math.Floor(S / 3600.0 )
			m := math.Floor((S - h*3600)/60)
			s := S - h*3600 - m*60
			fmt.Printf("%d:%d:%d\n",int(h),int(m),int(s))
		}
	}
}




Measured memory_bytes: 1168
//inlclude before define 
#define _USE_MATH_DEFINES

//include
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<cmath>
#include<type_traits>
#include<numeric>
#include<deque>
#include<iomanip>
#include<set>
#include<unordered_set>
#include<tuple>
#include<map>
#include<memory>

using namespace std;

//typedef
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<char> VC;
typedef vector<double> VD;
typedef pair<int, int> P1;
typedef long long int ll;

//number
#define INF 1e9
#define NUM 1000000007

//itr
#define all(x) begin(x),end(x)

//repeat
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define REP(i,a,b) for(int i=int(a);i<int(b);i++)
#define RREPS(i,x) for(int i=((int)(x));i>=0;i--)

//max,min
#define chmin(a,b) a=min((a),(b))
#define chmax(a,b) a=max((a),(b))

//function

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

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

int dig(int a) {
	int sum = 0;
	while (a) {
		sum += a % 10;
		a /= 10;
	}
	return sum;
}

//grid template
int x[] = { -1, 0, 1, 0 };
int y[] = { 0,-1,0,1 };
int xx[] = { -1,-1,1,1 };
int yy[] = { 1,-1,1,-1 };

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

	if (a == 'A') {
		cout << 'T' << endl;
	} else if (a == 'T') {
		cout << 'A' << endl;
	} else if (a == 'G') {
		cout << 'C' << endl;
	} else if (a == 'C') {
		cout << 'G' << endl;
	}
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int mod=1e9+7;
int main()
{
    int h,w;
    cin>>h>>w;
    vector<vector<char>> path(h,vector<char>(w));
      for(int i=0;i<h;i++){
        for(int j=0;j<w;j++) cin>>path[i][j];
      }
     vector<vector<long long int>> dp(h,vector<long long int>(w));
     dp[0][0]=1;
      for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(path[i][j]=='.'){
                if(j-1>=0){
                    dp[i][j]=dp[i][j-1];
                }
                if(i-1>=0) dp[i][j]+=dp[i-1][j];
                dp[i][j]%=mod;

            }
        }
      }
      cout<<dp[h-1][w-1];
}


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

#define x first
#define y second
#define pii pair<int,int>
#define sz(x) (int)(x).size()
#define all(x) (x).begin(),(x).end()
using namespace std;
typedef long long LL;
const int maxn = 1e5+15;
int dp[maxn][4],pos[maxn],vis[15],n;
char s[maxn];
int main(){
    scanf("%d %s",&n,s+1);
    for(int i = 1;i <= n; ++i){
        pos[i] = vis[s[i]-'0'];
        vis[s[i]-'0'] = i;
    }
    dp[0][0] = 1;
    for(int i = 1;i <= n; ++i){
        dp[i][0] = 1;
        for(int j = 1;j <= 3; ++j){
            dp[i][j] = dp[i-1][j]+dp[i-1][j-1];
            if(pos[i]) dp[i][j] -= dp[pos[i]-1][j-1];
        }
    }
    cout << dp[n][3] << endl;
    return 0;
}

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

int main()
{
  int n, k;
  cin >> n;
  k = n;
  int sum = 0;
  while(k != 0)
  {
    sum += k % 10;
    k /= 10;
  }
  if(n % sum == 0)
  {
    cout << "Yes" << endl;
  }
  else
  {
    cout << "No" << endl;
  }
}

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

#define endl '\n'
#define lfs cout<<fixed<<setprecision(10)
#define ALL(a)  (a).begin(),(a).end()
#define ALLR(a)  (a).rbegin(),(a).rend()
#define spa << " " <<
#define fi first
#define se second
#define MP make_pair
#define MT make_tuple
#define PB push_back
#define EB emplace_back
#define rep(i,n,m) for(ll i = (n); i < (ll)(m); i++)
#define rrep(i,n,m) for(ll i = (m) - 1; i >= (ll)(n); i--)
using ll = long long;
using ld = long double;
const ll MOD1 = 1e9+7;
const ll MOD9 = 998244353;
const ll INF = 1e18;
using P = pair<ll, ll>;
template<typename T>
bool chmin(T &a,T b){if(a>b){a=b;return true;}else return false;}
template<typename T>
bool chmax(T &a,T b){if(a<b){a=b;return true;}else return false;}
ll median(ll a,ll b, ll c){return a+b+c-max({a,b,c})-min({a,b,c});}
void ans1(bool x){if(x) cout<<"Yes"<<endl;else cout<<"No"<<endl;}
void ans2(bool x){if(x) cout<<"YES"<<endl;else cout<<"NO"<<endl;}
void ans3(bool x){if(x) cout<<"Yay!"<<endl;else cout<<":("<<endl;}
template<typename T1,typename T2>
void ans(bool x,T1 y,T2 z){if(x)cout<<y<<endl;else cout<<z<<endl;}  
template<typename T>
void debug(vector<vector<T>>&v,ll h,ll w){for(ll i=0;i<h;i++)
{cout<<v[i][0];for(ll j=1;j<w;j++)cout spa v[i][j];cout<<endl;}};
void debug(vector<string>&v,ll h,ll w){for(ll i=0;i<h;i++)
{for(ll j=0;j<w;j++)cout<<v[i][j];cout<<endl;}};
template<typename T>
void debug(vector<T>&v,ll n){if(n!=0)cout<<v[0];
for(ll i=1;i<n;i++)cout spa v[i];cout<<endl;};
template<typename T>
vector<vector<T>>vec(ll x, ll y, T w){
  vector<vector<T>>v(x,vector<T>(y,w));return v;}
ll gcd(ll x,ll y){ll r;while(y!=0&&(r=x%y)!=0){x=y;y=r;}return y==0?x:y;}
vector<ll>dx={1,0,-1,0,1,1,-1,-1};
vector<ll>dy={0,1,0,-1,1,-1,1,-1};
template<typename T>
vector<T> make_v(size_t a,T b){return vector<T>(a,b);}
template<typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v(ts...))>(a,make_v(ts...));
}
template<typename T1, typename T2>
ostream &operator<<(ostream &os, pair<T1, T2>&p){
  return os << p.first << " " << p.second;
}  
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ll res=0,buf=0;
  bool judge = true;
  ll h,w;cin>>h>>w;
  if(h==1||w==1)cout<<1<<endl;
  else cout<<(h*w+1)/2<<endl;
  return 0;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
  val n = readInt()
  val xy = (1..n).map { readInts()?.let { it[0] to it[1] } }

  var sum = 0.0
  val list = (0 until n).map { it }.toMutableList()
  do {
    for (i in 0 until n - 1) {
      val a = xy[list[i]]
      val b = xy[list[i + 1]]
      val dx = a.first - b.first
      val dy = a.second - b.second
      val d = Math.sqrt((dx * dx + dy * dy).toDouble())
      sum += d
    }
  } while (nextPermutation(list))

  var fact = 1
  for (i in 1..n) {
    fact *= i
  }

  println(sum / fact)
}

fun nextPermutation(list: MutableList<Int>): Boolean {
  for (i in list.size - 2 downTo 0) {
    if (list[i] < list[i + 1]) {
      for (j in list.size - 1 downTo 0) {
        if (list[i] < list[j]) {
          val tmp = list[i]
          list[i] = list[j]
          list[j] = tmp
          list.subList(i + 1, list.size).reverse()
          return true
        }
      }
    }
  }
  list.reverse()
  return false
}

fun readString() = readLine()!!
fun readStrings() = readString().split(' ')
fun readInt() = readString().toInt()
fun readInts() = readStrings().map { it.toInt() }



Measured memory_bytes: 44140
#include <algorithm>
#include <cmath>
#include <cstdint>
#include <cstdio>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
#define rep(i, n) for(int(i) = 0; (i) < (n); (i)++)
#define FOR(i, m, n) for(int(i) = (m); (i) < (n); (i)++)
#define All(v) (v).begin(), (v).end()
#define pb push_back
#define MP(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
const int INF = 1 << 30;
const ll LINF = 1LL << 60;
const int MOD = 1e9 + 7;

int main() {
    int N, M;
    cin >> N >> M;
    vector<vector<int>> G(N, vector<int>());
    rep(i, M) {
        int a, b;
        cin >> a >> b;
        a--, b--;
        G[a].pb(b);
        G[b].pb(a);
    }
    queue<pii> que;
    que.push(MP(0, 0));
    vector<int> res(N, -1);
    while(!que.empty()) {
        auto x = que.front();
        que.pop();
        int d = x.first;
        int v = x.second;
        for(auto nv : G[v]) {
            if(res[nv] != -1)
                continue;
            res[nv] = v;
            que.push(MP(d + 1, nv));
        }
    }
    cout << "Yes" << endl;
    FOR(i, 1, N) { cout << res[i] + 1 << endl; }
    return 0;
}

Measured memory_bytes: 10628
#include <iostream>
#include <math.h>
#include <numeric>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <queue>
#include <queue>
#include <stack> 
#include <sstream>
#include <set>

typedef  long long ll;
const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};
const int dr[4] = {-1, 0, 1, 0};
const int dc[4] = { 0, 1, 0,-1};
const int INF = 1e9;
#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
int guki (int a){
    if(a%2==0) return 0;
    else return 1;
}
int gcd(int a, int b){
    if(a%b==0){
        return b;
    }else{
        return (gcd(b,a%b));
    }
}
int lcm(int a, int b){
    int x = gcd(a,b);
    return (a*b/x);
}

using namespace std;
// now

struct UnionFind {
    vector<int> d;
    UnionFind(int n=0) : d(n,-1){}
    int Find (int x){//根の番号を探す
        if(d[x] < 0) return x;
        return d[x] = Find(d[x]);
    }
    bool unite (int x, int y){
        x = Find(x); y = Find(y);
        if(x == y ) return false;
        if(d[x] < d[y]){
            swap(x,y);
        }
        d[x] += d[y];
        d[y] = x;
        return true;
    } 

    bool same(int x, int y){
        return Find(x) == Find(y);
    }
    int size(int x) {
        return (-d[Find(x)]);
    }
};


ll nCr (ll n, ll r){
    ll ans = 1;
    for(ll i = n ; i > n-r ; i --){
        ans *= i;
    }
    for(ll i = 1 ; i<= r; i ++){
        ans /= i;
    }
    return ans ;
}

int nPr (int n,int r){
    int ans = 1;
    for(int i = n ; i > n-r ; i --){
        ans *= i;
    }
    return ans ;
}
 ll modd = 1e9+ 7;
ll wa (ll n,ll mi, ll ma){
    ll ans  = n * (mi+ma) /2;
    return ans;
}
ll kw(ll k,ll n){
    
    ll ans  =0;
    ll mi,ma;
    mi= wa(k,0,k-1);
    
    ma = wa(k,n-k+1,n);
    
    return (ma-mi +1)%modd;
}

int main(){
    double d,t,s;

    cin >> d >> t >>s;

    if(d/s <= t){
        cout <<"Yes" <<endl;
    }else{
        cout <<"No" <<endl;
    }
}





Measured memory_bytes: 3716