akhauriyash/Code-Regression huggingface dataset:
S=input()
k=[0]*2019
t=0
k[0]=1
for i,s in enumerate(S[::-1]):
  t+=int(s)*pow(10,i,2019)
  t%=2019
  k[t]+=1
  
ans=0
for l in k:
  ans+=l*(l-1)//2
print(ans)

Measured memory_bytes: 68580
#include <iostream>
#include <cstdio>
#include <vector>
using namespace std;

int main(){
    long long n, m, k;
    cin >> n >> m >> k;
    vector<long long> a(n);
    vector<long long> b(m);

    for(long long i = 0; i < n; i++) cin >> a[i];
    for(long long j = 0; j < m; j++) cin >> b[j];

    vector<long long> sum_a(n+1, 0);
    vector<long long> sum_b(m+1, 0);

    for(long long i = 0; i < n; i++) sum_a[i+1] = sum_a[i] + a[i];
    for(long long i = 0; i < m; i++) sum_b[i+1] = sum_b[i] + b[i];

    long long start_j = m;
    long long ans = 0;
    for(long long i = 0; i <= n; i++){
        if(sum_a[i] > k) break;

        long long j = start_j;
        while(j >= 0 and sum_a[i] + sum_b[j] > k){
            j--;
        }
        start_j = j;
        ans = max(ans, i+start_j);
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 9536
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
using namespace std;

int main(){

  string ans;
  char c;

  while(scanf("%c",&c) != EOF){
    if('a'<=c && c<='z'){
      c = c-('a'-'A');
    }
    ans+=c;
  }

  cout << ans ;

  return 0;
}

Measured memory_bytes: 1176
#include <bits/stdc++.h>
#define mxn 200005

using namespace std;

string cad;

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);

    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);

    cin >> cad;
    if (cad == "ABC")
        cout << "ARC\n";
    else cout << "ABC\n";
    
    return 0;
}

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

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

#pragma GCC optimize("O3")
#define FASTIO  ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define F first
#define S second
#define PB push_back
#define EB emplace_back
#define endl "\n"
#define gc getchar_unlocked
typedef long long ll;
typedef long double ld;
const double PI=acos(-1.0);
const int mod = 1000000007;




int main()
{
    FASTIO
	
	  ll n,x;
	  cin>>n>>x;
	  ll ans=3*(n-__gcd(n,x));
	  cout<<ans<<endl;

	return 0;
}




Measured memory_bytes: 384
fun main(args: Array<String>){
    val input = readLine()!!.toInt()
    var total = 0L
    for (i in 1..input){
        if ((i % 3 == 0) || (i % 5 == 0)){
            //足さない
        }else{
            total += i
        }
    }
    println(total)
}

Measured memory_bytes: 34508
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <vector>
#include <queue>
#include <cstdio>
#include <cmath>
#include <string>
#include <stack>
#include <cctype>
using namespace std;

#define INF 0x7fffffff
#define eps 1e-12
#define MOD 10000007


struct point
{
    char name[25];
    int a,e;

};
point p[1015];


bool cmp(point a,point b)
{
    return a.a<b.a;
}

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

        if(n==0&&q==0)
            break;
               int x,y;
        for(int i=0; i<n; i++)
        {
            cin>>p[i].name;
            cin>>x>>y;
            p[i].a=y-x+1;
            p[i].e=y;

        }
        sort(p,p+n,cmp);
        int ss;
        for(int i=0; i<q; i++)
        {
            cin>>ss;
            int id=-1;
            bool k=1;
            for(int j=0; j<n; j++)
                if(p[j].a<=ss&&p[j].e>=ss)
                {
                    id=j;
                    break;
                }
            if(id==-1)
                k=0;
            if(!k)
                puts("Unknown");

            else
                cout<<p[id].name<<" "<<ss-p[id].a+1<<endl;
        }

    }

    return 0;
}

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

template<typename A, typename B> bool chmin(A &a, const B &b){ return b < a && (a = b, true); }
template<typename A, typename B> bool chmax(A &a, const B &b){ return a < b && (a = b, true); }

int main(){
  int a,b,c,d;
  cin >> a >> b >> c >> d;
  for (int i = 0; i < 300; i++){
    if (i % 2 == 0){
      if (c - b > 0){
        c -= b;
      }
      else{
        cout << "Yes\n";
        return 0;
      }
    }
    else{
      if (a - d > 0){
        a -= d;
      }
      else{
        cout << "No\n";
        return 0;
      }
    }
  }
  return 0;
}

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

int main()
{
  string s;
  char c[16];

  cin >> s;
  int t = 0;
  for (int i = 0; i < s.size(); i++){
    if (s[i] == 'B'){
      if (t) t--;
    } else {
      c[t++] = s[i];
    }
  }

  for (int i = 0; i < t; i++){
    cout << c[i];
  }
  puts("");
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, z, n) for(int i = z; i < n; i++)
#define all(v) v.begin(), v.end()
typedef long long ll;
#define PI 3.14159265358979
//const int64_t INF = 1LL << 60;
const int INF = 1 << 29;
const int64_t MOD = 1000000007;
//const int64_t INF = 998244353;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
using namespace std;
//#define P pair<int, int>
typedef pair<int, int> P;

int main(){
    int N;
    cin >> N;
    vector<P> p(N);
    rep(i, 0, N){
        int A;
        cin >> A;
        p.at(i) = make_pair(A, i);
    }
    sort(all(p));
    rep(i, 0, N){
        int y = p.at(i).second + 1;
        cout << y << " ";
    }
    cout << endl;
}

Measured memory_bytes: 1664
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
		while(true){
			StringBuffer[] ice = new StringBuffer[10];
		
			int n = sc.nextInt();
			if(n==0) break;
		
			for(int i=0; i<10; i++)
				ice[i] = new StringBuffer("-");
			
			for(int i=0; i<n; i++){
				int a = sc.nextInt();
				
				if(ice[a].toString().equals("-")){
					ice[a].delete(0,1);
					ice[a].append("*");
				}
				else{
					ice[a].append("*");
				}
			}
		
			for(int i=0; i<10; i++)
				System.out.println(ice[i]);
		}
		
	
	}
}

