akhauriyash/Code-Regression huggingface dataset:
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<cstdlib>

int n;
int t[100001], x[100001], y[100001];
int main(){
    scanf("%d", &n);
    t[0] = x[0] = y[0] = 0;
    for(int i = 1; i <= n; i++){
        scanf("%d%d%d", &t[i], &x[i], &y[i]);
    }
    for(int i = 0; i < n; i++){
        int d = abs(x[i+1]-x[i])+abs(y[i+1]-y[i]);
       
        int time = abs(t[i+1]-t[i]);
        if(d>time || (d-time)%2 != 0){
            puts("No");
            return 0;
        }
    }
    puts("Yes");
    return 0;
}



Measured memory_bytes: 1280
#include <sstream>
#include<iostream>
#include<algorithm>
#include<vector>
#include<set>
#include<ctime>
#include<cmath>
#include<map>
#include<stack>
#include<random>
#include<queue>
#include<list>
#include<math.h>
#include<complex>
using namespace std;
#define ll long long int
#define ld long double
#define key pair<ld,ld>
#define ii pair<int,int>
#define si set<int>
#define vii vector<pair<int,int> >
#define vi vector<int>
#define vll vector<ll>
#define vb vector<bool>
#define vvi vector<vector<int> >
#define vs vector<string>
#define all(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define f first
#define s second
#define nu 100001
#define mul(x,y) ((ll)(x)*(y))%mod
#define tr(c,i) for(auto i = (c).begin(); i != (c).end(); i++)
#define fastio  ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define forn(i, n) for (int i = 0; i < int(n); i++)
const ll INF=1000000000000;
const ll mod=1000000007;

