akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;

public class Main {

	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String s = sc.nextLine();
		int n = 0;
		
		for(int i = 0; i < 4; i++) {
			char op = s.charAt(i);
			
			switch(op){
			case '+' :
				n++;
				break;
			case '-' :
				n--;
				break;
			}
		}
		
		System.out.println(n);
		
	}
}

Measured memory_bytes: 21844
#include <iostream>

using namespace std;

int main()
{
    string S;
    cin>>S;
    if(S=="Sunny")
    {
        cout<<"Cloudy";
    }
    if(S=="Cloudy")
    {
        cout<<"Rainy";
    }
    if(S=="Rainy")
    {
        cout<<"Sunny";
    }
    return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <algorithm>
#include <vector>
#include <map>
#include <set>
 
using namespace std;
 
#define PB push_back
#define MP make_pair
#define REP(i,n) for(int i=0;i<(n);i++)

int main()
{
    int h,n;
    int a[100100];
    cin>>h>>n;
    REP(i,n)cin>>a[i];
    sort(a,a+n);
    int su=0;
    REP(i,n)su+=a[n-1-i];
    if(h<=su)cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


Measured memory_bytes: 640
/**
 * The man who codes no bugs
 * McCheng is the man studying Maths in CUHK with IQ200
 * @author McCheng
 */

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

class DNotDivisible {
public:
    static constexpr int kStressCount = 0;
    static void generateTest(ostream& test) {}
	void solve(istream& cin, ostream& cout) {
int n;
cin>>n;
        vector<bool> visited(1e6+1, false);
        vector<bool> dp(1e6+1, false);
        vector<int> a(n);
        for (int i = 0; i < n; i++) {
            cin >> a[i];
        }
        for (auto j : a) {
            if (visited[j]) dp[j]=true;
            visited[j]=true;
            if (dp[j]) continue;
            for (int i = 2*j; i <1e6+1 ; i+=j) {
                dp[i]=true;
            }
        }
        int cnt=0;
        for (auto k : a) {
            if (!dp[k])cnt++;
        }
        cout<<cnt;
	}
};

#undef int
signed main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    istream &in(cin);
    ostream &out(cout);
    out << fixed;
    out.precision(20);
    DNotDivisible solver;
    solver.solve(in, out);
}


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

int main(){
  int n;

  while(cin >> n){
    int ans = 0;
    for(int h=0; h<=9; h++){
      for(int i=0; i<=9; i++){
        for(int j=0; j<=9; j++){
          for(int k=0; k<=9; k++){
            if(h + i + j + k == n) ans++;
          }
        }
      }
    }
    cout << ans << endl;
  }
}
  


Measured memory_bytes: 3000
#include <bits/stdc++.h>
#define r(i,n) for(int i=0;i<n;i++)
#define int long long
using namespace std;
typedef pair<int,int>P;
#define fi first
#define se second

struct UnionFind{
  int n;
  vector<int> ran,p,cnt;
  UnionFind(){}
  UnionFind(int sz):n(sz),ran(sz,1),p(sz,0){iota(p.begin(),p.end(),0);}
  int find(int x){
    return (x==p[x]?x:p[x]=find(p[x]));
  }
  bool same(int x,int y){
    return find(x)==find(y);
  }
  void unite(int x,int y){
    x=find(x);y=find(y);
    if(x==y) return;
    if(ran[x]<ran[y]) swap(x,y);
    ran[x]+=ran[y];
    p[y]=x;
  }
  int sum(int x){
    return ran[find(x)];
  }
};

int n,m;
int a[300000],b[300000];

signed main(){
  cin>>n>>m;
  r(i,m){
    cin>>a[m-i-1]>>b[m-i-1];
  }
  vector<int>v;
  UnionFind U(300000);
  v.push_back(n*(n-1)/2);

  int t=0;

  r(i,m-1){
    if(!U.same(a[i],b[i])){
      t+=U.sum(a[i])*U.sum(b[i]);
    }
    U.unite(a[i],b[i]);
    v.push_back(n*(n-1)/2-t);
  }
  reverse(v.begin(),v.end());
  r(i,v.size()){
    cout<<v[i]<<endl;
  }
}


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

int n,out,now_num;
vector < int > way[20],way2[20];
int v[20];

bool can()
{
	now_num = 0;
	for(int i = 1;i <= n;i++)
	{
		if(v[i] == 1)
		{
			now_num++;
			for(int j = 0;j < way[i].size();j++)
			{
				if(way2[i][j] != v[way[i][j]])
				{
					return 0;
				}
			}	
		}
	}
	return 1;
}

void dfs(int now)
{
	if(now == n + 1)
	{
		if(can())
		{
			out = max(out,now_num);
		}
		return ;
	}
	v[now] = 1;
	dfs(now + 1);
	v[now] = 0;
	dfs(now + 1);
}

int main()
{
	cin>>n;
	for(int i = 1;i <= n;i++)
	{
		int in1,in2,in3;
		cin>>in1;
		for(int j = 1;j <= in1;j++)
		{
			cin>>in2>>in3;
			way[i].push_back(in2);
			way2[i].push_back(in3);
		}
	} 
	
	dfs(1);
	
	cout<<out;
	return 0;
}


Measured memory_bytes: 256
import sys
import collections
import itertools
import math
import re
from collections import Counter
from collections import deque
from collections import defaultdict

S = input()
T = input()


N = len(S)


def f(STR1, STR2):
    d = {}
    isOK = True
    for i in range(N):
        s = STR1[i]
        t = STR2[i]

        if d.get(s) == None:
            d[s] = t
        elif d.get(s) == t:
            pass
        else:
            return False
    return True


if f(S,T) and f(T,S):
    print("Yes")
else:
    print("No")


Measured memory_bytes: 4136
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define vl vector
using namespace std;

int main()
{
    ll t,i,n;
    ll a,b,c;
    string s1,s2;
    cin>>s1>>s2;
    cin>>a>>b;
    string rem;
    cin>>rem;
    if(s1==rem) a--;
    if(s2==rem) b--;
    cout<<a<<" "<<b;
}

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

int main() {
  int64_t a,b,k;
  cin >> a >> b >> k;
  vector<int64_t> num;
  for(int i=0;i<k;i++){
    if( a+i > b ) break;
    num.push_back(a+i);
  }
  for(int i=b;i>b-k;i--){
    if( i < a+k ) break;
    num.push_back(i);
  }
  sort(num.begin(),num.end());
  for(int i=0;i<num.size();i++){
    cout << num.at(i) << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
 
int main(void){

	int room[4][3][10] ={0};
	int n,b,f,r,v;
	int i;
    scanf("%d",&n);

	for(i=0; i<n; i++){
		scanf("%d %d %d %d",&b, &f, &r, &v);
		room[b-1][f-1][r-1]=room[b-1][f-1][r-1]+v;
	}
	for(b=0; b<4; b++){
		for(f=0; f<3; f++){
			for(r=0; r<10; r++){
				printf(" %d", room[b][f][r]);
				
				if(r==9){
					printf("\n");
				}
			
			}
		}
		if(b!=3){	printf("####################\n");}
	}
 
    return 0;
}


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

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define all(obj) (obj).begin(), (obj).end()
#define rall(obj) (obj).rbegin(), (obj).rend()
#define collect(arr, size) rep(i,size) cin >> arr[i];
#define int long long

signed main(){
    int A,B;
    cin >> A >> B;
    cout << (B%A==0 ? A+B : B-A) << endl;
}

Measured memory_bytes: 256
from collections import Counter,defaultdict,deque
from heapq import heappop,heappush,heapify
import sys,bisect,math,itertools,fractions
sys.setrecursionlimit(10**8)
mod = 10**9+7
INF = float('inf')
def inp(): return int(sys.stdin.readline())
def inpl(): return list(map(int, sys.stdin.readline().split()))

n = inp()
a = [inp() for _ in range(n)]
print(len(set(a)))

Measured memory_bytes: 77252
import java.util.ArrayDeque;
import java.util.Deque;
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    // TODO 自動生成されたメソッド・スタブ
    Scanner sc = new Scanner(System.in);

    String x = sc.next();

    Deque<String> deque = new ArrayDeque<>();

    for (int i = 0; i < x.length(); i++) {
      if (x.charAt(i) == 'S') {
        deque.push(String.valueOf(x.charAt(i)));
      } else {
        if (deque.peek() != null && deque.peek().equals("S")) {
          deque.pop();
        } else {
          deque.push(String.valueOf(x.charAt(i)));
        }
      }
    }
    System.out.println(deque.size());
  }
}


Measured memory_bytes: 37992
from collections import deque

N, Q = map(int, input().split())
score = [0]*N

#　木を作成
Ki = [[] for _ in range(N)]
for _ in range(N-1):
    p, c = map(int, input().split())
    Ki[p-1].append(c-1)
    Ki[c-1].append(p-1)
    
# スコア表を作る
S = [0]*N
for _ in range(Q):
    node, score = map(int, input().split())
    S[node-1] += score

# DFS
stack = deque([0])
done = [0]*N
done[0] = 1

while len(stack) > 0:
    now = stack.pop()
    
    for new in Ki[now]:
        if done[new] == 0:
            done[new] = 1
            stack.append(new)
            S[new] += S[now]
    
print(*S)
    

Measured memory_bytes: 128744
import java.util.Scanner;
public class Main
{
	public static void main(String args[])
	{
		int n,a,b,c;
		Scanner input = new Scanner(System.in);
		n = input.nextInt();
		System.out.println(n/3600 + ":" + (n%3600)/60 + ":" + n%60);
	}
}

Measured memory_bytes: 26420
import std.stdio;
import std.conv;
import std.string;
import std.typecons;
import std.algorithm;
import std.array;
import std.range;
import std.math;
import std.regex : regex;
import std.container;
import std.bigint;


void main()
{
  auto n = readln.chomp.to!int;
  double res = 0;
  foreach (i; 0..n) {
    auto s = readln.chomp.split;
    auto x = s[0].to!double;
    if (s[1] == "BTC") {
      res += x * 380_000;
    } else {
      res += x;
    }
  }

  writefln("%.12f", res);
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define show(x) std::cerr << #x << " = " << (x) << std::endl
using ll = long long;
template <typename T>
constexpr T MOD = static_cast<T>(1000000007);
template <typename T>
constexpr T INF = std::numeric_limits<T>::max() / 16;
struct Graph
{
    Graph(const std::size_t v) : V{v}, edge(v), rev_edge(v) {}
    void addEdge(const std::size_t from, const std::size_t to) { edge[from].push_back(to), rev_edge[to].push_back(from); }
    const std::size_t V;
    std::vector<std::vector<std::size_t>> edge, rev_edge;
};
std::pair<bool, std::vector<std::size_t>> TopSort(const Graph& g)
{
    std::vector<std::size_t> srt, used(g.V, 0);
    auto dfs = [&](auto&& self, const std::size_t s) -> bool {
        if (used[s] == 1) {
            return false;
        } else if (used[s] == 0) {
            used[s] = 1;
            for (const std::size_t to : g.edge[s]) {
                if (not self(self, to)) { return false; }
            }
            used[s] = 2, srt.push_back(s);
        }
        return true;
    };
    for (std::size_t i = 0; i < g.V; i++) {
        if (not dfs(dfs, i)) { return {false, srt}; }
    }
    std::reverse(srt.begin(), srt.end());
    return {true, srt};
}
int main()
{
    int N, M;
    std::cin >> N >> M;
    Graph g(N);
    for (int i = 0; i < N + M - 1; i++) {
        int u, v;
        std::cin >> u >> v, u--, v--;
        g.addEdge(u, v);
    }
    const auto top = TopSort(g).second;
    std::vector<int> dp(N, 0);
    for (int i = 0; i < N; i++) {
        for (const int to : g.edge[top[i]]) { dp[to] = std::max(dp[to], dp[top[i]] + 1); }
    }
    std::vector<int> ans(N, 0);
    for (int i = 0; i < N; i++) {
        for (const int to : g.edge[top[i]]) {
            if (dp[to] == dp[top[i]] + 1) {
                ans[to] = top[i] + 1;
            }
        }
    }
    for (int i = 0; i < N; i++) { std::cout << ans[i] << std::endl; }
    return 0;
}

Measured memory_bytes: 15608
#include "bits/stdc++.h"
using namespace std;


/* macro */
//#define int long long
#define rep(i,a,b) for(int i=a;i<b;i++)
#define revrep(i,a,b) for(int i = a; i > b; i--)
#define exist(s,e) ((s).find(e)!=(s).end())
#define all(v) (v).begin(), (v).end()
#define each(s,itr) for(auto (itr) = s.begin(); (itr) != s.end(); (itr)++)
#define sum(v) accumulate(all(v), (0LL))
#define sec second
#define fir first
#define pb push_back



/* alias */
template<class T> using vec = vector<T>;
typedef vector<int> vi;
typedef pair<int, int> pi;


/* constant */
//const int inf = pow(2, 62);
const int mod = 1e9 + 7;
int dx[8]={1,0,-1,0,-1,1,-1,1};
int dy[8]={0,1,0,-1,-1,-1,1,1};



/* io_method */
int input(){int tmp;cin >> tmp;return tmp;}
string raw_input(){string tmp;cin >> tmp;return tmp;}
string readline(){string s;getline(cin, s);return s;}
template<class T> void printx(T n){cout << n;}
template<class T, class U> void printx(pair<T, U> p){cout << "(" << p.first << "," << p.second << ")";}
template<class T> void printx(vector<T> v){cout << "{";rep(i,0,v.size()){printx(v[i]);if(i != v.size()-1)printx(",");}cout << "}";}
template<class T> void print(T n){printx(n);cout << endl;}
template<class T> void print(set<T> s){cout << "{";each(s, e){if(e != s.begin()) printx(",");printx(*e);}cout << "}" << endl;}
template<class T, class U> void print(map<T, U> mp){cout << "{";each(mp, e){cout << "(" << e -> first << "," << e -> second << ")";}cout << "}" << endl;}


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




/* main */



signed main(){

    cin.tie(0);
    ios::sync_with_stdio(false);

    
    int n, a; cin >> n >> a;

    print(n * n - a);

    

    
    




    
    



    
    

    







   




    

    

    




    



    



    

 
    
    


    

    
   
    













}






    










    




    










Measured memory_bytes: 256
use itertools::Itertools;
use num::integer::gcd;
use proconio::input;
use proconio::marker::{Chars, Usize1};
use std::cmp::*;
use std::collections::*;
use std::iter::Iterator;

#[allow(unused_macros)]
macro_rules! max {
    ($x:expr) => {
      $x
    };
    ($x:expr, $($xs:tt)+) => {
      max($x,max!($($xs)+))
    };
  }

#[allow(unused_macros)]
macro_rules! min {
    ($x:expr) => {
      $x
    };
    ($x:expr, $($xs:tt)+) => {
      min($x,min!($($xs)+))
    };
  }

#[allow(unused_macros)]
macro_rules! debug {
    ($($a:expr),*) => {
        eprintln!(concat!($(stringify!($a), " = {:?}, "),*), $($a),*);
    }
}

fn main() {
    input! {
    n: usize,
    mut a: [u64; n],
    }

    let mut l_gcd = vec![0; n+2];
    l_gcd[1] = a[0];
    for i in 1..n {
        l_gcd[i+1] = gcd(a[i], l_gcd[i]);
    }
 
    let mut r_gcd = vec![0; n+2];
    r_gcd[n] = a[n-1];
    for i in (0..n-1).rev() {
        r_gcd[i+1] = gcd(a[i], r_gcd[i+2]);
    }
    
    let mut ans = 1;
    for i in 0..n {
        let res = gcd(l_gcd[i], r_gcd[i+2]);
        ans = max(ans, res);
    }
    println!("{}", ans);

}


Measured memory_bytes: 5232
#include <bits/stdc++.h>
#include <unistd.h>
using namespace std;
typedef long long int lli;
typedef pair<lli, lli> pii;
#define dbg(x) cout << #x << " has a value of: " << x << "\n";
#define usize(x) (int)(x.size())
#define plist(x)                       \
    for (int i = 0; i < usize(x); i++) \
        cout << "eleman " << i << " = " << x[i] << "\n";
#define foreach(x) for (auto item : x)
#define fill(s, x)              \
    for (int i = 0; i < x; i++) \
        cin >> s[i];
#define in(veriler, a) (veriler.find(a) != veriler.end())
#define btw(x, y, z) x >= y&& x <= z;
std::ostream& operator<<(std::ostream& os, pair<int,int> p) {
    os << p.first << ", " << p.second;
    return os;
}
#ifdef ONLINE_JUDGE
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);
#else
#define fio //a
#endif
const lli MOD=1e9+7;
lli fastPow(lli a,lli b){
	if(b==0)return 1;
	lli tmp=fastPow(a,b/2);
	tmp=(tmp*tmp)%MOD;
	if(b&1)tmp=(tmp*a)%MOD;
	return tmp;
}
lli inv(lli a){
	return fastPow(a,MOD-2);
}

const lli MAXN=1e6+6;
lli facts[MAXN];
lli comb(lli a,lli b){
	if(a<b)return 0;
	return (facts[a]*inv((facts[b]*facts[a-b])%MOD))%MOD;
}
int main(){
	lli x,y;
	cin>>x>>y;
	facts[0]=1;
	for (int i = 1; i <MAXN ; i++)
	{
		facts[i]=(facts[i-1]*i)%MOD;
	}
	if((2*y-x)%3!=0){
		cout<<0<<"\n";
		return 0;
	}
	lli hc=(2*y-x)/3;
	lli bc=(x-hc)/2;
	if(hc<0||bc<0){cout<<"0\n";return 0;}
	cout<<(comb(hc+bc,hc)+MOD)%MOD<<"\n";
	return 0;
}


Measured memory_bytes: 8064
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
//#define MOD 998244353
#define INF 1000000010
#define EPS 1e-9
#define F first
#define S second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define lp(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long
#define endl "\n"

typedef pair<int,int> PII;
typedef pair<int,string> PIS;
typedef pair<string,int> PSI;


signed main(){
  cin.tie(0);	
  ios::sync_with_stdio(false);
  int n;
  cin>>n;
  int ans=0;
  repi(i,1,n+1){
    if(i%3!=0 && i%5!=0) ans+=i;
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 3652
N,K = map(int, input().split())
A = list(map(int, input().split()))
p = 1
p_hist = []
p_hist_set = set()
p_hist_index = [-1] * (N+1)
while p not in p_hist_set:
    p_hist_index[p] = len(p_hist)
    p_hist.append(p)
    p_hist_set.add(p)
    p = A[p-1]
end_loop = p_hist[-1]
end_loop_idx = p_hist_index[end_loop]
start_loop = A[end_loop - 1]
start_loop_idx = p_hist_index[start_loop]
if K < start_loop_idx:
    print(p_hist[K])
else:
    print(p_hist[(K-start_loop_idx)%(end_loop_idx-start_loop_idx+1)+start_loop_idx])


Measured memory_bytes: 36884
#include<cstdio>
#include<algorithm>

using namespace std;

int main(){
	int a[100][100];
	for(int n;scanf("%d",&n),n;){
		for(int i=0;i<n;i++)for(int j=0;j<n;j++)	scanf("%d",a[i]+j);

		int cnt[100][100]={};
		for(int i=0;i<n;i++){
			int hmin=1<<30;
			for(int j=0;j<n;j++)	if(a[i][j]<hmin)	hmin=a[i][j];
			for(int j=0;j<n;j++)	if(a[i][j]==hmin)	cnt[i][j]++;
		}
		for(int j=0;j<n;j++){
			int hmax=-(1<<30);
			for(int i=0;i<n;i++)	if(a[i][j]>hmax)	hmax=a[i][j];
			for(int i=0;i<n;i++)	if(a[i][j]==hmax)	cnt[i][j]++;
		}

		int ans=-1;
		for(int i=0;i<n;i++)for(int j=0;j<n;j++)	if(cnt[i][j]==2)	ans=a[i][j];
		printf("%d\n",~ans?ans:0);
	}

	return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <set>
#include <vector>

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define int long long

using namespace std;

struct DSU {
  std::vector<int> size;
  std::vector<int> parent;
  int connected;

  static DSU make_set(int n) {
    DSU dsu;
    for (int i = 0; i <= n; i++) {
      dsu.parent.push_back(i);
      dsu.size.push_back(1);
    }
    dsu.connected = n;
    return dsu;
  }

  int find(int u) {
    if (parent[u] == u) {
      return u;
    }
    return parent[u] = find(parent[u]); // compression
  }

  pair<int,int> unite(int u, int v) {
    int up = find(u);
    int vp = find(v);
    if (up == vp) {
      return make_pair(up, 0);
    }

    // tweak for T4
    int decrement = size[up] * size[vp];

    parent[vp] = up;
    size[up] += size[vp];
    connected--;
    return make_pair(up, decrement);
  }

  int getSize(int u) {
    return size[find(u)];
  }
};

signed main() {
  IOS;

  int n, m, i, cur;
  cin >> n >> m;
  vector<int> a(m), b(m);
  for (i = 0; i < m; i++) {
    cin >> a[i] >> b[i];
  }

  DSU dsu = DSU::make_set(n);
  vector<int> result(m);
  cur = n * (n-1) / 2;
  for (i = m-1; i >= 0; i--) {
    result[i] = cur;
    pair<int,int> ret = dsu.unite(a[i], b[i]);
    cur -= ret.second;
  }

  for (i = 0; i < m; i++) {
    cout << result[i] << endl;
  }
  return 0;
}


Measured memory_bytes: 5484
using System.CodeDom.Compiler;
using System.Collections.Generic;
using System.Collections;
using System.ComponentModel;
using System.Diagnostics.CodeAnalysis;
using System.Globalization;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.Serialization;
using System.Text.RegularExpressions;
using System.Text;
using System;

class Program
{
    static void Main(string[] args)
    {
        string[] input = Console.ReadLine().Split(' ');
        int a = int.Parse(input[0]);
        int b = int.Parse(input[1]);

        if (a <= 8 && b <= 8)
        {
            Console.WriteLine("Yay!");
        }
        else
        {
            Console.WriteLine(":(");
        }
    }
}


Measured memory_bytes: 11092
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define fi first
#define se second
#define mp make_pair
#define itrfor(itr,A) for(auto itr = A.begin(); itr !=A.end();itr++)
template <class T> using reversed_priority_queue = priority_queue<T, vector<T>, greater<T> >;
typedef long long llong;
char moji[26]={'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'};
char moji2[26]={'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'};
char moji3[10]={'0','1','2','3','4','5','6','7','8','9'};
#define Sort(a) sort(a.begin(),a.end());
#define Reverse(a) reverse(a.begin(),a.end());
#define print(a) cout << a << endl;
#define MOD llong(1e9+7)
#define MAX int(2 * 1e5 +5)
#define debug(x)  cout << #x << " = " << (x) << endl;
#define pi acos(-1.0)
#define int llong
#define INF llong(1e18 + 3)
template<class T> bool chmax(T &a,  T b) {if(a<b){a=b; return 1;} return 0;}
template<class T> bool chmin(T &a,  T b) {if(a>b){a=b; return 1;} return 0;}
bool Add(int &a,int b){a = (a + b) % MOD;}
void myprint(int* A,int A_num){
   REP(i,A_num) cout << A[i] << " ";
   cout << endl;
}

signed main(){
    int n;
    cin >> n;
    int A[n];
    REP(i,n) cin >> A[i];
    int ans = 0;
    int check[n] = {};
    FOR(i,1,n){
        int tmp = 0;
        int migi = n - 1;
        int hidari = 0;
        while(1){
            migi -= i;
            if(migi <= i) break;
            hidari += i;
            if(hidari >= n- 1 - i or migi == hidari) break;
             if(check[migi] == i or check[hidari] == i) break;
            if( migi - i <= 0 or   check[migi - i] == i) break;
            check[hidari] = i;
            check[migi] = i;

            tmp += A[migi];
            tmp += A[hidari];
            chmax(ans,tmp);
        }
    }
    cout << ans << endl;
}

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

void solve(int N, std::vector<int> P, std::vector<int> Q)
{
	int a = 0, b = 0, i = 0;
	vector<int> v(N);
	iota(v.begin(), v.end(), 1);

	do
	{
		if (P == v)
			a = i;

		if (Q == v)
			b = i;

		i++;
	} while (next_permutation(v.begin(), v.end()));

	cout << abs(a - b) << endl;
}

int main()
{
	int N;
	scanf("%d", &N);
	std::vector<int> P(N);
	for (int i = 0; i < N; i++)
	{
		scanf("%d", &P[i]);
	}
	std::vector<int> Q(N);
	for (int i = 0; i < N; i++)
	{
		scanf("%d", &Q[i]);
	}
	solve(N, std::move(P), std::move(Q));
	return 0;
}


Measured memory_bytes: 3672
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair< ll, ll > Pi;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep2(i,n) for(int i=1;i<=(n);i++)
#define rep3(i,i0,n) for(int i=i0;i<(n);i++)
#define pb push_back
#define mod 1000000007
const ll INF = 1LL << 60;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
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;}
#define all(x) x.begin(), x.end()
#define mp make_pair
bool compare(Pi a, Pi b) {
    if(a.first != b.first){
        return a.first < b.first;
        
    }else{
        return a.second < b.second;
    }
}


bool In_map(ll y,ll x,ll h,ll w){
    if(y<0 || x<0 || y>=h || x>=w){
        return 0;
    }else{
        return 1;
    }
}
const vector<ll> dx{1,0,-1,0};
const vector<ll> dy{0,1,0,-1};


int main() {
    ll N;
    cin >>N;
    vector<ll>sum(N+1);

    rep(i,N){
        ll a;
        cin>>a;
        sum[i+1]=sum[i]+a;
    }
    ll ans=INF;
    rep2(i,N-1){
        chmin(ans,abs(sum[N]-sum[i]*2));
    }
    cout << ans << endl;


    return 0;
    

}

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

int main() {
  int N;
  cin >> N;
  vector<int> A(N-1);
  for (int &e : A) cin >> e;
  int sum = A[0] + A[N-2];
  for (int i = 0; i < N-2; i++) {
    sum += min(A[i], A[i+1]);
  }
  cout << sum << endl;
}

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

using namespace std;

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

using i64 = long long;
using pii = pair<i64, i64>;

template<class A, class B>inline bool chmax(A &a, const B &b){return b > a ? a = b,1 : 0;}
template<class A, class B>inline bool chmin(A &a, const B &b){return b < a ? a = b,1 : 0;}

constexpr int INF = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;
constexpr int MOD = int(1e9) + 7;

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

  char x, y;
  cin >> x >> y;
  int X , Y;
  if (x == 'A') X = 10;
  if (x == 'B') X = 11;
  if (x == 'C') X = 12;
  if (x == 'D') X = 13;
  if (x == 'E') X = 14;
  if (x == 'F') X = 15;

  if (y == 'A') Y = 10;
  if (y == 'B') Y = 11;
  if (y == 'C') Y = 12;
  if (y == 'D') Y = 13;
  if (y == 'E') Y = 14;
  if (y == 'F') Y = 15;

  if (X == Y) cout << '=' << "\n";
  else if (X < Y) cout << '<' << "\n";
  else cout << '>' << "\n";

  return 0;
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main(){
    int N, M, C;
    int ans = 0;
    cin >> N >> M >> C;
    int A[100], B[100];
    for(int i = 0; i < M; i++){
        cin >> B[i];
    }
    for(int i = 0; i < N; i++){
        int sum = C;
        for(int j = 0; j < M; j++){
            cin >> A[j];
            sum += A[j]*B[j];
        }
        if(sum > 0) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 888
n = int(input())
dp = [1e9 for i in range(100001)]
dp[0] = 0
ans = n
yen = set()
for i in range(7):
  yen.add(6**i)
  dp[6**i] = 1
for i in range(6):
  yen.add(9**i)
  dp[9**i] = 1
for i in range(1, n+1):
  for e in yen:
    if i+e<=100000:
      dp[i+e] = min(dp[i+e], dp[i]+1)
print(dp[n])

Measured memory_bytes: 3864
#include <bits/stdc++.h>
#define MAX 3005
using namespace std;

string s, t;

int dp[MAX][MAX];
pair<int, int> last[MAX][MAX];
pair<int, int> mm;
int m;

void build(pair<int, int> p, int k){
    if(!k)
        return;

    //cout<<p.first<<" "<<p.second<<" "<<s[p.first-1]<<"\n";
    build(last[p.first][p.second], k-1);
    cout<<s[p.first];

}

int main(){
    cin>>s>>t;
    for(int i=0; i<s.size(); i++){
        for(int j=0; j<t.size(); j++){
            if(s[i]==t[j]){ //son la misma letra
                if(dp[i][j]+1>dp[i+1][j+1]){ //es mejor opcion
                    dp[i+1][j+1]= dp[i][j]+1;
                    last[i+1][j+1].first = i;
                    last[i+1][j+1].second = j;
                }
                if(m<dp[i+1][j+1]){
                    mm=last[i+1][j+1];
                    m = dp[i+1][j+1];
                }
            }
            if(dp[i][j]>dp[i+1][j]){
                dp[i+1][j] = dp[i][j];
                last[i+1][j] = last[i][j];
            }
            if(m<dp[i+1][j]){
                mm = last[i+1][j];
                m = dp[i+1][j];
            }
            if(dp[i][j]>dp[i][j+1]){
                last[i][j+1]=last[i][j];
                dp[i][j+1]=dp[i][j];
            }
        }
    }
    /*for(int i=0; i<=s.size(); i++){
        for(int j=0; j<=t.size(); j++){
            cout<<last[i][j].first<<","<<last[i][j].second<<"|"<<dp[i][j]<<"\t";
        }
        cout<<"\n";
    }
    cout<<mm.first<<","<<mm.second<<"|"<<m<<"\n";*/
    int v = 0;
    build(mm, m);
    cout<<"\n";
    //cout<<m<<"\n";
    return 0;
}
/*
abracadabra
avadakedavra

aba
aka

abappp
apppba

bra
vada

na
ba

aaadara
*/


Measured memory_bytes: 109220
using System;
using System.Collections;
using System.Collections.Generic;
using System.Text;
using static MyIO;


public class A
{
	public static void Main()
	{
		int N = GetInt();		
		Console.WriteLine(800 * N - 200 * (N/15));
	}
}


public static class MyIO
{
	private static string[] args = null;
	private static int num = -1;
	private static int used = -1;

	private static string getArg()
	{
		if(used == num)
		{
			args = Console.ReadLine().Split(' ');
			num = args.Length;
			used = 0;
		}
		return args[used++];
	}

	public static int GetInt(){ return int.Parse(getArg()); }
	public static long GetLong(){ return long.Parse(getArg()); }
	public static double GetDouble(){ return double.Parse(getArg()); }
	public static string GetString(){ return getArg(); }
}

Measured memory_bytes: 11092
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <utility>
#include <map>
#include <deque>
#include <cmath>
using namespace std;

int main() {
	int N, K; cin >> N >> K;
	if(N+1>=K*2) cout << "YES" << endl;
	else cout << "NO" << endl;
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define endl '\n'
#define FAST_IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
#define IT set<node>::iterator
#define mem(a) memset(a,0,sizeof(a))
typedef long long LL;
typedef long long ll;
using namespace std;
const int N = 1e6 + 5;
const int mod = 1e9 + 7;
bool isprime[N];
int prime[N], tot;
void init() {
  for(int i = 2; i <= 1e6; i++) {
    if(!isprime[i]) {
      prime[++tot] = i;
      for(int j = 2 * i; j <= 1e6; j += i) {
        isprime[j] = true;
      }
    }
  }
}
ll vis[N], a[N];
int main() {
  init();
  ios::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);
  int n; cin >> n;
  isprime[1] = 1;
  for(int i = 1; i <= n; i++) {
    cin >> a[i];
  }
  ll d = __gcd(a[1], a[2]);
  for(int i = 3; i <= n; i++) {
    d = __gcd(d, a[i]);
  }
  if(d > 1) {
    cout << "not coprime\n";
    return 0;
  }
  for(int i = 1; i <= n; i++) {
    if(!isprime[a[i]]) {
      vis[a[i]]++;
      continue;
    }
    int len = sqrt(a[i]);
    for(int j = 1; j <= tot && prime[j] <= len; j++) {
      if(a[i] % prime[j] == 0) {
        vis[prime[j]]++;
        if(!isprime[a[i] / prime[j]] && a[i] / prime[j] != prime[j] && prime[j] < a[i] / prime[j]) {
          vis[a[i] / prime[j]]++;
        }
      }
    }
  }
  int flag1 = 0, flag2 = 0;
  for(int i = 1; i <= tot; i++) {
    if(vis[prime[i]] > 1) {
      flag1 = 1;
    }
    if(vis[prime[i]] == n) {
      flag2 = 1;
    }
  }
  if(!flag1) {
    cout << "pairwise coprime\n";
  } else if(flag1 && !flag2) {
    cout << "setwise coprime\n";
  }

  return 0;
}


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

int main(){
	cin.tie(0),ios::sync_with_stdio(false);
	int a,b,k; cin>>a>>b>>k;
	if(b-a<k*2){
		for(int i=a;i<=b;++i)cout<<i<<"\n"s;
	}
	else{
		for(int i=a;i<a+k;++i)cout<<i<<"\n"s;
		for(int i=b-k+1;i<=b;++i)cout<<i<<"\n"s;
	}
}


Measured memory_bytes: 3664
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

template<class T>
struct WeightedUnionFind {
private:
    vector<int> par, rank;
    vector<T> diff_weight;
    
public:
    WeightedUnionFind() {}
    WeightedUnionFind(int n, T def = 0) {
        par.resize(n, -1);
        rank.resize(n, 0);
        diff_weight.resize(n, def);
    }
    
    int root(int x) {
        if (par[x] < 0) return x;
        int r = root(par[x]);
        diff_weight[x] += diff_weight[par[x]];
        return par[x] = r;
    }
    
    T weight(int x) {
        root(x);
        return diff_weight[x];
    }
    
    bool is_same(int x, int y) {
        return root(x) == root(y);
    }
    
    bool merge(int x, int y, T w) {
        w += weight(x); w -= weight(y);
        x = root(x); y = root(y);
        if (x == y) return false;
        if (rank[x] < rank[y]) swap(x, y), w = -w;
        if (rank[x] == rank[y]) rank[x]++;
        par[y] = x;
        diff_weight[y] = w;
        return true;
    }
    
    T diff(int x, int y) {
        return weight(y) - weight(x);
    }
    
    int size(int x) {
        return -par[root(x)];
    }
};

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // ifstream in("input.txt");
    // cin.rdbuf(in.rdbuf());
    ll n, m;
    cin >> n >> m;
    WeightedUnionFind<ll> wuf(n);
    rep(i, m) {
        ll l, r, d;
        cin >> l >> r >> d;
        l--; r--;
        if (wuf.is_same(l, r)) {
            if (wuf.diff(l, r) != d) {
                cout << "No" << endl;
                return 0;
            }
        }
        else {
            wuf.merge(l, r, d);
        }
    }
    cout << "Yes" << endl;
    return 0;
}


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

int main(){
    string s;
    cin>>s;
    char a[4]={'0','1','6','8'};
    if(s[s.size()-1]=='3'){
        cout<<"bon"<<endl;
        
    }
    else{
        for(int i=0;i<4;++i){
            if(s[s.size()-1]==a[i]){
                cout<<"pon"<<endl;
                return 0;
            }
        }
        cout<<"hon"<<endl;
    }
    return 0;
}

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

void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define debug(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define debug(x...)
#endif

#define IOS             ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define read            freopen("in.txt","r",stdin)
#define write           freopen("out.txt","w",stdout)
#define loop(i,a,b)     for (int i = a; i <= b; i++)
#define rloop(i,a,b)    for (ll i = a; i >= b; i--)
#define ms(a,x)         memset(a,x,sizeof a)
#define ll              long long int
#define ff              first
#define ss              second
#define all(a)          a.begin(),a.end()
#define rall(a)         a.rbegin(),a.rend()
#define pb              push_back
#define nl              cout<<"\n"
#define gcd(a,b)        __gcd((a),(b))
#define lcm(a,b)        ((a)*(b))/(gcd(a,b))
#define sq(a)           (a)*(a)
#define sz(a)           a.size()
#define mod             1000000007
#define PI              2*acos(0.0)
vector<int> spf(1000005);

vector<int> modified_sieve(int n) {
    for (int i = 1; i <= n; i++)
        spf[i] = i;
    vector<int> primes;
    for (int i = 2; i * i <= n; i++)
        if (spf[i] == i)
            for (int j = i + i; j <= n; j += i)
                if (spf[j] == j)
                    spf[j] = i;
    for (int i = 2; i <= n; i++)
        if (spf[i] == i)
            primes.push_back(i);
    return primes;
}

vector<int> factorize(int x) {
    vector<int> res;
    while (x > 1) {
        res.push_back(spf[x]);
        x /= spf[x];
    }
    return res;
}
int main()
{
    IOS
    int T=1;
    //cin>>T;
    while(T--)
    {
        int n;
        cin>>n;
        vector<int> a=modified_sieve(n),b=factorize(n);
        int ans=0;
        loop(i,1,n-2)
        {

            vector<int> y=factorize(n-i);
            int t=1;
            map<int,int> m;
            loop(j,0,sz(y)-1) m[y[j]]++;
            for(auto p:m) t*=(p.ss+1);
            ans+=t;

        }
        cout<<ans+1;
    }
    return 0;
}


Measured memory_bytes: 7780
#include<bits/stdc++.h>
#define ff first
#define ss second
#define IO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
using namespace std;
typedef long long ll;
const int INF = 1e9;
const int maxn = 1000000;

int main() {
    int n;
    cin >> n;
    vector<int> a(n);
    vector<vector<int>> v(n + 1);
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        if (a[i] <= n) v[a[i]].push_back(i);
    }

    vector<ll> cnt_forward(n), cnt_backward(n);
    for(int i = 0; i < n; i++){
        int val = a[i];
        if(i - val + 1 >= 0)
            cnt_forward[i - val + 1]++;
        if(i + val - 1 < n)
            cnt_backward[i + val - 1]++;
    }
    ll ans = 0;
    for(int i = 0; i < n; i++){
        int val = a[i];
        int pos = i;
        if(pos + val + 1 < n)
            ans += cnt_forward[pos + val + 1];
        if(pos - val - 1 >= 0)
            ans += cnt_backward[pos - val - 1];
    }
    cout << ans / 2 << '\n';
    return 0;
}

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

int main(int argc, const char **argv)
{
	std::string str1, str2;
  	int errors = 0;
  	
  	std::cin >> str1;
  	std::cin >> str2;
  
  	for ( int len = 0; len < str1.size(); len++ )
    {
    	if ( str1[ len ] != str2[ len ] ) errors++;
    }

  	std::cout << errors << std::endl;
  	return 0;
}

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

int main()
{
    long long n;
    cin >> n;
    vector<long long> arr(n);
    for(int i=0;i<n;i++)
    {
        cin >> arr[i];
    }
    long long sum = 0;
    for(int i=1;i<n;i++)
    {
        if(arr[i]-arr[i-1]>=0) continue;
        sum += abs(arr[i]-arr[i-1]);
        arr[i] = arr[i-1];
    }
    
    cout << sum ;
    return 0;
}

Measured memory_bytes: 4756
n = input()

arr = [int(x) for x in input().split()]
d = {}
s = sum(arr)
for num in arr:
  d[num] = d.get(num,0) + 1
  
q = int(input())
while q > 0:
  a, b = map(int, input().split())
  if a not in d:
    print(s)
    q -= 1
    continue
  s = s - d[a]*a + d[a]*b
  d[b] = d.get(b,0) + d[a]
  d[a] = 0
  print( s )
  q -= 1

Measured memory_bytes: 20408
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back
#define mp make_pair
using namespace std;
typedef pair <int, int> pii;
typedef pair <pii, int> ppiii;

const int INF = 0x3f3f3f3f;
int n, m, r, t1, t2, t3, d[100005];
vector <ppiii> e;

int main() {
	cin >> n >> m >> r;
	for (int i = 0; i < n; i++) d[i] = INF;
	for (int i = 0; i < m; i++) {
		cin >> t1 >> t2 >> t3;
		e.pb(mp(mp(t1, t2), t3));
	}
	d[r] = 0;
	for (int i = 0; i < n - 1; i++) {
		for (ppiii j : e) {
			int &u = j.fi.fi, &v = j.fi.se, &w = j.se;
			if (d[u] != INF && d[u] + w < d[v]) {
				d[v] = d[u] + w;
			}
		}
	}
	for (ppiii i : e) {
		int &u = i.fi.fi, &v = i.fi.se, &w = i.se;
		if (d[u] != INF && d[u] + w < d[v]) {
			cout << "NEGATIVE CYCLE" << endl;
			return 0;
		}
	}
	for (int i = 0; i < n; i++) {
		if (d[i] == INF) cout << "INF" << endl;
		else cout << d[i] << endl;
	}
}



Measured memory_bytes: 3144
const stdin: string[] = [];

function main() {
    const input = stdin[0];
    const length = input.length;
    const A = input.substring(0, (length - 1) / 2);
    const B = input.substring(((length - 1) / 2) + 1);

    console.log(A === B ? "Yes" : "No");
}

require("readline").createInterface({
  input: process.stdin,
  output: process.stdout
}).on("line", _ => {
    stdin.push(_);
}).on("close", () => main());



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

const int M = 2019;
int main(){
  cin.tie(0); ios_base::sync_with_stdio(0);
  int l, r;
  cin>> l >> r;
  if (l+M+2<r) cout << 0 <<endl;
  else {
    int ans = M;
    for(int i=l;i<=r;i++) {
      for(int j=i+1;j<=r;j++) {
        ans = min(ans, (i%M)*(j%M)%M);
      }
    }
    cout << ans <<endl;
  }
}


Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    int c[9]={0};
    for (int i=0; i<9; i++) {
        cin>>c[i];
    }
    for (int i=0; i<2; i++) {
        int b2 = c[i]-c[i+1];
        for (int j=0; j<2; j++) {
            if(b2!=c[i+3*(j+1)]-c[i+1+3*(j+1)]){
                cout<<"No"<<endl;
                return 0;
            }
        }
    }
    
    cout<<"Yes"<<endl;
    return 0;
}

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

using namespace std;

#define REP(i,a,b) for (int i = a; i <= b; i++)
#define ALL(a)              a.begin(), a.end()
#define ALLN(a, n)          (a, a+n)
#define MAX                 10000007
#define MIN                 -10000007



              
int main()
{
  ios::sync_with_stdio(0);
    cin.tie(0);
  #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    freopen("error.txt", "w", stderr);
    #endif
      
    int t;
    t=1;
     //  cin>>t;
    while(t--){
        	string s;
        	cin>>s;
       		cout<<s.substr(0,3); 	  
       


             }
             cerr<<"Time taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl;
    return 0;
}


Measured memory_bytes: 3840
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>

using namespace std;
typedef long long LL;

int main(){
	int N;
	cin >> N;
	string S[200010];
	for(int i=0; i<N; i++) cin >> S[i];
	sort(S,S+N);
	S[N]="";
	vector<pair<int,string> > P;
	int num=-1;
	for(int i=0; i<N; i++){
		if(S[i]!=S[i+1]){
			P.emplace_back(make_pair(i-num,S[i]));
			num=i;
		}
	}
	sort(P.begin(),P.end());
	int m=P[P.size()-1].first;
	int k=P.size()-1;
    vector<string> ans;
	while(P[k].first==m){
		ans.emplace_back(P[k].second);
		k--;
	}
    for(int i=ans.size()-1; i>=0; i--) cout << ans[i] << endl;

	return 0;
}

Measured memory_bytes: 22000
#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;
use std::io::{Write, BufWriter};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

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

macro_rules! read_value {
    ($next:expr, [graph1; $len:expr]) => {{
        let mut g = vec![vec![]; $len];
        let ab = read_value!($next, [(usize1, usize1)]);
        for (a, b) in ab {
            g[a].push(b);
            g[b].push(a);
        }
        g
    }};
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
    ($next:expr, usize1) => (read_value!($next, usize) - 1);
    ($next:expr, [ $t:tt ]) => {{
        let len = read_value!($next, usize);
        read_value!($next, [$t; len])
    }};
    ($next:expr, $t:ty) => ($next().parse::<$t>().expect("Parse error"));
}

#[allow(unused)]
macro_rules! debug {
    ($($format:tt)*) => (write!(std::io::stderr(), $($format)*).unwrap());
}
#[allow(unused)]
macro_rules! debugln {
    ($($format:tt)*) => (writeln!(std::io::stderr(), $($format)*).unwrap());
}

fn solve() {
    let out = std::io::stdout();
    let mut out = BufWriter::new(out.lock());
    macro_rules! puts {
        ($($format:tt)*) => (let _ = write!(out,$($format)*););
    }
    input! {
        d: [[i32; 2]],
    }
    let mut ma = 0;
    let mut cur = 0;
    for d in d {
        if d[0] == d[1] {
            cur += 1;
        } else {
            cur = 0;
        }
        ma = max(ma, cur);
    }
    puts!("{}\n", if ma >= 3 { "Yes" } else { "No" });
}

fn main() {
    // In order to avoid potential stack overflow, spawn a new thread.
    let stack_size = 104_857_600; // 100 MB
    let thd = std::thread::Builder::new().stack_size(stack_size);
    thd.spawn(|| solve()).unwrap().join().unwrap();
}


Measured memory_bytes: 2244
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
int acs(const void *a, const void *b) { 
  return *(int*)a - *(int*)b;
} /* 1,2,3,4.. */
int des(const void *a, const void *b) {
  return *(int*)b - *(int*)a;
} /* 8,7,6,5.. */
int cmp_char(const void *a, const void *b) { 
  return *(char*)a - *(char*)b;
} /* a,b,c,d.. */
int cmp_str(const void *a, const void *b) {
  return strcmp(*(const char **)a, *(const char **)b);
} /* aaa,aab.. */
#define min(a,b) (a < b ? a : b)
#define max(a,b) (a > b ? a : b)
#define rep(i, l, r) for (int i = l; i < r; i++)
#define MAX 100001
#define MOD 1000000007
#define INF 1000000009
typedef long long int lli;

int gcd(int x, int y) {
  if (y == 0) return x;
  return gcd(y, x % y);
}

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

  int ans = 0;
  rep(i, 1, k+1) {
    rep(j ,1, k+1) {
      rep(l, 1, k+1) {
        ans += gcd(gcd(i, j), l);
      }
    }
  }
  printf("%d\n", ans);
  return 0;
}


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

#define int long long
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define fr(i,j,k) for(i = j; i < (k); i++)
#define all(x) x.begin(), x.end()
#define el '\n'
#define remax(a,b) a = max(a, b)
#define remin(a,b) a = min(a, b)
#define sz(x) int32_t(x.size())

typedef long double ld;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vpi;
// --------------------------------------------------------------------

const pii dxy[] = { {-1, 0}, {1, 0}, {0, 1}, {0, -1} };
const int mod = 1e9 + 7;
const int INF = 2e18;
const ld EPS = 1e-9;
const int NN = 1e5 + 2;


void solve() {
      int i = 0, j = 0, k = 0, n = 0, m = 0; 
      string s,t ; cin >> s>> t;
      if(t.substr(0, sz(s)) == s) cout <<"Yes";
      else cout << "No";
      
}

int32_t main() {
      ios::sync_with_stdio(false); cin.tie(0); 
      int T = 1; 
      // cin >> T;
      for(int tc = 1; tc <= T; tc++) {
            solve();
       }
      return 0;
}

Measured memory_bytes: 3656
// clang-format off
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#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##_len=(n); i<i##_len; ++i)
#define rep1(i,n) for(ll i=1, i##_len=(n); i<=i##_len; ++i)
#define rrep(i,n) for(ll i=n-1; i>=0; --i)
#define rrep1(i,n) for(ll i=n; i>0; --i)
#define all(x) (x).begin(),(x).end()
#define SORT(x) sort(all(x))
#define SORT_DESC(x) sort((x).rbegin(),(x).rend())
#define pb push_back
#define mp make_pair
#define coutl cout<<fixed<<setprecision(10)
#define ANS(ans) cout<<ans<<endl;
const ll LINF = (1LL << 62) - 1;
const int INF = (1 << 30) - 1;
template<class T>bool chmax(T &a, const T &b){if (a<b){a=b;return 1;}return 0;}
template<class T>bool chmin(T &a, const T &b){if (b<a){a=b;return 1;}return 0;}
const string YES = "Yes";
const string NO = "No";
// clang-format on

void solve(long long N, long long M, std::vector<long long> A) {
  ll sum = 0;
  rep(i, N) {
    sum += A[i];
  }
  long double norma = (long double)sum / 4 / M;
  ll c = 0;
  rep(i, N) {
    if ((long double)A[i] >= norma)
      ++c;
  }
  ANS((c >= M ? YES : NO));
}

// clang-format off
int main() {
  long long N;
  scanf("%lld",&N);
  long long M;
  scanf("%lld",&M);
  std::vector<long long> A(N);
  for(int i = 0 ; i < N ; i++){
    scanf("%lld",&A[i]);
  }
  solve(N, M, std::move(A));
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<stack>
#include<stdio.h>
#include<vector>
#include<cmath>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)
typedef int long long ll;
using namespace std;

int main(){
   
    int n;
    cin>>n;
    
    
    ll a[100];
    a[0]=2;
    a[1]=1;
    for(int i=2;i<=n;i++){
        a[i]=a[i-1]+a[i-2];
    }
    cout<<a[n]<<endl;
    
    
    
    
return 0;
}


Measured memory_bytes: 256
n = int(input())
a = list(map(int,input().split()))
head_s = [] 
back_s = []
n2 = 1
if n%2 == 0:
	n2 = 0
for h in range(n-1,-1,-2):
	head_s.append(a[h])
for b in range(n2,n,2):
	back_s.append(a[b])
#print(head_s,back_s)
ans_h = (' '.join(map(str,head_s)))
ans_b = (' '.join(map(str,back_s)))
print(ans_h,ans_b)

Measured memory_bytes: 30972