Measured memory_bytes: 61488
#include <string>
#include <bits/stdc++.h>
using namespace std;
int main()
{
    string s , ans;
    cin >> s;
    for(int i = 0; i < s.size(); i ++){
        if(s[i] == '0'){
            ans.push_back('0');
        }else if(s[i] == '1'){
            ans.push_back('1');
        }else{
            if(ans.size()!=0){
                ans.pop_back();
            }
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef pair<int, int> P;
typedef long long ll;
int main(){
    int a,b;
    cin >> a >> b;
    if(a>9 || b>9){
        cout << "-1" << endl;
    }
    else{
        cout << a*b << endl;
    }
return 0;
}

Measured memory_bytes: 256
using System;

class abc122_A
{
    static void Main(string[] args)
    {
        var k = Console.ReadLine();
        String r = null;
        switch(k) {
            case "A":
                r = "T";
                break;
            case "T":
                r = "A";
                break;
            case "C":
                r = "G";
                break;
            case "G":
                r = "C";
                break;
        }

        Console.WriteLine(r);
    }
}

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

int main(void) {
  string board[8];
  bool check;
  
  while(cin >> board[0]) {
    check = false;
    for(int i = 1; i < 8; ++i) {
      cin >> board[i];
    }
    for(int i = 0; i < 8; ++i) {
      for(int j = 0; j < 8; ++j) {
        if(board[i][j] == '1' && !check) {
          if(i <= 4 && board[i + 3][j] == '1') {
            cout << "B" << endl;
            check = true;
          } else if(j <= 4 &&  board[i][j + 3] == '1') {
            cout << "C" << endl;
            check = true;
          } else if(i <= 5 && j >= 1 && board[i + 2][j - 1] == '1') {
            cout << "D" << endl;
            check = true;
          } else if(i <= 6 && j <= 5 && board[i + 1][j + 2] == '1') {
            cout << "E" << endl;
            check = true;
          } else if(i <= 5 && j <= 6 && board[i + 2][j + 1] == '1') {
            cout << "F" << endl;
            check = true;
          } else if(i <= 6 && 1 <= j && j <= 6 &&board[i + 1][j - 1] == '1') {
            cout << "G" << endl;
            check = true;
          } else if(i <= 6 && j <= 6){
            cout << "A" << endl;
            check = true;
          }
        }
      }
    }
  }
  return 0;
}


Measured memory_bytes: 3200
#include <bits/stdc++.h>
using namespace std;
typedef int ll;
typedef pair<ll,ll> pl;
const ll asize=505;
ll n,m[asize][asize],x[4]={-1,0,1,0},y[4]={0,1,0,-1};
bool o[asize][asize];

int main() {
	ios_base::sync_with_stdio(0),cin.tie(NULL);
	ll k,n2,r,c,v;
	cin>>n;
	n2=n*n;
	for(int i=1;i<=n;i++)for(int j=1;j<=n;j++)m[i][j]=1e9,o[i][j]=1;
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			m[i][j]=min(m[i][j],i-1);
			m[i][j]=min(m[i][j],j-1);
			m[i][j]=min(m[i][j],n-i);
			m[i][j]=min(m[i][j],n-j);
		}
	}
/*	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			cout<<m[i][j]<<" ";
		}
		cout<<"\n";
	}*/
	ll sum=0;
	for(int i=0;i<n2;i++){
		cin>>k;
		r=((k-1)/n)+1;
		c=k%n;
		if(c==0)c=n;
	//	printf("k=%d r=%d c=%d\n",k,r,c);
		sum+=m[r][c];
		o[r][c]=0;
		queue<pair<pl,ll> >q;
		q.emplace(make_pair(r,c),m[r][c]);
		while(!q.empty()){
			r=q.front().first.first,c=q.front().first.second,v=q.front().second;
	//		printf("v=%d r=%d c=%d\n",v,r,c);
			q.pop();
			for(int j=0;j<4;j++){
				if(r+x[j]<1||r+x[j]>n||c+y[j]<1||c+y[j]>n)continue;
				if(m[r+x[j]][c+y[j]]>v){
					m[r+x[j]][c+y[j]]=v;
					q.emplace(make_pair(r+x[j],c+y[j]),v+o[r+x[j]][c+y[j]]);
				}
			}
		}
	
/*	cout<<"\n";
	for(int i=1;i<=n;i++){
		for(int j=1;j<=n;j++){
			cout<<m[i][j]<<" ";
		}
		cout<<"\n";
	}*/
}
	cout<<sum;
	return 0;
}

Measured memory_bytes: 4856
#include<stdio.h>

#define nmax 10000
#define qmax 500

int linearSearch(int);

int n;
int A[nmax];

int main(){
  int q, i, cnt=0;
  int B[qmax];

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

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

  for(i=0 ; i<q ; i++) cnt += linearSearch(B[i]);

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

int linearSearch(int key){
  int i;

  i = 0;
  A[n] = key;
  
  while(A[i] != key) i++;

  if(i==n) return 0;

  return 1;
}

Measured memory_bytes: 636
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        x: [i64; 5],
    }

    let mut ans = 0;

    for i in 0..5 {
        if x[i] == 0 {
            ans = i + 1;
        }
    }
    println!("{}", ans)
}




Measured memory_bytes: 2048
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <cctype>
#include <string>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <functional>

using namespace std;
using ll = long long int;
#define rep(i,n) for(int i = 0; i < n; i++)
#define FOR(i, a, b)  for(int i = (a); i < (b) ; i++)

#define pb push_back
#define SORT(v,n) sort(v, v+n)
#define ALL(x) (x).begin(),(x).end()
#define debug(x) cerr << #x << ": " << x << '\n'
#define elif else if
#define itn ll
#define int ll
const int INF = 100100100;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
///                →,↑,←,↓,↗,↖,↙,↘
int dx[8] = { 1, 0, -1, 0, 1, -1, -1, 1 };
int dy[8] = { 0, 1, 0, -1, 1, 1, -1, -1 };

static const int MAX = 100000;
static const int NIL = -1;
int n, m;
vector<int> G[MAX];
int color[MAX];

void dfs(int r , int col) {
	stack<int> s;
	s.push(r);
	color[r] = col;
	while (!s.empty()) {
		int u = s.top();
		s.pop();
		int i;
		rep(i, G[u].size()) {
			int v = G[u][i];
			if (color[v] == NIL) {
				color[v] = col;
				s.push(v);
			}
		}
	}
}