ll  MOD(ll  a,ll  b)
{
    if(a>b)
        return a-b;
    else
        return b-a;
}
ll  max3(ll  a,ll  b,ll c)
{
    return max(c,max(a,b));
}
ll min3(ll a,ll  b,ll  c)
{
    return min(a,min(b,c));
}
ll  power(ll  x,ll  y )
{
    ll res = 1;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x);//%mod;
        y = y>>1;
        x = (x*x);//%mod;
    }
    return res;//%mod;
}
ll  power1(ll  x,ll  y )
{
    ll res = 1;
    while (y > 0)
    {
        if (y & 1)
            res = (res*x)%mod;
        y = y>>1;
        x = (x*x)%mod;
    }
    return res%mod;
}
ll logg(ll  a)
{
    ll  x=0;
    while(a>1)
    {
        x++;
        a/=2;
    }
    return x;
}
ll  gcd(ll  a,ll   b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
ll abso(ll x)
{
    if(x<0)
    {
        return -x;
    }
    return x;
}
ll ceiling (ll  a,ll  b)
{
    if(a%b==0)
    {
        return a/b;
    }
    else
    {
        return a/b+1;
    }
}
ll modinv(ll x)
{
    return power1(x,mod-2);
}
int main()
{
    int n;
    cin>>n;
    vector<double> prob(n+1);
    for(int i=1;i<=n;i++)
    {
        cin>>prob[i];
    }
    vector<vector<double>> dp(n+1);
    for(int i=0;i<=n;i++)
    {
        dp[i].resize(n+1,0);
    }
    dp[0][0]=1;
    for(int j=1;j<=n;j++)
    {
        dp[j][0]=dp[j-1][0]*(1-prob[j]);
        for(int k=1;k<=n;k++)
        {
            dp[j][k]=dp[j-1][k]*(1-prob[j])+dp[j-1][k-1]*(prob[j]);
        }
    }
    double ans=0;
    for(int i=0;i<=n;i++)
    {
        if(i>n-i)
        {
            ans+=dp[n][i];
        }
    }
    printf("%.12f",ans);
}


Measured memory_bytes: 70656
#4問目
import math
N = int(input())
yakusuu = []
#約数列挙して桁数が小さいやつを抜き出せばOK
for i in range(1, math.ceil(N ** (1/2))+1):
    if N % i == 0:
        yakusuu.append([i, int(N/i)])
keta1 = 0
keta2 = 10 ** 10
for i in yakusuu:
    if len(str(i[0])) >= keta1 and len(str(i[1])) <= keta2:
        keta1 = len(str(i[0]))
        keta2 = len(str(i[1]))
print(max(keta1, keta2))

Measured memory_bytes: 3188
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <map>
#include <cmath>
#include <queue>
using namespace std;
#define FOR(i,a,b) for(int (i)=(a);(i)<=(b);(i)++)
#define FFOR(i,a,b) for(int (i)=(a);(i)>=(b);(i)--)
#define rep(i,n) FOR(i,0,n-1)
#define int long long
#define MOD 998244353
#define MAXN  100005
#define P pair<int,int>
 
 
signed main(){
	
	string s;cin>>s;
	
	int ans = 0;
	rep(i,4) ans += s[i]=='+'?1:-1;
	
	cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>

#include<queue>
using namespace std;
#define REP(i,n) for(int i=0;i<n;i++)
 
#define INF (1e10)
typedef long long unsigned int ll;
#define SIZE_OF_ARRAY(array) (sizeof(array)/sizeof(array[0]))
 

template<typename T>
int vector_finder(std::vector<T> vec, T number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

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

template<typename T>
T lcm(T a,T b){
	T g = gcd(a, b);
	return a * b / g;
}

void clear( std::queue<pair<int,int> > &q )
{
   std::queue<pair<int,int> > empty;
   std::swap( q, empty );
}

int N,M;
int ans = 0;

int main()
{
	cin >> N;
	int a[N];
	int rate[8];
	int over=0;
	REP(i, 8)
	{
		rate[i] = 0;
	}
	REP(i, N)
	{
		cin >> a[i];
		if(a[i]>=3200){
			over++;
		}else{
			int n = a[i] / 400;
			rate[n] = 1;
		}
	}
	int mi = 0;
	int ma;
	if (over == N)
	{
		mi = 1;
		ma = N;
	}
	else{
		
		REP(i,8){
			mi += rate[i];
		}
		ma =mi+over;
	}

	cout << mi << " " << ma << endl;
	return 0;
}

Measured memory_bytes: 256
import sys
input = sys.stdin.readline
sys.setrecursionlimit(2 * 10**6)


def inpl():
    return list(map(int, input().split()))


def main():
    A, B, C, K = inpl()
    if K <= A:
        print(K)
    elif K <= A + B:
        print(A)
    else:
        print(A - (K - A - B))
    return


if __name__ == '__main__':
    main()


Measured memory_bytes: 9172
#include <cstdio>

int main()
{
    int D, N;
    int ans = 1;

    scanf("%d %d", &D, &N);
    if (N == 100) {
        N++;
    }
    for (int i = 0; i < D; i++) {
        ans *= 100;
    }
    printf("%d\n", ans * N);

    return 0;
}


Measured memory_bytes: 128
# include <iostream>
# include <cstdio>
# include <algorithm>
# include <queue>
using namespace std;
typedef long long LL;
const int maxn = 3e5+80;
const LL INF = 0x3f3f3f3f3f3f3f3f;
struct node
{
    LL x, y, z;
}a[maxn];
bool cmp1(node na, node nb){return na.x-na.y > nb.x - nb.y;}
struct cmp2 {bool operator ()(node na, node nb) {return na.x-na.z>nb.x-nb.z;}};
struct cmp3 {bool operator ()(node na, node nb) {return na.y-na.z>nb.y-nb.z;}};
priority_queue<node, vector<node>, cmp2>p;
priority_queue<node, vector<node>, cmp3>q;
LL l[maxn], r[maxn];
int main()
{
    int x, y, z;
    scanf("%d%d%d",&x,&y,&z);
    for(int i=1; i<=x+y+z; ++i) scanf("%lld%lld%lld",&a[i].x,&a[i].y,&a[i].z);
    sort(a+1, a+1+x+y+z, cmp1);
    while(!q.empty()) q.pop();
    while(!p.empty()) p.pop();
    LL sum = 0;
    for(int i=1; i<=x; ++i)
    {
        sum += (LL)a[i].x;
        p.push(a[i]);
    }
    l[x] = sum;
    for(int i=x+1; i<=x+z; ++i)
    {
        if(p.empty() || a[i].x - a[i].z < p.top().x - p.top().z)
            sum += a[i].z;
        else
        {
            sum = sum - p.top().x + p.top().z + a[i].x;
            p.pop();
            p.push(a[i]);
        }
        l[i] = sum;
    }
    sum = 0;
    for(int i=x+y+z; i>x+z; --i)
    {
        q.push(a[i]);
        sum += (LL)a[i].y;
    }
    r[x+z] = sum;
    for(int i=x+z; i>x; --i)
    {
        if(q.empty() || a[i].y - a[i].z < q.top().y - q.top().z)
            sum += a[i].z;
        else
        {
            sum = sum - q.top().y + q.top().z + a[i].y;
            q.pop();
            q.push(a[i]);
        }
        r[i-1] = sum;
    }
    LL ans = 0;
    for(int i=x; i<=x+z; ++i) ans = max(ans, l[i]+r[i]);
    printf("%lld\n",ans);
    return 0;
}


Measured memory_bytes: 10380
import sys

class Fenwick_Tree:
    def __init__(self, n):
        self._n = n
        self.data = [0] * n
    
    def add(self, p, x):
        assert 0 <= p < self._n
        p += 1
        while p <= self._n:
            self.data[p - 1] += x
            p += p & -p
    
    def sum(self, l, r):
        assert 0 <= l <= r <= self._n
        return self._sum(r) - self._sum(l)
    
    def _sum(self, r):
        s = 0
        while r > 0:
            s += self.data[r - 1]
            r -= r & -r
        return s


def main():
    input = sys.stdin.readline
    n, q = map(int, input().split())
    fw = Fenwick_Tree(n)
    for i, a in enumerate(map(int, input().split())): fw.add(i, a)
    A = list(map(int, sys.stdin.read().split()))
    for i in range(0, 3 * q, 3):
        t, a, b = A[i:i+3]
        if t == 0:
            fw.add(a, b)
        else:
            print(fw.sum(a, b))

if __name__ == "__main__":
    main()



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

namespace A_ABC145
{
    class MainClass
    {

        static int[] s;

        public static void Main(string[] args)
        {
            s = Array.ConvertAll(ReadLine().Split().ToArray(), int.Parse);
            WriteLine(s[0]*s[0]);
        }
    }
}


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

int N, M;//?度? n 的序列,有 m 个操作
int F[205000];
bool Jud[205000];

int main()
{
    cin >> N >> M;
    memset(Jud, true, sizeof(Jud));
    for(int i = 1; i <= M; i++)    cin >> F[i];
    for(int i = M; i >= 1; i--)
        if(Jud[F[i]] == true){
            Jud[F[i]] = false;
            cout << F[i] << endl;
        }
    for(int i = 1; i <= N; i++)
        if(Jud[i] == true)
            cout << i << endl;
    return 0;
}

Measured memory_bytes: 3692
#include <algorithm>
#include <sstream>
#include <iostream>
#include <list>
#include <map>
#include <math.h>
#include <stack>
#include <stdio.h>
#include <string>
#include <queue>
#include <vector>
using namespace std;

long long int gcd(long long int a, long long b) {
	if (a == 0 || b == 0) return 0;
	if (a % b == 0) return b;

	return gcd(b, a % b);
}

int main()
{
	long long int a, b, x;
	while (cin >> a >> b && a != EOF) {
		x = gcd(a, b);
		cout << x << " " << a * b / x << endl;
	}
}



Measured memory_bytes: 3108
n = int(input())
ws = [input() for i in range(n)]

ans = 'Yes'
tmp = ws.pop(0)
a = [tmp]

for w in ws:
    if w in a:
        ans = 'No'
        break
        
    if tmp[len(tmp)-1] != w[0]:
        ans = 'No'
        break
        
    a.append(w)
    tmp = w
        
print(ans)

Measured memory_bytes: 3064
#include <stdio.h>

int
main(void)
{
  int i = 1, input;
  while(1) {
    scanf("%d", &input);
    if (input == 0) {
      break;
    } else {
      printf("Case %d: %d\n", i, input);
      i += 1;
    }
  }
}

Measured memory_bytes: 1712
from collections import defaultdict
N = int(input())

SS = []
for i in range(N):
  s = list(input())
  s.sort()
  SS.append(s)
  
SS.sort()


ans = 0
cnt = defaultdict(int)
for i in range(N):
  s = SS[i]
  s = ''.join(s)
  cnt[s] += 1
  
for _,v in cnt.items():
  ans += v * (v - 1) // 2
  
print(ans)
  


Measured memory_bytes: 39364
N,K = map(int, input().split())
*A, = map(int, input().split())
A_set = list(set(A))

d = {}

for key in A:
    if key in d:
        d[key] += 1
        continue
    d[key] = 1

count = 0
d = sorted(d.items(), key=lambda x: x[1])
ans = 0
for key,data in d:
    if count<(len(A_set)-K):
        ans = ans + data
    count = count + 1
print(ans)


Measured memory_bytes: 49716
/*
─────────────────────
───────────████████──
──────────███▄███████
──────────███████████
──────────███████████
──────────██████─────
──────────█████████──
█───────███████──────
██────████████████───
███──████AJ████──█───
███████████████──────
███████████████──────
─█████████████───────
──███████████────────
────████████─────────
─────███──██─────────
─────██────█─────────
─────█─────█─────────
─────██────██────────
─────────────────────
*/

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

#define fastio ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define ll unsigned long long

vector<double> p;
vector<vector<double>> dp;
int N;

double getProb(int index, int remainingTails) {
	if (index == N) {
		return 1.00;
	}
	if (dp[index][remainingTails] != -1) return dp[index][remainingTails];
	double res = 0;
	if (remainingTails > 0) {
		res += (1.00 - p[index]) * getProb(index + 1, remainingTails - 1);
	}
	res += p[index] * getProb(index + 1, remainingTails);
	return dp[index][remainingTails] = res;
}

int main() {
	cin >> N;
	p = vector<double> (N);
	dp = vector<vector<double>> (N, vector<double>(N, -1));
	for (int i = 0; i < N; i++) {
		cin >> p[i];
	}
	int maxTails = N / 2;
	double res = getProb(0, maxTails);
	cout << fixed << setprecision(10) << res << endl;
	return 0;
}

Measured memory_bytes: 73780
#include<iostream>
#include<string>
#include<vector>

using namespace std;

#define MOD 1000000007

template<typename T>
istream& operator >> (istream& is, vector<T>& vec) {
	for (T& x : vec) is >> x;
	return is;
}
int main() {
	int n, m;
	cin >> n >> m;
	vector<long long> a(n);
	vector<long long> b(m);
	cin >> a >> b;
	long long asu = 0, bsu = 0;
	for (int i = 0; i < n; i++)
	{
		asu -= a[i] * (n - i - 1);
		asu += a[i] * i;
	}
	for (int i = 0; i < m; i++)
	{
		bsu -= b[i] * (m - i - 1);
		bsu += b[i] * i;
	}
	long long u = (abs(asu%MOD)*abs(bsu%MOD)) % MOD;
	cout << u << endl;
}

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

int main(){
int N,M;
  cin>>N>>M;
  vector<int>L(M), R(M);
  for(int i=0; i<M; i++){
   cin>>L[i]>>R[i];
  }
  
  int minR=*min_element(R.begin(), R.end());
  int maxL=*max_element(L.begin(), L.end());

  int count=0;
  for(int i=1; i<=N; i++){
   if(maxL<=i && i<=minR){count++;}
  }
  
  cout<<count;
}


Measured memory_bytes: 1024
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO ?????????????????????????????????????????????
		Scanner sc = new Scanner(System.in);
		int[] price = new int[5];
		for(int i = 0; i < 5; i++) {
			price[i] = sc.nextInt();
		}
		int p_min = price[0], j_min = price[3];
		for(int i = 1; i < 3; i++) {
			if(p_min > price[i]) {
				p_min = price[i];
			}
		}
		if(j_min > price[4]) {
			j_min = price[4];
		}
		int min;
		min = p_min + j_min - 50;
		System.out.println(min);
	}

}

Measured memory_bytes: 26208
package main

import (
	"fmt"
)

func main() {
	var n,a,b int
	fmt.Scan(&n, &a, &b)

	total := 0
	for i := 1; i <= n; i++ {
		sum := calc(i)
		if a <= sum && sum <= b {
			total += i
		}
	}
	fmt.Println(total)
}

func calc(n int) int{
	sum := 0
	for {
		if n == 0 {
			break
		}
		sum += n % 10
		n = n / 10
	}
	return sum
}

Measured memory_bytes: 512
// https://atcoder.jp/contests/abc177/tasks/abc177_e
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i, n) FOR(i, 0, n)
#define FOR(i, s, n) for (int i = (s), i##_len = (n); i < i##_len; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define ALLR(obj) (obj).rbegin(), (obj).rend()
#define CEIL(a, b) ((a - 1) / b + 1)
int gcd(int a, int b) { return b ? gcd(b, a % b) : a; }