void assignCol() {
	int col = 1;
	int i;
	rep(i, n) color[i] = NIL;
	rep(i, n) {
		if (color[i] == NIL)
			dfs(i,col++);
	}
}

signed main() {
	ios::sync_with_stdio(false);
	int q;
	cin >> n >> m;
	int i,s,t;
	rep(i, m) {
		cin >> s >> t;
		G[s].pb(t);
		G[t].pb(s);
	}
	assignCol();
	cin >> q;
	rep(i, q) {
		cin >> s >> t;
		if (color[s] == color[t])
			cout << "yes\n";
		else
			cout << "no\n";
	}
	return 0;
}


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

int main()
{
        long long W, H, x, y;
        double two = 2.0000000000;
        cin >> W >> H >> x >> y;

        double ans = (double)W * (double)H / two;

        if(W % 2 != 0 or H % 2 != 0)
        {
                cout << setprecision(10) << ans << ' ' << '0' << endl;
                return 0;
        }
        else
        {
                if(W / 2 == x and H / 2 == y)
                {
                        cout << setprecision(10) << ans << ' ' << '1' << endl;
                        return 0;
                }
                else
                {
                        cout << setprecision(10) << ans << ' ' << '0' << endl;
                        return 0;
                }
        }

        return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include<cstring>
#include<algorithm>
#include<cmath>
#define LL long long

using namespace std;
//#define debug
int main()
{
	#ifdef debug
	freopen("test2.txt","r",stdin);
	#endif
	int a,b,c,k;
	cin>>a>>b>>c;
	cin>>k;
	int temp = max(a,max(b,c));
	int sum=a+b+c;
	cout<<sum+temp*(pow(2,k)-1)<<endl;
	return 0;
}

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

#define  int  long long
#define  endl  '\n'
const int mod = 1e9 + 7;


int32_t main()
{ 
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
 
  
  int n;
  cin >> n;
  int ans = 0;

  cout << n * n * n;
  
  return 0;
}

Measured memory_bytes: 256
fun main(argc :Array<String>){
    var (A,Num) = readLine()!!.split(" ").map(String::toInt)
    var Q = 0 
    if(A <= 5){
        Q = 0
    }else if( A <= 12){
        Q = Num/2
    }else{
        Q = Num
    }
    println(Q)
}

Measured memory_bytes: 38032
#!/usr/bin/env python3
import sys, math, itertools, collections, bisect
input = lambda: sys.stdin.buffer.readline().rstrip().decode('utf-8')
inf = float('inf') ;mod = 10**9+7
mans = inf ;ans = 0 ;count = 0 ;pro = 1

n = int(input())
S = input()
s1 = S[:n];s2 = S[n:][::-1]
C1 = collections.Counter()
C2 = collections.Counter()
for bit in range(2**n):
  tmp10 = ""
  tmp11 = ""
  tmp20 = ""
  tmp21 = ""
  for i in range(n):
    if bit >> i & 1:
      tmp10 += s1[i]
      tmp20 += s2[i]
    else:
      tmp11 += s1[i]
      tmp21 += s2[i]
  C1[(tmp10,tmp11)] += 1
  C2[(tmp21,tmp20)] += 1
for key,item in C1.items():
  ans += C2[key] * item 
print(ans)


Measured memory_bytes: 174332
#include<bits/stdc++.h>
 
int main(){
  long long n, k, ans;
  scanf("%lld%lld", &n, &k);
  ans = (n/k)*(n/k)*(n/k);
  if(!(k%2)) ans += ((n+k/2)/k)*((n+k/2)/k)*((n+k/2)/k);
  printf("%lld\n", ans);
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define range(i, a, b) for (int i = (a); i < (b); i++)
#define rep(i, b) for (int i = 0; i < (b); i++)
#define ranger(i, a, b) for (int i = (a)-1; i >= (b); i--)
#define repr(i, b) for (int i = (b)-1; i >= 0; i--)
#define all(a) (a).begin(), (a).end()
#define show(x) cerr << #x << " = " << (x) << endl;
#define int long long
using namespace std;

template <typename X, typename T>
auto vectors(X x, T a) {
	return vector<T>(x, a);
}
template <typename X, typename Y, typename Z, typename... Zs>
auto vectors(X x, Y y, Z z, Zs... zs) {
	auto cont = vectors(y, z, zs...);
	return vector<decltype(cont)>(x, cont);
}

template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
	rep(i, v.size()) { os << v[i] << (i == v.size() - 1 ? "" : " "); }
	return os;
}
template <typename T, typename S>
ostream& operator<<(ostream& os, pair<T, S>& p) {
	os << '(' << p.first << ',' << p.second << ')';
	return os;
}
template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
	for (T& x : v) { is >> x; }
	return is;
}

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

	vector<int> a(n);
	cin >> a;

	int sum = accumulate(all(a), 0LL);
	int t = 0;

	int ans = 1e18;
	rep(i, n) {
		sum -= a[i];
		t += a[i];
		ans = min(ans, abs(sum - t));
	}
	cout << ans << endl;
}


Measured memory_bytes: 1792
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.NoSuchElementException;

public class Main {

	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);

		int n = sc.nextInt();
		int[] c = new int[n - 1];
		int[] s = new int[n - 1];
		int[] f = new int[n - 1];
		for (int i = 0; i < n - 1; i++) {
			c[i] = sc.nextInt();
			s[i] = sc.nextInt();
			f[i] = sc.nextInt();
		}

		for (int i = 0; i < n; i++) {
			int ans = 0;

			for (int j = i; j < n - 1; j++) {
				if (ans <= s[j]) {
					ans = s[j];
				} else {
					ans += (f[j] - ans % f[j]) % f[j];
				}
				ans += c[j];
			}

			System.out.println(ans);
		}

		out.flush();
	}

}

class FastScanner {
	private final InputStream in = System.in;
	private final byte[] buffer = new byte[1024];
	private int ptr = 0;
	private int buflen = 0;

	private boolean hasNextByte() {
		if (ptr < buflen) return true;
		else {
			ptr = 0;
			try {
				buflen = in.read(buffer);
			} catch (IOException e) {
				e.printStackTrace();
			}
			if (buflen <= 0) return false;
		}
		return true;
	}