const int SZ = 1e6;

// エラトステネスの篩
template <int N> struct Prime {
    bitset<N + 1> b;
    Prime() : b() {
        // trueで初期化
        b.flip();
        b[0] = b[1] = false;
        for (int i = 2; i <= N; ++i) {
            if (b[i]) {
                for (int j = i * i; j <= N; j += i) {
                    b[j] = false;
                }
            }
        }
    }
};
// SZ = 1e6 だと10ms
Prime<SZ> prime;

void solve() {
    int N;
    cin >> N;
    vector<int> A(N), D(SZ + 1);
    for (auto &x : A) {
        cin >> x;
        // 同じ数が重複するケースを考慮
        D[x]++;
    }
    auto fn = [&]() {
        REP(i, SZ) {
            // 素数の場合
            if (prime.b[i]) {
                int cnt = 0;
                for (int now = i; now <= SZ; now += i) {
                    cnt += D[now];
                }
                // 共通の素数を含むのでgcd(ALL) >= i
                if (cnt >= 2) {
                    return false;
                }
            }
        }
        return true;
    };
    // trueなら "pairwise coprime"
    if (fn()) {
        cout << "pairwise coprime" << endl;
    } else {
        int g = A[0];
        for (auto &x : A) {
            g = gcd(g, x);
        }
        if (g == 1)
            cout << "setwise coprime" << endl;
        else
            cout << "not coprime" << endl;
    }
}

signed main() {
    cin.tie(nullptr)->sync_with_stdio(false);
    solve();
}


Measured memory_bytes: 19052
using System;
using System.Collections.Generic;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            // 各種変数の読み込み
            var s = Console.ReadLine().Split(' ');
            var a = int.Parse(s[0]);
            var b = int.Parse(s[1]);
            if ((b - 1) % (a - 1) == 0)
            {

                Console.WriteLine((b - 1) / (a - 1));
            }
            else
            {
                Console.WriteLine((b - 1) / (a - 1) + 1);
            }


#if DEBUG
            Console.ReadKey();
#endif
        }
    }
}


Measured memory_bytes: 11092
#include <assert.h>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <numeric>
#include <functional>
#include <iostream>
#include <string>
#include <array>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <complex>
#include <bitset>
typedef long long ll;
typedef unsigned long long ull;

using namespace std;

template <typename T>
struct Counter {
  map<T, ll> cnt;
  void add(T key) {
    if (cnt.count(key)) {
      cnt[key]++;
    } else {
      cnt[key] = 1;
    }
  }
  ll get(T key) {
    if (cnt.count(key)) {
      return cnt[key];
    } else {
      return 0;
    }
  }
  typename map<T, ll>::iterator begin() {
    return cnt.begin();
  }
  typename map<T, ll>::iterator end() {
    return cnt.end();
  }
  typename map<T, ll>::reverse_iterator rbegin() {
    return cnt.rbegin();
  }
  typename map<T, ll>::reverse_iterator rend() {
    return cnt.rend();
  }
};

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

  int N;
  cin >> N;

  Counter<ll> counter;

  for (int i = 0; i < N; i++) {
    ll d;
    cin >> d;
    counter.add(d);
  }

  int M;
  cin >> M;
  Counter<ll> ans;
  for (int i = 0; i < M; i++) {
    ll d;
    cin >> d;
    ans.add(d);
  }

  for (auto it = ans.begin(); it != ans.end(); it++) {
    if (counter.get(it->first) < it->second) {
      cout << "NO" << endl;
      return 0;
    }
  }

  cout << "YES" << endl;
  return 0;
}


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

void test(long& a, long b) {
  if (a > b) a = b;
}

int main() {
  int n;

  cin >> n;

  vector<long> h(n), ans(n);

  for (int i = 0; i < n; i++) {
    cin >> h[i];
    // ans[i] = 1e9;
  }

  ans[0] = 0;
  ans[1] = abs(h[0] - h[1]);
  for (int i = 2; i < n; i++) {
    ans[i] = 1e9;
    for (int j = 1; j < 2 + 1; j++) {
      ans[i] = min(ans[i], abs(h[i] - h[i - j]) + ans[i - j]);
      // test(ans[i], abs(h[i] - h[i - j]) + ans[i - j]);
      // test(ans[i], abs(h[i] - h[i - 1]) + ans[i - 1]);
      // test(ans[i], abs(h[i] - h[i - 2]) + ans[i - 2]);
    }
  }

  cout << ans[n - 1];

  return 0;
}


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

using namespace std;

int main(){
   string s;cin >>s;
   vector<int>direction(4,-1);
   char x[4]={'N','S','W','E'};
    for (int i = 0; i < s.size(); ++i) {
        for (int j = 0; j < 4; ++j) {
            if (s[i] == x[j])direction[j] += 2;
        }
    }
    if(direction[0]*direction[1]<0||direction[2]*direction[3]<0)puts("No");
    else puts("Yes");
   return 0;
}

Measured memory_bytes: 256
n, l = list(map(int, input().split()))

tastes = [l + i - 1 for i in range(1, n + 1)]
sum_tastes = sum(tastes)
sum_tastes_eat = [sum_tastes - tastes[i] for i in range(n)]
dif_tastes = [abs(sum_tastes - x) for x in sum_tastes_eat]
#print(dif_tastes)
idx = dif_tastes.index(min(dif_tastes))
print(sum_tastes_eat[idx])

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

int main(){
  vector<int> A(3);
  int K;
  cin>>A.at(0)>>A.at(1)>>A.at(2)>>K;
  sort(A.begin(),A.end());
  for(int i=0;i<K;i++){
    A.at(2)*=2;
  }
  cout<<A.at(0)+A.at(1)+A.at(2)<<endl;

}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll  long long
#define pp pair<int,int>
#define ppn pair<pp,int>
#define F first
#define S second
#define N 200005
#define mod 1000000007
#define pi 3.14159265358979323846

using namespace std;


int main()
{


    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);

    int  t, l, r, m, n,k;
    //string ss, s;
    cin>>t;


    if(t>=400 && t<=599)
        k=8;
    else if(t>=600 && t<=799)k=7;
    else if(t>=800 && t<=999)k=6;

    else if(t>=1000 && t<=1199)k=5;

    else if(t>=1200 && t<=1399)k=4;

    else if(t>=1400 && t<=1599)k=3;

    else if(t>=1600 && t<=1799)k=2;

    else k=1;




    // t+=1;
    int x[]= {8,7,6,5,4,3,2,1};
    cout<<k<<endl;

}


Measured memory_bytes: 3652
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include<bits/stdc++.h>
using namespace __gnu_pbds;
using namespace std;
#define ll long long int
#define ull unsigned long long int
#define ff first 
#define ss second
#define pb(x) push_back(x)
#define pf(x) push_front(x)
#define start_routine() int begtime = clock();
#define end_routine() int endtime = clock(); \
                      cerr << "\n\n" << "Time elapsed: " << \
                      (endtime - begtime)*1000/CLOCKS_PER_SEC << " ms\n\n"; \
                      return 0
#define testcase(t) int t;cin>>t;while(t--)
#define mp(x,y) make_pair(x,y)
#define in(x) insert(x)
#define rep(i,a,b)  for (__typeof((b)) i=(a);i<=(b);i++)
#define nrep(i,a,b)  for (__typeof((b)) i=(b);i>=(a);i--)
#define PI 3.14159265358979323846
#define SP(x) setprecision(x)
#define reflex ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define M 998244853
#define sz(a) (int)a.size()
#define endl "\n"
#define all(v) v.begin(), v.end()
#define mem(arr,val) memset(arr,val,sizeof(arr)) //For "0" and "-1"                  
#define inp0(a,n) rep(i,0,n-1) cin>>a[i];
#define inp1(a,n) rep(i,1,n) cin>>a[i]; 
#define prll(x) printf("%lld",x)
#define nth_ele(v,n) nth_element(v.begin(), v.begin()+n ,v.end())//O(N)
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef tree< int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
ll gcd(ll n1, ll n2){if(n2!=0) return gcd(n2, n1%n2);else return n1;}
ll powerM(ll a,ll b){if(b==0) return 1;  if(b==1) return a%M; ll x=powerM(a,b/2)%M; if(b&1){return ((((a%M)*(x%M))%M)*(x%M))%M;}return ((x%M)*(x%M))%M;}
ll power(ll a,ll b){if(b==0) return 1;  if(b==1) return a; ll x=power(a,b/2); if(b&1){return ((((a)*(x)))*(x));}return ((x)*(x));}
 

const ll INF=1e18; 
const int SIZE = 100005;
const int SSIZE = 1000005;

int main(){
    ll n;
    cin>>n;
    cout<<n*n*n<<endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#define mod 1000000007
#define ll long long int
#define ar array
#define mp make_pair
using namespace std;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	int n;
	cin>>n;
	int a[n];
	for(int i = 0; i<n; i++)
	{
		cin>>a[i];
	}
	sort(a,a+n,greater<int>());
	int ans = 0,best=101;
	vector<int> v;
	for(int i = 0; i<n; i++)
	{
		ans += a[i];
		if(a[i]%10)
			best = min(best,a[i]);
	}
	if(ans %10 ==0 && best<=100)
		ans -= best;
	if(ans%10==0)
		cout<<0<<endl;
	else cout<<ans<<endl;
	return 0;
}

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

using namespace std;

int main() {
	int n, m, x;
	cin >> n >> m >> x;
	int go_0 = 0;
	int go_n = 0;
	for (int i = 0; i < m; i++)
	{
		int tmp;
		cin >> tmp;
		if (tmp < x)
			go_0++;
		else if (x < tmp)
			go_n++;
	}

	cout << min(go_0, go_n);

	return 0;
}