	private byte readByte() {
		if (hasNextByte()) return buffer[ptr++];
		return -1;
	}

	private boolean isPrintableChar(byte c) {
		return '!' <= c && c <= '~';
	}

	private void skipUnprintable() {
		while (hasNextByte() && !isPrintableChar(buffer[ptr])) {
			ptr++;
		}
	}

	public boolean hasNext() {
		skipUnprintable();
		return hasNextByte();
	}

	public String next() {
		if (!hasNext()) throw new NoSuchElementException();
		StringBuilder sb = new StringBuilder();
		byte b = readByte();
		while (isPrintableChar(b)) {
			sb.appendCodePoint(b);
			b = readByte();
		}
		return sb.toString();
	}

	public int nextInt() {
		if (!hasNext()) throw new NoSuchElementException();
		int n = 0;
		boolean minus = false;
		byte b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) throw new NumberFormatException();
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		return a;
	}

	public long nextLong() {
		if (!hasNext()) throw new NoSuchElementException();
		long n = 0;
		boolean minus = false;
		byte b = readByte();
		if (b == '-') {
			minus = true;
			b = readByte();
		}
		if (b < '0' || '9' < b) throw new NumberFormatException();
		while (true) {
			if ('0' <= b && b <= '9') {
				n *= 10;
				n += b - '0';
			} else if (b == -1 || !isPrintableChar(b)) {
				return minus ? -n : n;
			} else {
				throw new NumberFormatException();
			}
			b = readByte();
		}
	}

	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++) {
			a[i] = nextInt();
		}
		return a;
	}
}

Measured memory_bytes: 22100
#include <iostream>
#include <cstring>
#include <algorithm>
#define ll long long
using namespace std;

ll arr[100005];
ll prefsum[100005];
int main()
{
    int n;
    cin >> n;
    
    for (int i = 1; i <= n; i++){
        cin >> arr[i];
    }
    
    sort (arr+1, arr+n+1);
    
    for (int i = 1; i <= n; i++){
        if (i == 1)
            prefsum[i] = arr[i];
        else
            prefsum[i] = arr[i] + prefsum[i-1];
    }
    
    int cntr = 1;
    for (int i = n; i > 1; i--){
        if (2*prefsum[i-1] >= arr[i])
            cntr++;
        else{
            cout << cntr << endl;
            return 0;
        }
    }
    
    cout << cntr << endl;
    return 0;
}

//2 6 8 10 16 35 200
//2 8 16 26 42 77 277

//1 2 7 20 30 40
//1 3 10 30 60 100
//1 2 3  4   5;


Measured memory_bytes: 5152
n = int(input())

pair = []
for i in range(n):
	pair.append(list(map(str, input().split())))

sum = 0
for i in range(n):
	if pair[i][1] == 'BTC':
		sum += 380000 * float(pair[i][0])
	else:
		sum += float(pair[i][0])
print(sum)

Measured memory_bytes: 3064
import functools
import math

k = int(input())
cnt = 0


def gcd(a, b, c):
    return functools.reduce(math.gcd, [a, b, c])


for a in range(1, k+1):
    for b in range(1,k+1):
        for c in range(1, k+1):
            cnt += gcd(a, b, c)

print(cnt)

Measured memory_bytes: 69668
#include <stdio.h>

int main()
{
  int i, n, k, P, ld, m, head, tail;
  fscanf(stdin, "%d %d", &n, &k);
  int w[n];
  head = tail = 0;
  for (i=0; i<n; i++) {
    fscanf(stdin, "%d", w+i);
    tail += w[i];
  }    

  while (head<tail-1) {
    P = (head+tail)/2;
    ld = 0; 
    m = 1;
    for (i=0; i<n; i++) {
      ld += w[i];
      if (ld>P) { 
	m++; 
	if (k<m) break; 
	if (w[i]>P) break;
	ld = w[i];
      }
    }
    if (i==n)  tail=P;
    else       head=P;
  }
  printf("%d\n", tail);

  return 0;
}


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

int main(){
  string s,t;
  cin >> s >> t;
  s += s;
  int n = 0;
  //cout << s << endl;
  for (int i = 0; i < t.size(); i++){
    int c = 0;
    for (int j = 0; j < t.size(); j++){
      if (t.at(j) == s.at(j+i)){
        c++;
      }
    }
    if (c == t.size()){
      cout << "Yes" << endl;
      n = 1;
      break;
    }
  }
  if (n == 0){
    cout << "No" << endl;
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int a[5],i,j;
  for(i=0;i<5;i++)
  {
    cin>>a[i];
  }
  for(i=0;i<5;i++)
  {
    if(a[i]==0)
    {
    	cout<<i+1;
      	break;
    }
  }
}

Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
 
int main(){
    string S, T;
    cin >> S >> T;
    
    // Tの長さ <= Sの長さ
    int l = S.size() - T.size() + 1;
    int ans = 9999;
    for(int i=0;i<l;i++){
        string t = S.substr(i, T.size()); 
        int dif = 0;
        for(int j=0;j<t.size();j++){
            if(T[j] != t[j])
                dif++;
        }
        if(dif < ans)
            ans = dif;
    }
        
    cout << ans << endl;
    
}

Measured memory_bytes: 3624
N=int(input())
dp=[True]*55556
dp[0]=False
dp[1]=False
for i in range(2,55556):
    if dp[i]:
        h=i+i
        while h<55556:
            dp[h]=False
            h+=i
ans=[]
for i in range(55556):
    if dp[i] and i%5==1: ans.append(i)
for a in ans[:N]:
    print(a,end=' ')

Measured memory_bytes: 3572
/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pint;
const int MAX = 510000;
const int MOD = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define Rep(i, n) for(ll i = 1; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll fac[MAX], finv[MAX], inv[MAX];


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;
}
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }

}
ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


ll GCD(ll a,ll b) {
  return b ? GCD(b,a%b) : a;
}


ll LCM(ll a,ll b){
  return a/GCD(a,b)*b;
}


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

void runlength(string s,vector<pair<char,ll>> &p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
}

ll COM(ll n,ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}