Measured memory_bytes: 256
import java.io.*;
import java.util.StringTokenizer;

public class Main {

    public static void main(String[] args) throws IOException {
        init();

        int n = nextInt();
        String s = next(), t = next();
        StringBuilder builder = new StringBuilder();
        for (int i = 0; i < n; i++) {
            builder.append(s.charAt(i));
            builder.append(t.charAt(i));
        }

        System.out.println(builder.toString());
    }

    //Input Reader
    private static BufferedReader reader;
    private static StringTokenizer tokenizer;

    private static void init() {
        reader = new BufferedReader(new InputStreamReader(System.in));
        tokenizer = new StringTokenizer("");
    }

    private static String next() throws IOException {
        String read;
        while (!tokenizer.hasMoreTokens()) {
            read = reader.readLine();
            if (read == null || read.equals(""))
                return "-1";
            tokenizer = new StringTokenizer(read);
        }

        return tokenizer.nextToken();
    }

    private static int nextInt() throws IOException {
        return Integer.parseInt(next());
    }
}

Measured memory_bytes: 21332
#include<cstdio>
#include<cmath>
#include <bits/stdc++.h>

int main(){

    unsigned int a, b, angle;
    double S, L, h;

    scanf("%d%d%d", &a, &b, &angle);

    S = a * b * sin( M_PI * angle/180 ) / 2;
    L = a + b + sqrt( pow(a, 2) + pow(b, 2) - 2 * a * b * cos( M_PI * angle/180 ) );
    h = 2 * S / a;

    printf("%lf\n%lf\n%lf\n", S, L, h);

    return 0;

}


Measured memory_bytes: 3428
import bisect
q = int(input())
l = []
r = []
for _ in range(q):
    line = list(map(int, input().split()))
    l.append(line[0])
    r.append(line[1])
like2017 = []
pn = [2]
for L in range(3, 10**5):
    chk = True
    for L2 in pn:
        if L%L2 == 0:
            chk = False
            break
    if chk:
        pn.append(L)
def bisect_in(x, line):
    return line[bisect.bisect_left(line, x)] == x
for prime in pn:
    if bisect_in((prime+1)//2, pn):
        like2017.append(prime)
for i in range(q):
    left = bisect.bisect_left(like2017, l[i])
    right = bisect.bisect_right(like2017,r[i])
    print(right - left)

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

const int N = 200005;
const long long INF = 1e18 + 123;

int R, C, n;
bool vis[N];
long long a[N];
vector < pair<int, int> > g[N];
vector <int> comp;

void dfs(int u) {
	vis[u] = 1;
	comp.push_back(u);
	for (auto e : g[u]) {
		int v = e.second, w = e.first;
		if (!vis[v]) a[v] = w - a[u], dfs(v);
		else if (vis[v] && a[v] != w - a[u]) { cout << "No\n"; exit(0); }
	}
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	cin >> R >> C >> n;
	for (int i = 1; i <= n; ++i) {
		int x, y, w; cin >> x >> y >> w;
		g[x].push_back(make_pair(w, y + R));
		g[y + R].push_back(make_pair(w, x));
	}

	for (int i = 1; i <= R + C; ++i) if (!vis[i]) {
		comp.clear();
		dfs(i);
		long long mr = INF, mc = INF;
		for (int u : comp) {
			if (u <= R) {
				mr = min(mr, a[u]);
			} else {
				mc = min(mc, a[u]);
			}
		}
		if (mr + mc < 0) return cout << "No\n", 0;
	}

	cout << "Yes\n";
}

Measured memory_bytes: 15096
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
//const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;
//const ll MOD = ;
ll mod(ll A, ll M) {return (A % M + M) % M;}
const ll INF = 1LL << 60;
template<class T> bool chmin(T& a, T b) {if (a > b) {a = b; return true;} return false;}
template<class T> bool chmax(T& a, T b) {if (a < b) {a = b; return true;} return false;}
ll divceil(ll A, ll B) {return (A + (B - 1)) / B;}
ll myctoi(char C) {return C - '0';}
char myitoc(ll N) {return '0' + N;}
#define FINALANS(A) {cout << (A) << '\n'; exit(0);}

int main()
{
  ll M;
  cin >> M;
  vector<ll> D(M), C(M);
  for (ll i = 0; i < M; i++)
  {
    cin >> D.at(i) >> C.at(i);
  }

  ll ds = 0;
  for (ll i = 0; i < M; i++)
  {
    ds += D.at(i) * C.at(i);
  }

  ll ans = accumulate(C.begin(), C.end(), (ds - 1) / 9) - 1;
  cout << ans << endl;
}

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

namespace atcoder
{
    class ABC_128_A
    {
        static void Main()
        {

            string[] input = Console.ReadLine().Split(' ');
            int A = int.Parse(input[0]);
            int P = int.Parse(input[1]);

            P = P + A * 3;

            int PIE = P / 2;

            Console.WriteLine(PIE);

        }

    }
}


Measured memory_bytes: 13140
#include <bits/stdc++.h>
#define SZ(X) ((int)(X).size())
#define ALL(X) (X).begin(), (X).end()
#define REP(I, N) for (int I = 0; I < (N); ++I)
#define REPP(I, A, B) for (int I = (A); I < (B); ++I)
#define RI(X) scanf("%d", &(X))
#define RII(X, Y) scanf("%d%d", &(X), &(Y))
#define RIII(X, Y, Z) scanf("%d%d%d", &(X), &(Y), &(Z))
#define DRI(X) int (X); scanf("%d", &X)
#define DRII(X, Y) int X, Y; scanf("%d%d", &X, &Y)
#define DRIII(X, Y, Z) int X, Y, Z; scanf("%d%d%d", &X, &Y, &Z)
#define RS(X) scanf("%s", (X))
#define CASET int ___T, case_n = 1; scanf("%d ", &___T); while (___T-- > 0)
#define MP make_pair
#define PB push_back
#define MS0(X) memset((X), 0, sizeof((X)))
#define MS1(X) memset((X), -1, sizeof((X)))
#define LEN(X) strlen(X)
#define PII pair<int,int>
#define VI vector<int>
#define VPII vector<pair<int,int> >
#define PLL pair<long long,long long>
#define VPLL vector<pair<long long,long long> >
#define F first
#define S second
typedef long long LL;
using namespace std;
const int MOD = 1e9+7;
const int SIZE = 1e6+10;
int main(){
    DRII(x,y);
    int an=2e9;
    if(x<=y)an=min(an,y-x);
    if(-x<=y)an=min(an,y+x+1);
    if(-x>=y)an=min(an,(-x-y)+1);
    if(y<=x)an=min(an,2+x-y);
    printf("%d\n",an);
    return 0;
}


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


#define fast_IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
typedef long long int lli;
typedef long long ll;
typedef long double ld;


signed main(){
    fast_IO;
    int t=1;
    //cin>>t;
    while(t--){
        ld n,b;
        cin>>n>>b;
        ll nb = b*100+0.5;
        cout<<(n*nb)/100;
    }   
    return 0;
}


Measured memory_bytes: 3752
#include <bits/stdc++.h>
using namespace std;
/* typedef */
typedef long long ll;
typedef pair<int, int> pii;
/* constant */
const int INF = 1 << 30;
const ll LINF = 1LL << 50;
const int NIL = -1;
const int MAX = 10000;
const int mod = 1000000007;
const double pi = 3.141592653589;
/* global variables */
/* function */
/* main */
int main(){
    ll K, S;
    cin >> K >> S;
    ll ans = 0;
    for (int x = 0; x <= K; x++) {
        for (int y = 0; y <= K; y++) {
            int z = S - (x + y);
            if (z < 0) continue;
            if (z <= K) ans++;
        }
    }
    cout << ans << '\n';
}


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

int main(){
	int N;
	string S;
	cin >> N >> S;
	if(N%2 == 1){
		cout << "No" << endl;
		return 0;
	} 

	for(int i = 0; i < N/2; i++){
		if(S[i] != S[i + N/2]){
			cout << "No" << endl;
			return 0;
		}
	}
	cout << "Yes" << endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

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

        Scanner scanner = new Scanner(System.in);
        int k = scanner.nextInt();
        int x = scanner.nextInt();

        if (500 * k >= x) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }

    }
}