string Toupper(string s){
  string ans="";
  rep(i,s.size()){
    if('a'<=s[i] && s[i]<='z') ans+=(char)s[i]-32;
    else ans+=s[i];
  }
  return ans;
}
string Tolower(string s){
  string ans="";
  rep(i,s.size()){
    if('A'<=s[i] && s[i]<='Z') ans+=(char)s[i]+32;
    else ans+=s[i];
  }
  return ans;
}


const int MAX_N=100010;
vector<bool> sieve_of_eratosthenes(){
  vector<bool> isPrime(MAX_N+1,true);
  for(int i=2;i<=MAX_N;i++){
    if(isPrime[i]){
      for(int j=2*i;j<=MAX_N;j+=i){
        isPrime[j]=false;
      }
    }
  }
  return isPrime;
}

vector<pint> prime_factorize(ll n){
  vector<pint> ans;
  for(ll p=2;p<=sqrt(n);p++){
    if(n%p!=0) continue;
    ll cnt=0;
    while(n%p==0){
      n/=p;
      cnt++;
    }
    ans.push_back(make_pair(p,cnt));
  }
  if(n!=1) ans.push_back(make_pair(n,1));
  return ans;
}

bool cmp(pint a, pint b) { return a.second < b.second; }

/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll n;
  cin>>n;
  vector<pint> v;
  rep(i,n){
    ll a;cin>>a;
    v.push_back(pint(i+1,a));
  }
  sort(ALL(v),cmp);
  rep(i,n){
    cout<<v[i].first<<' ';
  }
  cout<<endl;
}

Measured memory_bytes: 2544
#include <stdio.h>
#include <stdlib.h>
typedef struct
{
    long int n;
    long long int p;
    long long int q;
} Dishpoint;
int bw(const void *, const void *);
int main()
{
    long int n;
    Dishpoint disht[100010], disha[100010];
    long long int taka = 0, aoki = 0;
    scanf("%ld", &n);
    for (long int i = 0; i < n; i++)
    {
        disht[i].n = i;
        disha[i].n = i;
        scanf("%lld %lld", &(disht[i].p), &(disha[i].p));
        disht[i].q = disha[i].p;
        disha[i].q = disht[i].p;
    }
    qsort(disht, n, sizeof(disht[0]), bw);
    qsort(disha, n, sizeof(disha[0]), bw);
    int used[100010] = {};
    long int takan = 0, aokin = 0;
    for (long int i = 0; i < n; i++)
    {
        if (i % 2) //aoki
        {
            while (used[disha[aokin].n])
            {
                aokin++;
            }
            used[disha[aokin].n] = 1;
            aoki += disha[aokin].p;
        }
        else //taka
        {

            while (used[disht[takan].n])
            {
                takan++;
            }
            used[disht[takan].n] = 1;
            taka += disht[takan].p;
        }
    }
    printf("%lld", taka - aoki);
    return 0;
}
int bw(const void *a, const void *b)
{
    long long int r;
    int ri;
    r = (*(Dishpoint *)a).p - (*(Dishpoint *)b).p + (*(Dishpoint *)a).q - (*(Dishpoint *)b).q;
    ri = (r > 0) ? 1 : -1;
    return -ri;
}


Measured memory_bytes: 7636
#include <iostream>
#include <vector>
#include <numeric>
using namespace std;

typedef long long ll;

bool solve(const int n, const vector<int> & in){
  ll sum = accumulate(in.begin(), in.end(), 0LL);

  if (sum % ((static_cast<long long>(n) * static_cast<long long>(n+1))/2)
	      != 0){
    return false;
  }
  ll k = sum / ((static_cast<long long>(n) * static_cast<long long>(n+1))/2);

  ll ops = 0;
  for(int i = 0;i < n;i++){
    ll tmp = in[(i+1)%n] - in[i] - k;
    if (tmp <= 0 &&  - tmp % n == 0){
      ops += -tmp / n;
    }else return false;
  }
  return ops == k;
}

int main(){
  int n;
  cin >> n;
  vector<int> in(n);
  for(int i = 0;i < n;i++){
    cin >> in[i];
  }
  if (solve(n, in)){
    cout <<"YES" << endl;
  } else {
    cout <<"NO" << endl;
  }
  return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <array>
#include <set>
#include <cmath>
#include <string>
#include <queue> //std::priority_queue<int> que; // 4, 3, 2, 1 (defualt, less) : 
#include <list>
#include <stack>
#include <unordered_map>
#include <algorithm>
#include <numeric>  // std::accumulate(m.begin(), m.end(), 0LL);
#include <functional>
#include <cassert>
#include <cctype>  // std::islower(), std::isupper(), std::tolower, std::toupper
#include <iomanip> // std::setprecision(X)
#include <limits>  //std::numeric_limits<int>::max(), min()

typedef long long ll;

int main (void) {
  int N, K; std::cin >> N >> K;
  std::unordered_map<int, int> L;
  std::vector<int> LL;
  for(int i=0; i<N; i++) {
    int A; std::cin >> A;
    if ( L.count(A) == 0 ) {
      L[A] = LL.size();
      LL.push_back(1);
    }
    else {
      LL[L[A]]++;
    }
  }

  std::sort(LL.begin(), LL.end(), std::greater<>());
  int cnt = 0;
  int ans = 0;
  for(auto&& l : LL ) {
    cnt++;
    if ( cnt > K ) ans += l;
  }
  std::cout << ans << std::endl;
  return 0;
}


Measured memory_bytes: 9276
# coding: utf-8
# Your code here!
# coding: utf-8
# 自分の得意な言語で
# Let's チャレンジ！！
import math
N=int(input())
count=0
for i in range(1,N+1):
    for j in range(1,N+1):
        s=math.gcd(i,j)
        for k in range(1,N+1):
            count+=math.gcd(s,k)
print(count)

Measured memory_bytes: 9076
import java.util.*;

public class Main {
	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);
		String str = sc.nextLine();
		String[] data = str.split(" ");
		int num[] = new int[data.length];
		for(int i = 0; i < data.length; i++){
			num[i] = Integer.parseInt(data[i]);
		}
	
		int a = num[0];
		int b = num[1];
		int c = num[2];


		ArrayList<Integer> yaku = new ArrayList<Integer>();
		for(int i = a; i <= b; i++){
			if(c % i == 0){
				yaku.add(i);
			}
		}
		int x = yaku.size();
		System.out.println(x);
	}
}


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

using namespace std;

vector<long long> prime_factor( long long n);
int main() {
    long long A,B,t;
    long long count = 0;
    vector<long long> P ;
    
    cin >> A >> B;
    t= __gcd(A,B);
    P = prime_factor(t);
    
    cout << P.size() + 1;

    return 0;
}


vector<long long> prime_factor( long long n){
    vector<long long> res;
    for(long long i=2;i*i <= n;i++){
        if(n%i == 0){
            res.push_back(i);
            while(n%i == 0) n/=i;
        }
    }
    if(n != 1) res.push_back(n);
    return res;
}

Measured memory_bytes: 256
// practice with kaiboy
import java.io.*;
import java.util.*;

public class Main extends PrintWriter {
	Main() { super(System.out); }
	Scanner sc = new Scanner(System.in);
	public static void main(String[] $) {
		Main o = new Main(); o.main(); o.flush();
	}

	static final int MD = 1000000007;
	int power(long a, int k) {
		long p = 1;
		while (k > 0) {
			if ((k & 1) == 1)
				p = p * a % MD;
			a = a * a % MD;
			k >>= 1;
		}
		return (int) p;
	}
	int[] ff, gg;
	void init(int n) {
		ff = new int[n + 1];
		gg = new int[n + 1];
		for (int f = 1, i = 0; i <= n; i++) {
			gg[i] = power(ff[i] = f, MD - 2);
			f = (int) ((long) f * (i + 1) % MD);
		}
	}
	int ch(int n, int k) {
		return n < k ? 0 : (int) ((long) ff[n] * gg[k] % MD * gg[n - k] % MD);
	}
	void main() {
		int n = sc.nextInt();
		init(n + 1);
		int[] ii = new int[n + 1];
		int m = 0;
		for (int i = 1; i <= n; i++) {
			int a = sc.nextInt();
			if (ii[a] != 0) {
				m = n + 1 - (i - ii[a] + 1);
				break;
			}
			ii[a] = i;
		}
		for (int k = 1; k <= n + 1; k++)
			println((ch(n + 1, k) - ch(m, k - 1) + MD) % MD);
	}
}


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

using namespace std;

//#define int long long
#define ld long double
#define sz(a) (int) (a).size()
#define all(a) (a).begin(), (a).end()
#define x first
#define y second

mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());

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

    int n, x, t;
    cin >> n >> x >> t;
    cout << t * ((n + x - 1) / x);

    return 0;
}


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

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

  if (N % 2 == 1) {
    cout << 0 << "\n";
    return 0;
  }

  N /= 2;

  long long ans = 0, tmp = 5;

  while (tmp <= LLONG_MAX / 5) {
    ans += N / tmp;
    tmp *= 5;
  }

  cout << ans << "\n";
}

Measured memory_bytes: 256
// 6/14 リアルタイム参加
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
using namespace std;
using ll = long long;
using P = pair<int, int>;
using Graph = vector<vector<int>>;

int main() {
    int N;
    cin >> N;
    vector<int> A(N);
    rep(i, N) cin >> A[i];

    int sum_xor = 0;
    rep(i, N) sum_xor ^= A[i];

    rep(i, N) {
        if (i > 0) cout << " ";
        cout << (sum_xor ^ A[i]);  // << endl;
    }
    cout << endl;
    // << endl;
}

Measured memory_bytes: 4048
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

int main(int argc, char const *argv[]) {
    int n,x,t; cin>>n>>x>>t;
    int y = (n+x-1)/x;
    cout << t*y << '\n';
    return 0;
}

Measured memory_bytes: 3584
import java.util.Scanner;

public class Main {

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

        int m1 = sc.nextInt();
        int d1 = sc.nextInt();
        int m2 = sc.nextInt();
        int d2 = sc.nextInt();
        if (m1 + 1 == m2 && d1 + 1 != d2){
            if (m1 + 1 == m2) {
                System.out.println(1);
                return;
            }
        }
        System.out.println(0);
    }
}

Measured memory_bytes: 23636
def factors(n):
    d, res = 1, 0
    while d*d <= n:
        if n % d == 0:
            if d*d == n:
                res += 1
            else:
                res += 2
        d += 1
    return res


N = int(input())

ans = 0
for i in range(1,N+1,2):
    if factors(i) == 8:
        ans += 1

print(ans)

Measured memory_bytes: 61992
import math
a, b, theta = map(float, input().split())

radi = math.radians(theta)

syahen = math.sqrt(a**2 + b**2 - 2*a*b*math.cos(radi))

S = 1/2 *a*b*math.sin(radi)

height = b*math.sin(radi)

print(S)
print(a+b+syahen)
print(height)


Measured memory_bytes: 5696
#include<stdio.h>

int dp[50];

int fib(int n){
	if(n == 0 || n == 1) return dp[n] = 1;
	if( dp[n] != -1) return dp[n];
	return dp[n] = fib(n-1)+fib(n-2);
}

int main()
{
	int n , i;
	for( i = 0; i < 50; i++){
		dp[i] = -1;
	}
	scanf("%d",&n);
	printf("%d\n",fib(n));
	return 0;
}



Measured memory_bytes: 2056
#include<iostream>
#include<vector>
#include<string>
#include<map>
#include<set>
#include<algorithm>

#define MOD (1000000007)

using namespace std;

typedef long long int Int;

vector<string> split(const string &s, char delim) {
    vector<string> elems;
    string item;
    for (char ch: s) {
        if (ch == delim) {
            if (!item.empty())
                elems.push_back(item);
            item.clear();
        }
        else {
            item += ch;
        }
    }
    if (!item.empty())
        elems.push_back(item);
    return elems;
}

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

    if(d == 25) {
        cout<<"Christmas"<<endl;
    } else if(d == 24) {
        cout<<"Christmas Eve"<<endl;
    } else if(d == 23) {
        cout<<"Christmas Eve Eve"<<endl;
    } else if(d == 22) {
        cout<<"Christmas Eve Eve Eve"<<endl;
    }

    return 0;
}



Measured memory_bytes: 888
#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long int a,b,c,d;
   cin>>a>>b>>c>>d;
     vector<long long int>v;
      v.push_back(a*c);
      v.push_back(a*d);
      v.push_back(b*c);
     v.push_back(b*d);
    long long int p=*max_element(v.begin(),v.end());
    cout<<p<<"\n";
}