Measured memory_bytes: 22612
#include <cstdio>
using namespace std;

typedef long long LL;
const int N = 1e6 + 50;
const int Mod = 998244353;
int n, m, ans, fac[N], inv[N];

inline void swap(int &a, int &b) {int t = a; a = b, b = t;}
template <class T> inline void in(T &x) {
	x = 0; int f = 1; char ch = getchar();
	for (; ch<'0' || ch>'9';) {if (ch=='-') f=-1; ch = getchar();}
	for (; ch>='0' && ch<='9';) x = x*10 + ch-'0', ch = getchar();
	x *= f;
}

inline int qpow(int A, int B) {
	int S = 1;
	for (; B; B >>= 1, A = 1LL * A * A % Mod)
		if (B & 1) S = 1LL * S * A % Mod;
	return S;
}

inline int C(int n, int m) {
	if (n < m || m < 0) return 0;
	return 1LL * fac[n] * inv[m] % Mod * inv[n-m] % Mod;
}

int main() {
	in(n), in(m);
	if (n < m) swap(n, m);
	fac[0] = 1;
	for (int i = 1; i <= n*2; ++i) fac[i] = 1LL * fac[i - 1] * i % Mod;
	inv[n << 1] = qpow(fac[n*2], Mod - 2);
	for (int i = n*2 - 1; ~ i; --i) inv[i] = 1LL * inv[i + 1] * (i + 1) % Mod;
	for (int i = 1; i <= m; ++i)
		ans = (ans + 1LL * C(i << 1, i) * C(n + m - 2*i, n - i) % Mod) % Mod;
	ans = 1LL * ans * qpow(C(n + m, n) * 2 % Mod, Mod - 2) % Mod;
	ans = (ans + n) % Mod;
	printf("%d\n", (ans + Mod) % Mod);
	return 0;
}

Measured memory_bytes: 7936
#pragma region

#include <bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(), (x).end()
#define POW2(n) (1LL << (n))
#define FOR(i, begin, end) for (int i = (begin); i < (end); i++)
#define IFOR(i, begin, end) for (int i = (end)-1; i >= (begin); i--)
#define REP(i, n) FOR(i, 0, n)
#define IREP(i, n) IFOR(i, 0, n)
#define MOD 1000000007
#define debug(x) cerr << #x << " = " << (x) << " (line: " << __LINE__ << ") " << endl;
typedef long long ll;
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (auto &v : vec) is >> v;
  return is;
}
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "vec[ ";
  REP(i, vec.size())
  i == 0
      ? os << vec[i]
      : os << ", " << vec[i];
  os << " ]";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const deque<T> &deq) {
  os << "deq[ ";
  REP(i, deq.size())
  i == 0
      ? os << deq[i]
      : os << ", " << deq[i];
  os << " ]";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const set<T> &set) {
  os << "{ ";
  for (auto &&s : set) &s == &(*set.begin()) ? os << s : os << ", " << s;
  os << " }";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const unordered_set<T> &set) {
  os << "{ ";
  for (auto &&s : set) &s == &(*set.begin()) ? os << s : os << ", " << s;
  os << " }";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const multiset<T> &set) {
  os << "{ ";
  for (auto &&s : set) &s == &(*set.begin()) ? os << s : os << ", " << s;
  os << " }";
  return os;
}
template <typename T>
ostream &operator<<(ostream &os, const unordered_multiset<T> &set) {
  os << "{ ";
  for (auto &&s : set) &s == &(*set.begin()) ? os << s : os << ", " << s;
  os << " }";
  return os;
}
template <typename T1, typename T2>
ostream &operator<<(ostream &os, const pair<T1, T2> &p) {
  os << "(" << p.first << ", " << p.second << ")";
  return os;
}
template <typename TK, typename TV>
ostream &operator<<(ostream &os, const map<TK, TV> &m) {
  os << "{ ";
  for (auto &&k : m) &k == &(*m.begin()) ? os << k.first << " => " << k.second : os << ", " << k.first << " => " << k.second;
  os << " }";
  return os;
}
template <typename TK, typename TV>
ostream &operator<<(ostream &os, const unordered_map<TK, TV> &m) {
  os << "{ ";
  for (auto &&k : m) &k == &(*m.begin()) ? os << k.first << " => " << k.second : os << ", " << k.first << " => " << k.second;
  os << " }";
  return os;
}

#pragma endregion

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(10);

  int N, M;
  string S;
  cin >> N >> M >> S;

  int pos = N;
  vector<int> result;
  while (pos > 0) {
    IFOR(i, 1, M + 1) {
      int to = pos - i;
      if (to <= 0) {
        result.push_back(pos);
        pos = 0;
        break;
      }
      if (S[to] == '0') {
        result.push_back(i);
        pos = to;
        break;
      }
      if (i == 1) {
        cout << "-1\n";
        return 0;
      }
    }
  }
  IREP(i, result.size())
  cout << result[i] << " ";
  cout << "\n";
}


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