Measured memory_bytes: 3628
# -*- coding: utf-8 -*-
# 
import math
import sys
import itertools
import numpy as np

# なんこか入力
m,d = map(int, input().split())
answer = 0
for i in range(1,m+1):
    for j in range(1,d+1):
        if j % 10 < 2:
            continue
        if j // 10 < 2:
            continue
        if (j % 10) * (j // 10) == i:
            answer += 1

print(answer)


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

long long int modPow(long long int a,long long int b,long long int mod)
{
    if(b==0)
        return 1;
    long long int p = modPow(a,b/2,mod)%mod;
    p=(p*p)%mod;
    return (b%2==0)? p : (a*p)%mod;
}

int main()
{
    int N {};
    const long long int mod {static_cast<long long int>(1e9+7)};
    cin >> N;
    if(N==1)
        cout << 0;
    else
    {
        long long int ans=(modPow(10,N,mod)-modPow(9,N,mod)-modPow(9,N,mod)+modPow(8,N,mod))%mod;
        cout << (ans+mod)%mod;
    }
    return 0;
}

Measured memory_bytes: 3620
"""
じょえチャンネルおもしろいよ～～～
https://www.youtube.com/channel/UCRXsI3FL_kvaVL9zoolBfbQ
"""

h1,m1,h2,m2,k=map(int,input().split())
a1=h1*60+m1
a2=h2*60+m2
print(max(0,a2-a1-k))

Measured memory_bytes: 9164
import sys
import math
import heapq
mod=10**9+7
inf=float("inf")
from math import sqrt
from collections import deque
from collections import Counter
from collections import defaultdict
#すべてのkeyが用意されてる defaultdict(int)で初期化
from collections import OrderedDict
#順序を保ったdict
from math import ceil
input=lambda: sys.stdin.readline().strip()
sys.setrecursionlimit(11451419)
from decimal import Decimal #floatの高精度ver, 渡すのはstr型で
from functools import lru_cache
#メモ化再帰defの冒頭に毎回 @lru_cache(maxsize=10**10)
#引数にlistはだめ
#######ここまでテンプレ#######
#ソート、"a"+"b"、再帰ならPython3の方がいい
#######ここから天ぷら########
k=int(input())
print(50);n=50
if k==0:
    print(" ".join(["0"]*50));exit()
    
a=k//n
b=k%n
A=[a+49 for i in range(50)]
for  i in range(b):
    A=[A[j]-1 if i!=j else A[j]+n for j in range(50)]
print(*A)

Measured memory_bytes: 10036
import heapq
from collections import deque
from enum import Enum
import sys
import math
from _heapq import heappush, heappop

BIG_NUM = 2000000000
MOD = 1000000007
EPS = 0.000000001



T = input()

for i in range(len(T)):
    if  i%2 == 0:
        print("%c"%(T[i]),end="")

print("")



Measured memory_bytes: 4980
#include <bits/stdc++.h>
using namespace std;
using ll= long long ;
using P = pair<ll,ll>;
#define rep(i,n) for (ll i = 0; i<(ll)(n); i++)
#define mod 1000000007
#define pi 3.141592653589793
typedef vector<ll> vcl;

ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    if(b==0) return a;
    return gcd(b,a%b);
}
ll lcm(ll a, ll b){
    ll g=gcd(a,b);
    return a/g*b;
}
ll rep_jijo(ll n,ll x){
    if(x==0) return 1;
    if(x%2==0){
        ll t =rep_jijo(n,x/2);
        return t*t%mod;
  }
  return n*rep_jijo(n,x-1)%mod;
}

int main() {
    ll s,w;
    cin>>s>>w;
if(s<=w){
    cout<<"unsafe"<<endl;
}
else{
    cout<<"safe"<<endl;
}
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define DEBUG(x)                   cout << '>' << #x << ':' << x << endl;
//log(n)*n*n
unordered_map<string,vector<int> > m;
bool check(int mid,string s,int n)
{
    if(mid>=n)
        return false;
    string s1="",s2="";
    for(int i=0; i<mid; i++)
    {
        s1+=s[i];
    }
    int temp=0;
    m[s1].push_back(mid-1);
    for(int i=mid; i<n; i++)
    {
        s1.erase(s1.begin());
        s1.push_back(s[i]);
        if(m[s1].size()!=0)
        {
            if(m[s1][0]<=(i-mid))
                return true;
        }
        else
            m[s1].push_back(i);
    }
    return false;
}
int main()
{
    ios_base::sync_with_stdio(0);
    cin.tie();
    cout.tie();
    int n;
    string s;
    cin>>n;
    cin>>s;
    int len=s.size()/2;
    int last=0;
    int hi=len+2,lo=1,mid;
    while(hi-lo>5)
    {
        m.clear();
        mid=(lo+hi)>>1;
        if(check(mid,s,n)==true)
        {
            lo=mid;
        }
        else
            hi=mid-1;

    }
    while(check(lo,s,n)==true)
        lo++;
    cout<<lo-1<<endl;
    return 0;
}


Measured memory_bytes: 36460
#include<stdio.h>
#include<string.h>
int main(){
  char word[1111];
  int n,i;
  scanf("%d\n",&n);
  for(i=0;i<n;i++){
    gets(word);
    for(;;){
      if(strstr(word,"Hoshino") == 0){
	break;
      }
      else{
	strncpy(strstr(word,"Hoshino"),"Hoshina",7);
      }
    }
    printf("%s\n",word);
  }
  return 0;
}

Measured memory_bytes: 588
from itertools import accumulate

N = int(input())
A = list(map(int, input().split(" ")))

A = [0] + A + [0]
total_cost = sum(abs(A[i+1]-A[i]) for i in range(N+1))

one, two, three = [None] + A[:2]
for i in range(N):
	one, two, three = two, three, A[i+2]
	first, second = two-one, three-two
	cost_to_reduce = 0
	if (first < 0) != (second < 0):
		cost_to_reduce = min(abs(first), abs(second))*2
	print(total_cost - cost_to_reduce)

Measured memory_bytes: 14168
function Main(input) {
    tmp = input.split(" ");
    hHand = parseInt(tmp[0], 10);
    mHand = parseInt(tmp[1], 10);
    hours = parseInt(tmp[2], 10);
    minuts = parseInt(tmp[3], 10);

    hAngle = (30 * hours) + (0.5 * minuts);

    if (hAngle == 90) {
        hoursX = hHand;
        hoursY = 0;
    } else if(hAngle == 180){
        hoursX = 0;
        hoursY = -hHand;
    }else if(hAngle == 270){
        hoursX = -hHand;
        hoursY = 0;
    } else{
        hoursX = hHand * Math.sin(hAngle*(Math.PI/180));
        hoursY = hHand * Math.cos(hAngle*(Math.PI/180));
    }

    mAngle = (6 * minuts);


    if (mAngle == 90) {
        minutsX = mHand;
        minutsY = 0;
    } else if(mAngle == 180){
        minutsX = 0;
        minutsY = -mHand;
    }else if(mAngle == 270){
        minutsX = -mHand;
        minutsY = 0;
    } else{
        minutsX = mHand * Math.sin(mAngle*(Math.PI/180));
        minutsY = mHand * Math.cos(mAngle*(Math.PI/180));
    }

    distance = Math.hypot(hoursX - minutsX, hoursY - minutsY);
    console.log(distance);
}
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

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

using namespace std;

int main() {
  int n;
  string str;
  cin >> n >> str;

  int sum = 0;
  for (int i = 0; i < n - 2; ++i)
    if (str.substr(i, 3) == "ABC")
      ++sum;

  cout << sum << endl;
}

Measured memory_bytes: 256
N, M = [int(i) for i in input().split()]
x, y, z = [0]*N,[0]*N,[0]*N
for i in range(N):
    x[i], y[i], z[i] = [int(j) for j in input().split()]

ls1 = []
ls2 = []
ls3 = []
ls4 = []
ls5 = []
ls6 = []
ls7 = []
ls8 = []

for a, b, c in zip(x, y, z):
    ls1.append(a+b+c)
    ls2.append(a+b-c)
    ls3.append(a-b-c)
    ls4.append(-a-b-c)
    ls5.append(-a+b+c)
    ls6.append(-a-b+c)
    ls7.append(a-b+c)
    ls8.append(-a+b-c)

ls1.sort(reverse=True)
ls2.sort(reverse=True)
ls3.sort(reverse=True)
ls4.sort(reverse=True)
ls5.sort(reverse=True)
ls6.sort(reverse=True)
ls7.sort(reverse=True)
ls8.sort(reverse=True)

ans = max(sum(ls1[:M]), sum(ls2[:M]), sum(ls3[:M]), sum(ls4[:M]), sum(ls5[:M]), sum(ls6[:M]), sum(ls7[:M]), sum(ls8[:M]))
print(ans)

Measured memory_bytes: 3444
#include <bits/stdc++.h>
#include <math.h>
#include <cmath>

using namespace std;
using ll =long long;
using vi = vector<int>; 
using vvi = vector<vi>; 
using vl = vector<ll>; 
using vvl = vector<vl>; 
using vs = vector<string>;
using vvs = vector<vs>; 
using vc = vector<char>;
using vvc = vector<vc>; 
using vb = vector<bool>;
using vvb = vector<vb>; 

#define rep(i,n) ;for( int i =0; i < n ; i ++)
#define all(a) a.begin(),a.end()
#define pb(a) push_back(a)
#define pd(a) printf("%.10f\n",a)
#define mem(a) memset(a,0,sizeof(a))
#define f(i,a,b) for(int i=a;i<b;i++)
#define pri(a)  printf("%.14lf\n",a);
#define sz(a) ((int)a.size())
#define MOD 1000000007
bool is_int_lround(double x){
  return std::lround(x)==x;
}

ll keta(ll x){
  ll n=0;
  while(x>0){
    x /=10 ;
    n ++;
  }
  return n;
}

ll conbi(int n,int m){
  
  cin>>n>>m;
  vector<ll> a(100);
  a[0] =1;
  for(int i=0;i<14;i++){
    a[i+1]=a[i]*(i+1);
  }
  return a[n] /(a[m] *a[n-m]);
}

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;//繰り返し二乗法
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
ll kaijoMOD(ll x){
  ll z=1;
  if(x==0){
    return 1;
  }
  while(x>0){
    z *=x;
    z %=MOD;
    x--;
  }
  return z;
}
ll div_num(ll n){
  vl div(n+1,1);
  for(ll i=2;i*i<=n;i++){ 
    while(n%i==0){
      n /=i;
      div[i]++;
    }
  }
  if(n!=1)div[n]++;
  ll num=1;
  for(ll i=0;i<=n;i++){
    num*=div[i];
  }
  return num;
}
vector<ll> divisor(ll n) {
  vector<ll> ret;
  for(ll i = 1; i * i <= n; i++) {
    if(n % i == 0) {
      ret.push_back(i);
      if(i * i != n) ret.push_back(n / i);
    }
  }
  sort(begin(ret), end(ret));
  return (ret);
}

int keta_wa(int x){
  int tot=0;
  while(x>0){
    tot +=x%10;
    x/=10;
  }
  return tot;
}
long long lopow(ll a, long long n) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a ;
        a = a * a ;
        n >>= 1;
    }
    return res;
}

        
//vc alp ={'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
//vc Alp ={'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
//cout<<""<<endl;

int main(){
ll N;cin>>N;
  vl L(N);rep(i,N)cin>>L[i];
  sort(all(L));
  ll cnt=0;
  rep(i,N-2){
    for(int j=i+1; j<N-1;j++){
      for(int k=j+1; k<N;k++){
        if(L[i]!=L[j] &&L[k]!=L[j]&&L[k]!=L[i]){
          if(L[i]+L[j]>L[k]&&L[k]+L[j]>L[i]&&L[i]+L[k]>L[j]){
            cnt++;
          }
        }
      }
    }
  }
  cout<<cnt<<endl;
}

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

int main(){
  double a,b,x,tang,cot;
  cin>>a>>b>>x;
  if(x>a*a*b/2)	
    // 側面が台形
    tang=a*a*a/((2*a*a*b)-2*x);
  else
	//側面が三角形
    tang=2*x/(a*b*b);
  cot=90-180*(atan(tang)/acos(-1));
  printf("%2.9lf\n ",cot);
}


Measured memory_bytes: 256