int main(){
	int N, M;
	cin >> N;
	string s[N];
	rep(i,N) cin >> s[i];
	cin >> M;
	string t[M];
	rep(i,M) cin >> t[i];
	sort(s,s+N);
	int ans = 0;
	int u = 1;
	string c = s[0];
	for (int i=1; i<N; i++){
		if (s[i] == c) u++;
		else {
			int d = 0;
			rep(j,M) if (t[j] == c) d++;
			ans = max(ans, u-d);
			u = 1;
			c = s[i];
		}
		if (i == N-1) {
			int d = 0;
			rep(j,M) if (t[j] == c) d++;
			ans = max(ans, u-d);
		}
	}
	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 3620
#include "bits/stdc++.h"
using namespace std;
pair<int,int> Intervals[100005];

bool MyComp( pair<int,int> x , pair<int,int> y ){
    if( x.second < y.second ) return true;
    else return false;
}

int main(){
    int N , x , l , i;
    scanf( "%d" , &N );

    for( i = 1 ; i <= N ; ++i ){
        scanf( "%d%d" , &x , &l );
        Intervals[i].first = x - l;
        Intervals[i].second = x + l;
    }

    sort( Intervals + 1 , Intervals + N + 1 , MyComp );
    int Ans = 1 , end = Intervals[1].second;

    for( i = 2 ; i <= N ; ++i ){
        if( Intervals[i].first >= end ){
            end = Intervals[i].second;
            ++Ans;
        }
    }
    
    printf( "%d\n" , Ans );
    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
       
using namespace std;
typedef long long ll;
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; }

int N;

void rec(int i, int k, string s) {
  if (i == N) {
    cout << s << endl;
    return;
  }

  for (int j = 0; j < (int)(k); ++j) rec(i + 1, max(k, j + 2), s + char(j + 'a'));
}

int main() {
  cin >> N;

  rec(1, 2, "a");
  return 0;
}


Measured memory_bytes: 1536
import java.io.PrintWriter
import java.util.StringTokenizer
import kotlin.math.max

fun main() {

    fun PrintWriter.solve() {
        val s = next()
        var ans = 0
        var prev = 'R'
        var cnt = 0
        for(i in 0..2){
            if (s[i] == 'R' && prev == 'R'){
                cnt++
            }
            else if (s[i] == 'R'){
                prev = 'R'
                cnt = 1
            }
            else{
                cnt = 0
                prev = s[i]
            }

            ans = max(cnt,ans)

        }

        println(ans)

    }

    writer.solve()
    writer.flush()


}


private val reader = System.`in`.bufferedReader()
private val writer = PrintWriter(System.out, false)

private var tokenizer: StringTokenizer = StringTokenizer("")

private fun next(): String {
    while (tokenizer.hasMoreTokens().not()) tokenizer = StringTokenizer(reader.readLine())
    return tokenizer.nextToken()
}

private fun nextInt() = next().toInt()
private fun nextLong() = next().toLong()
private fun nextDouble() = next().toDouble()
private fun nextLine() = reader.readLine()



Measured memory_bytes: 34256
import sys
from io import StringIO
import unittest

def resolve():
    n = int(input())
    ans = 0

    for i in range(1, n + 1, 1):
        if i % 3 != 0 and i % 5 != 0:
            ans += i

    print(ans)

class TestClass(unittest.TestCase):
    def assertIO(self, input, output):
        stdout, stdin = sys.stdout, sys.stdin
        sys.stdout, sys.stdin = StringIO(), StringIO(input)
        resolve()
        sys.stdout.seek(0)
        out = sys.stdout.read()[:-1]
        sys.stdout, sys.stdin = stdout, stdin
        self.assertEqual(out, output)
    def test_入力例_1(self):
        input = """15"""
        output = """60"""
        self.assertIO(input, output)
    def test_入力例_2(self):
        input = """1000000"""
        output = """266666333332"""
        self.assertIO(input, output)

if __name__ == "__main__":
    # unittest.main()
    resolve()

Measured memory_bytes: 72144
#include <iostream>
#include <vector>
#include <algorithm>
#include <functional>

using namespace std;

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

    vector<int> ret(100000, 0);
    for(int i = 0 ; i < N; i++) {
        int tmp;
        cin >> tmp;

        ret[tmp]++;
        if(tmp > 0) ret[tmp-1]++;
        if(tmp < 100000 - 2) ret[tmp+1]++;
    }

    sort(ret.begin(), ret.end(), greater<int>());

    cout << ret[0] << endl;
}

Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <algorithm>
#include <iostream>
#include <string>
#include <algorithm>
#include <vector>
#include <iomanip>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <deque>
#include <cstdio>
#include <set>
#include <map>
#include <bitset>
#include <stack>
#include <cctype>
using namespace std;
int main() {
#define int long long
	vector<int> vec, vec1;
	int n;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int x, y;
		cin >> x >> y;
		vec.emplace_back(x);
		vec1.emplace_back(y);
	}
	sort(vec.begin(), vec.end());
	sort(vec1.begin(), vec1.end());
	if (n % 2 == 0) {
		cout << vec1[n / 2 - 1]+ vec1[n / 2] - vec[n / 2 - 1] - vec[n / 2] + 1 << endl;
	}
	else {
		cout << vec1[n / 2] - vec[n / 2] + 1 << endl;
	}
	return 0;
}


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

string S;
int N;

void input() {
    cin >> N;
    cin >> S;
}

void solve() {
    input();
    string tmp = "No";
    int K = N / 2;
    if(N % 2 == 0 && S.substr(0, K) == S.substr(K, K)) tmp = "Yes";
    cout << tmp << endl;
    return;
}

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


Measured memory_bytes: 256
#include <vector>
#include <iostream>
#include <cmath>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <fstream>
#include <unistd.h>
#include <string>
#include <numeric>
#include <queue>
#include <deque>
#include <sstream>
#include <iomanip>
#include <set>
#include <stack>
#include <cassert>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<vvl> vvvl;
typedef vector<vi> vvi;
typedef vector<vvi> vvvi;
typedef vector<bool> vb;
typedef vector<vector<bool>> vvb;
typedef vector<vvb> vvvb;
typedef vector<vvvb> vvvvb;
typedef vector<string> vs;
typedef vector<vs> vvs;
typedef vector<vvs> vvvs;
typedef vector<char> vc;
typedef vector<vector<char>> vvc;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<vvd> vvvd;
typedef pair<int, int> P;
typedef pair<ll, ll> PL;
typedef vector<P> vp;
typedef vector<PL> vpl;
typedef vector<vector<P>> vvp;
typedef vector<vector<PL>> vvpl;
const int INF = 1001001001;
const ll LINF = 1e17;
const double pi = 3.1415926535897932;
const string endstr = "\n";
#define FOR(i, a, b) for(ll i = (a); i < b; i++)
#define RFOR(i, a, b) for(ll i = (a); i > b; i--)
#define REP(i, n) for(ll i = 0; i < n; i++)
#define RREP(i, n) for(ll i = n-1; i > -1; i--)
#define FORMAP(it, m) for(auto it = m.begin(); it != m.end(); it++)
#define ff first
#define ss second
#define pb push_back
#define epb emplace_back

template <typename T>
T gcd(T a, T b) {
    return (a == 0) ? b : gcd(b%a, a);
}
template <typename T>
T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}

bool p_comp_fs(const PL p1, const PL p2){ return p1.first < p2.first;};
bool p_comp_fg(const PL p1, const PL p2){ return p1.first > p2.first;};
bool p_comp_ss(const PL p1, const PL p2){ return p1.second < p2.second;};
bool p_comp_sg(const PL p1, const PL p2){ return p1.second > p2.second;};
template <typename T>
vector<T> uniquen(vector<T> vec){
    vec.erase(unique(vec.begin(), vec.end()), vec.end());
    return vec;
}


int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    ll W, H, x, y; cin >> W >> H >> x >> y;
    
    double ans = (double)(W*H)/2.0;
    
    bool cent = (W%2 == 0 && x == W/2) && (H%2 == 0 && y == H/2);
    
    cout << fixed << setprecision(20) <<  ans << " " << (cent ? "1" : "0") << endl;
    
    return 0;
    return 0;
}


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

using namespace std;

const int MAXN = 50;
long long a[MAXN + 1];

int main()
{
    int n;
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    int biggest = abs(a[1]);
    int pos = 1;
    for (int i = 2; i <= n; i++)
    {
        if (abs(a[i]) > biggest)
        {
            biggest = abs(a[i]);
            pos = i;
        }
    }
    cout << 2 * n << endl;
    if (a[pos] > 0)
    {
        cout << pos << " " << 1 << endl;
        cout << pos << " " << 1 << endl;
        for (int i = 1; i < n; i++)
        {
            cout << i << " " << i + 1 << endl;
            cout << i << " " << i + 1 << endl;
        }
    }
    else
    {
        cout << pos << " " << n << endl;
        cout << pos << " " << n << endl;
        for (int i = n; i > 1; i--)
        {
            cout << i << " " << i - 1 << endl;
            cout << i << " " << i - 1 << endl;
        }
    }
    return 0;
}


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

int main() {
  ll h;
  cin>>h;
  ll c=0;
  while(h>0){
  	h /= 2;
    c++;
  }
  ll ans;
  ans = pow(2, c);
  cout << ans-1 << endl;
}

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

using namespace std;
#define inf             0x3f3f3f3f
#define INF             2e18
#define eps             1e-9

#define FastRead        ios_base::sync_with_stdio(0);cin.tie(0)
#define fRead           freopen("input.txt","r",stdin)
#define fWrite          freopen("output.txt","w",stdout)

#define LL              long long
#define ull            unsigned long long
#define PI              acos(-1.0)
#define pb              push_back
#define mk              make_pair
#define pii             pair<int,int>
#define pLL             pair<LL,LL>
#define ff              first
#define ss              second
#define all(a)          a.begin(),a.end()
#define SQR(a)          ((a)*(a))
#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(min(a,b),min(c,d))
#define max4(a,b,c,d)   max(max(a,b),max(c,d))
#define max5(a,b,c,d,e) max(max3(a,b,c),max(d,e))
#define min5(a,b,c,d,e) min(min3(a,b,c),min(d,e))
#define vi              vector <int>
#define vL              vector <LL>
#define LB(a,x)         (lower_bound(all(a),x)-a.begin()) //  first element in the range [first,last) which does not compare less than val.
#define UB(a,x)         (upper_bound(all(a),x)-a.begin()) //  first element in the range [first,last) which compares greater than val.
#define prec(n)         fixed << setprecision(n)

#define MEM(a,x)        memset(a,x,sizeof(a))
#define SORT(v)         sort(v.begin(),v.end())
#define REV(v)          reverse(v.begin(),v.end())
#define Unique(a)       sort(all(a)),a.erase(unique(all(a)),a.end())

#define FOR(i,a,b)      for(int i=a;i<=b;i++)
#define ROF(i,a,b)      for(int i=a;i>=b;i--)
#define REP(i,b)        for(int i=0;i<b;i++)
#define IT(it,x)	    for(it=x.begin();it!=x.end();it++)
LL mp[100009];
int main()
{
    FastRead;
    LL n;
    cin>>n;
    LL s=0;
    for(LL i=0;i<n;i++)
    {
        LL a;
        cin>>a;
        s+=a;
        mp[a]++;
    }
    LL q;
    cin>>q;
    while(q--)
    {
        LL x,y;
        cin>>x>>y;
        LL c=mp[x];
        s-=c*x;
        s+=c*y;
        mp[x]=0;
        mp[y]+=c;
        cout<<s<<"\n";
    }

}


Measured memory_bytes: 4396
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <utility>
#include <string>

using namespace std;

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

	vector<int> h(n, 0);
	for (int i = 0; i < n; i++) {
		cin >> h[i];
	}

	int h_max = -1;
	int ans = 0;
	for (auto x: h) {
		if (x >= h_max) {
			ans++;
			h_max = x;
		}
	}

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


Measured memory_bytes: 256
n = int(input())
c = input()


cnt = 0
for i in range(n):
  w_idx = c.find("W")
  r_idx = c.rfind("R")
  if w_idx < r_idx and w_idx != -1:
    c = c[w_idx+1:r_idx]
    cnt += 1

print(cnt)

Measured memory_bytes: 9396
#include<iostream>
#include<climits>
using namespace std;
int main(void){
    //学生,チェックポイント数
    int n ,m = 0;
    cin >> n >> m;
    //学生、チェックポイントの各座標
    int student[n][2];
    int cheakpoint[m][2];

    for (size_t i = 0; i < n; i++)
    {
        cin >> student[i][0] >> student[i][1];
    }
    
    for (size_t i = 0; i < m; i++)
    {
        cin >> cheakpoint[i][0] >> cheakpoint[i][1];
    }
    
    //生徒における各チェックポイントのマンハッタン距離を算出
    for (size_t i = 0; i < n; i++)
    {
        int mh = 0;
        int minmh = INT_MAX;
        int ans = 0;
        for (size_t q = 0; q < m; q++)
        {
            mh = abs(student[i][0]-cheakpoint[q][0]) + abs(student[i][1]-cheakpoint[q][1]);
            if(minmh > mh){
                minmh = mh;
                ans = q+1;
                //cout << "mh" << minmh << endl;
            }
        }
        cout << ans << endl;
    }
    
}

Measured memory_bytes: 256