akhauriyash/Code-Regression huggingface dataset:
import math

n, d = input().split()
count = 0
for idx in range(int(n)):
    x, y = input().split()
    x, y = int(x), int(y)
    if math.sqrt(math.pow(int(x), 2) + math.pow(int(y), 2)) <= int(d):
        count += 1

print(count)

Measured memory_bytes: 9256
#include <iostream>
using namespace std;
int main (){
	int k=0;
	int p=0;
	int n=0;
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>k>>p;
		while(1){
			if(k>p){
				k=k-p;
			}
			else{
				break;
			}
		}
		cout<<k<<endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#import <stdio.h>
#import <stdlib.h>

int compare_int(const void *a, const void *b) {
    return *(int*)a - *(int*)b;
}

// 昇順に並んだ values の中で searchValue を 左から探したときに初めて上回る(order>0) / 右から探したときに初めて下回る(order<0) ような index を探す（ない場合は -1 を返す）
int binary_search(int searchValue, int *values, int minIndex, int maxIndex, int order) {
    int midIndex = (minIndex + maxIndex)/2;
    int midValue = values[midIndex];
    int maxValue = values[maxIndex];
    if (minIndex == midIndex) { // 区間の長さが2になったとき
        if (order > 0) {
            if (searchValue < midValue) { // 左がサーチ値を上回るなら左
                return midIndex;
            }
            if (searchValue < maxValue) { // 左がサーチ値以下かつ右がサーチ値を上回るなら右
                return maxIndex;
            }
        } else {
            if (searchValue > maxValue) { // 右がサーチ値を下回るなら右
                return maxIndex;
            }
            if (searchValue > midValue) { // 右がサーチ値以上かつ左がサーチ値を下回るなら左
                return midIndex;
            }
        }
        return -1; // 区間の長さが2のとき両端とも条件を満たさないなら存在しない
    }
    if (order > 0) {
        if (midValue <= searchValue) { // 中央での値がまだ上回っていないなら右半分
            return binary_search(searchValue, values, midIndex, maxIndex, order);
        } else {
            return binary_search(searchValue, values, minIndex, midIndex, order);
        }
    } else {
        if (midValue >= searchValue) { // 中央での値がまだ下回っていないなら左半分
            return binary_search(searchValue, values, minIndex, midIndex, order);
        } else {
            return binary_search(searchValue, values, midIndex, maxIndex, order);
        }
    }
}

int main(){
    int N;
    scanf("%d", &N);
    int A[200000] = {0};
    int B[200000] = {0};
    int C[200000] = {0};
    for(int i=0;i<N;i++){
        int a;
        scanf("%d", &a);
        A[i] = a;
    }
    for(int i=0;i<N;i++){
        int b;
        scanf("%d", &b);
        B[i] = b;
    }
    for(int i=0;i<N;i++){
        int c;
        scanf("%d", &c);
        C[i] = c;
    }
    qsort(A, N, sizeof(int), compare_int);
    qsort(C, N, sizeof(int), compare_int);
    if (N==1) {
        puts((A[0]<B[0] && B[0]<C[0]) ? "1" : "0");
        return 0;
    }
    long count = 0;
    for(int j=0;j<N;j++){
        int b = B[j];
        int i = binary_search(b,A,0,N-1,-1);
        int k = binary_search(b,C,0,N-1,1);
        if (i>=0 && k>=0) {
            count += (long)(i+1)*(N-k);
        }
    }
    printf("%lld",count);
}


Measured memory_bytes: 4968
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000

struct compare {
    int A, numA;
    int B, numB;
    int C, numC;
};
bool Date_equal(struct compare* a, struct compare *b) {
   return a->A  == b->A  &&
          a->B == b->B &&
          a->C   == b->C &&
          a->numA == b->numA &&
          a->numB == b->numB &&
          a->numC == b->numC;
}


int k[110];
int N;
int ans;
compare v[550];

void check(int a, int b, int c) {
    a--; b--; c--;
    REP(i, 2, N) {
        REP(j, 2, N) {
            REP(r, 2, N) {
                if (i == j || j == r || r == i) continue;
                if (a == b && i > j) continue;
                if (k[i] >= a && k[j] >= b && k[r] >= c) {
                    compare G;
                    G.A = i; G.numA = a;
                    G.B = j; G.numB = b;
                    G.C = r; G.numC = c;
                    bool find = false;
                    rep(s, ans) {
                        if (Date_equal(&G, &v[s])) {
                            find = true;
                            break;
                        }
                    }
                    if (!find) v[ans++] = G;
                }
                if (c == 0) break;
            }
            if (b == 0) break;
        }
    }
}

int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> N;
    REP(i, 1, N) {
        int tmp = i;
        int j = 2;
        while(tmp > 1) {
            while(tmp % j == 0) {
                k[j]++;
                tmp /= j;
            }
            j++;
        }
    }
    //check(75, 1, 1);
    check(15, 5, 1);
    check(25, 3 ,1);
    check(5, 5, 3);
    ///*
    REP(i, 1, N) {
        //cout << i << ":" << k[i] << endl;
    }
    //*/
    rep(i, ans) {
        //cout << v[i].A << "," << v[i].numA << "  " << v[i].B << "," <<v[i].numB << "  " << v[i].C << "," << v[i].numC << endl;
    }
    if (k[2] >= 74) ans++;
    cout <<ans<< endl;


    return 0;
}


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

string Rotate(int l, int r, int N, string S);
int count_happy(int N, string S);

int main() {
    int N, K;
    int happy;
    int a;
    string S;
    std::cin >> N >> K >> S;
    char tmp = S[0];

    if(K==0){
        happy = count_happy(N, S);
        std::cout << happy << std::endl;
        return 0;
    }

    for (int i = 1; i < N; i++) {
        if (S[i] != tmp) {
            a = i;
            while (S[i] != tmp && i != N) {
                i++;
            }
            S = Rotate(a, i - 1, N, S);
            K--;
            if (K == 0) {
                happy = count_happy(N, S);
                std::cout << happy << std::endl;
                return 0;
            }
        }
    }




/*
            if(S[i + a] == tmp) {
                S = Rotate(i, i + a - 1, N, S);
                K--;
                if (K == 0) {
                    happy = count_happy(N, S);
                    std::cout << happy << std::endl;
                    return 0;
                }
                i = i + a;
            }
            else {
                i = i + a;
                tmp = S[i+a];
            }
        }
    }
    */
    happy = count_happy(N,S);
    std::cout << happy << std::endl;
    return 0;
}

string Rotate(int l, int r, int N, string S){
    char tmp[N];
    for(int i=l; i<r+1; i++) {
        if (S[i] == 'L') {
            S[i] = 'R';
        } else {
            S[i] = 'L';
        }
    }
    for(int i=0;i<r-l+1; i++){
        tmp[r-i] = S[l+i];
    }
    for(int i=l; i<r+1; i++){
        S[i]=tmp[i];
    }
    return S;
}

int count_happy(int N, string S){
    int happy=0;
    for(int i=0; i<N; i++){
        if(S[i]=='L'){
            if(S[i]==S[i-1]){
                happy ++;
            }
        }
        else{
            if(S[i]==S[i+1]){
                happy ++;
            }
        }
    }
    return happy;
}

Measured memory_bytes: 512
#include<stdio.h>
#include<math.h>
double x[101],y[101],sum,max;
int n,p,i;
void D(int p){
	for(i=0,sum=0;i<n;i++) sum+=pow(fabs(x[i]-y[i]),p);
	printf("%.8lf\n",pow(sum,(double)1/p));
}
int main(void){
	scanf("%d",&n);
	for(i=0;i<n;i++) scanf("%lf",&x[i]);
	for(i=0;i<n;i++) scanf("%lf",&y[i]);
	D(1);D(2);D(3);
	for(i=0,max=0;i<n;i++){
		if(max<fabs(x[i]-y[i])) max=fabs(x[i]-y[i]);
	}
	printf("%.8lf\n",max);
	return 0;
}

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

int main()
{
	int n;
	cin>>n;
	vector<int> num(n);
	for(int i = 0 ; i < n; i++){
		int a;
		cin>>a;
		a--;
		num[i] = a;
	}
	int ans = 0;
	for(int i = 0 ; i < n-1; i++){
		if( i == num[i]){
			ans++;
			int temp = num[i];
			num[i] = num[i+1];
			num[i+1] = temp;
		}
	}
	if(num[n-1] == (n-1)) ans++;
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 3192
ans = 0
a = 0 #a~eを格納
r_min = 10 #10で割ったあまりの最小値

for i in 0..4 do
  a = gets.to_i

  if a%10 == 0
    ans += a
  else
    if a%10 < r_min
      r_min = a%10
    end
    ans += a + 10 - a%10
  end
end

ans -= 10-r_min

puts ans


Measured memory_bytes: 1788
#include<bits/stdc++.h>
typedef long long int ll;
typedef unsigned long long int ull;
#define BIG_NUM 2000000000
#define HUGE_NUM 1000000000000000000
#define MOD 1000000007
#define EPS 0.000000001
using namespace std;


int main(){

	int H,A;
	scanf("%d %d",&H,&A);

	if(H%A == 0){

		printf("%d\n",H/A);
	}else{

		printf("%d\n",H/A+1);
	}

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
template <class T> void cumulative_sum( T array, size_t N );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;

int main( void ){
	vector<int> vec;
	rep(i,0,4){
		int a;
		cin >> a;
		vec.push_back(a);
	}
	sort_asc(vec);
	vector<int> ans ={1,4,7,9};
	rep(i,0,4){
		if(vec[i] != ans[i]){
			cout << "NO\n";
			return 0;
		}
	}
	cout << "YES\n";
}

int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
template <class T> void cumulative_sum( T array, size_t N ) {
	rep( i, 1, N + 1 ){
		array[ i ] += array[ i - 1 ];
	}
}
template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
#define all(x) (x).begin(),(x).end()
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
typedef long long ll;
const long long INF = 1LL << 60;
typedef pair<int, int> P;
int main()
{
    int A, B;
    cin >> A >> B;
    cout << A * B << endl;
    return 0;
}

Measured memory_bytes: 3620
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;
typedef long long LL;

const int inf = 1 << 30;
const LL INF = 1LL << 60;
const int MaxN = 1e5;

char s[2 * MaxN + 5];
int cnt[30];
int sum;
LL ans;

int main()
{
		cin>>s;
		sum = 0;
		ans = 0;
		int len = strlen(s);
		for(int i = 0; i < len; i++) {
			cnt[s[i] - 'a' + 1]++;
		}
		for(int i = 1; i <= 26; i++)
			sum += cnt[i];
		for(int i = 1; i <= 26; i++) {
			if(cnt[i] > 0)
				ans += (LL)cnt[i] * (sum - cnt[i]);
		}
		cout<<ans/2+1<<endl;
	return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#define ll long long 
using namespace std;
int a,b;
int main()
{
	int i,j;
	scanf("%d%d",&a,&b);
	if(a<=9&&b<=9) printf("%d\n",a*b);
	else printf("-1\n");
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define mod 998244353
#define MOD 1000000007
#define inf 0x3f3f3f3f
#define linf 0x3f3f3f3f3f3f3f3fll
typedef long long ll;
typedef pair<int,int> pii;
typedef unsigned long long ull;
int main()
{
	ll n,a,b;
	cin>>n>>a>>b;
	ll dif=(b-a);
	ll ans=linf;
//	ll ans=min(b-1ll,n-a);
	if(dif%2==0)
	{
		ans=min(ans,dif/2ll);
	}
	
	ans=min(ans,a-1+(dif+1)/2);
	ans=min(ans,n-b+(dif+1)/2);
	
	
	cout<<ans;
	return 0;
}

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

int N, M, Q;
int buildSum(vector<int>, vector<int>);
int getSum(int, int);
vector<vector<int>> LRmap;
int main()
{
	//cin >> N >> M >> Q;
	scanf("%d %d %d", &N, &M, &Q);
	vector<int> L(M);
	vector<int> R(M);
	for (int i = 0; i < M; i++)
	{
		//cin >> L[i] >> R[i];
		scanf("%d %d", &L[i], &R[i]);
	}

	vector<int> p(Q);
	vector<int> q(Q);
	for (int i = 0; i < Q; i++)
	{
		//cin >> p[i] >> q[i];
		scanf("%d %d", &p[i], &q[i]);
	}


	buildSum(L, R);

	for (int i = 0; i < Q; i++)
	{
		int ans = getSum(p[i], q[i]);
		//cout << ans << endl;
		printf("%d\n", ans);
	}

	return 0;
}

int buildSum(vector<int> L, vector<int> R) {
	LRmap = vector<vector<int>>(N + 1, vector<int>(N + 1, 0));
	for (int i = 0; i < M; i++)
	{
		LRmap[L[i]][R[i]]++;
	}

	for (int i = 1; i <= N; i++)
	{
		for (int j = 1; j <= N; j++)
		{
			LRmap[i][j] += LRmap[i][j - 1];
			LRmap[i][j] += LRmap[i - 1][j];
			LRmap[i][j] -= LRmap[i - 1][j - 1];
		}
	}
}
int getSum(int p, int q) {
	int a = LRmap[q][q] - LRmap[p - 1][q] - LRmap[q][p - 1] + LRmap[p - 1][p - 1];
	return a;
}

Measured memory_bytes: 5120
#include <vector>
#include <queue>
#include <iostream>
using namespace std;


class TopologicalSort {
public:
  TopologicalSort(int V): V(V), G(V, vector<int>(0)), indeg(V, 0) {}

  void addEdge(int s, int t) {
    G[s].push_back(t);
    indeg.at(t)++;
  }

  vector<int> getSorted() {
    return vs;
  }

  bool sort() {
    queue<int> Q;
    vector<bool> done(V, false);

    for (int i=0; i<V; i++) {
      if (indeg.at(i) == 0) {
        Q.push(i);
        while (Q.size()) {
          int v = Q.front();Q.pop();
          if (done.at(v)) continue;
          done.at(v) = true;
          vs.push_back(v);
          for (auto u: G[v]) {
            if (--indeg.at(u) == 0) Q.push(u);
          }
        }
      }
    }

    return vs.size() == V;
  }

private:
  int V;
  vector<vector<int> > G;
  vector<int> indeg;
  vector<int> vs;
};


#define MAX_E 100001
int V, E;
int S[MAX_E], T[MAX_E];


void input() {
  int s, t;
  cin >> V >> E;
  for (int i=0; i<E; i++) {
    cin >> S[i] >> T[i];
  }
}

void solve() {
  TopologicalSort ts(V);
  for (int i=0; i<E; i++) ts.addEdge(S[i], T[i]);
  ts.sort();
  for (auto v: ts.getSorted()) cout << v << endl;
}

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



Measured memory_bytes: 4088
//107 B - Grid Compression 2018/08/25
#include <bits/stdc++.h>
#define rep(i ,n) for(int i=0;i<(int)(n);++i)
using namespace std;
typedef long long int int64;
typedef unsigned long long uint64;

int main(){
    int h , w; cin >> h >> w;
    string a[h];
    int counter=0;
    rep(i, h) cin >> a[i];
    rep(i ,h){
        rep(j ,w){
            if(a[i][j]=='#') continue;
            ++counter;
        }
        if(counter==a[i].size()){
            rep(k ,w) a[i][k]='0';
        }
        counter = 0;
    }
    counter = 0;
    rep(i ,w){
        rep(j ,h){
            if(a[j][i]=='#') continue;
            ++counter;
        }
        if(counter==h){
            rep(j ,h) a[j][i]='0';
        }
        counter = 0;
    }
    counter = 0;
    rep(i ,h){
        rep(j , w){
            if(a[i][j]=='0') continue;
            else cout << a[i][j];
        }
        rep(k ,w){
            if(a[i][k]=='0') ++counter;
        }
        if (counter==w) {}
        else cout << endl;
        counter = 0;
        }
}

Measured memory_bytes: 256
import itertools
N = int(input())
D = len(str(N))

ans = 0
for d in range(3,D+1):
    for ptn in itertools.product([3,5,7], repeat=d):
        if len(set(ptn)) < 3: continue
        n = int(''.join(map(str,ptn)))
        if n <= N:
            ans += 1
print(ans)

Measured memory_bytes: 3060
#include <string>
#include <iostream>
#include <vector>
#include <stack>
#include <stdio.h>
#include <math.h>
#include <utility>
#include <algorithm>

using namespace std;

bool myfunction(long long i, long long j) { return (i > j); }

int main() {
	int x[3];
	long long k;
	cin >> x[0] >> x[1] >> x[2] >> k;
	vector<long long> a(x[0]), b(x[1]), c(x[2]);
	for (int i = 0; i < x[0]; i++) {
		cin >> a[i];
	}
	for (int i = 0; i < x[1]; i++) {
		cin >> b[i];
	}
	for (int i = 0; i < x[2]; i++) {
		cin >> c[i];
	}

	vector<long long> ab(x[0] * x[1]);
	for (int i = 0; i < x[0]; i++) {
		for (int j = 0; j < x[1]; j++) {
			ab[i*x[1] + j] = a[i] + b[j];
		}
	}
	sort(ab.begin(), ab.end(), myfunction);

	int k_ = k;
	if (x[0] * x[1] < k) k_ = x[0] * x[1];
	vector<long long> abc(k_ * x[2]);
	for (int i = 0; i < k_; i++) {
		for (int j = 0; j < x[2]; j++) {
			abc[i*x[2] + j] = ab[i] + c[j];
		}
	}
	
	sort(abc.begin(), abc.end(), myfunction);
	for (int i = 0; i < k; i++) {
		cout << abc[i]<<"\n";
	}
	return 0;
}


Measured memory_bytes: 31616
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace __gnu_pbds;
using namespace std;
#define IO ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define PI 3.1415926535897932384626433832795
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
long long MOD = 1e9+7;
pair<int,int> dx[4] = {{1,0},{-1,0},{0,1},{0,-1}};
const int RANDOM = chrono::high_resolution_clock::now().time_since_epoch().count();
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
struct chash {
    int operator()(int x) const { return x ^ RANDOM; }
};
string toString(long long x)
{
stringstream ss;
ss << x;
string str = ss.str();
return str;
}
long long fastpow(long long x,long long k)
{
    if(!k)
        return 1;
    if(k & 1)
        return ((x * fastpow(x,k-1) % MOD) % MOD) % MOD;
    long long ans = fastpow(x,k/2);
    ans %= MOD;
    ans *= ans;
    ans %= MOD;
    return ans;
}
long long sumF(long long x)
{
    int s = 0;
    while(x)
        s += x%10,x /= 10;
    return s;
}
int Freq[5];
int main()
{
    IO;
    long long K,A,B;
    cin >> K >> A >> B;
    long long Best = K+1;
    long long cur = 0;
    if(K >= A - 1 && B > A)
    {
        cur = A;
        K -= (A - 1);
        cur += (B - A) * (K / 2);
        if(K % 2)
            cur++;
    }
    cout << max(Best,cur);

    return 0;
}


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

int main() {
    int n;
    cin >> n;
    vector<int> a(n+1);
    rep(i,n) cin >> a[i+1];
    vector<int> b(n+1);
    for (int i = n; i >= 1; i--) {
        int sum = 0;
        for (int j =i+i; j <= n; j += i) {
            sum ^= b[j];
        }
        b[i] = sum ^ a[i];
    }
    vector<int> ans;
    for (int i = 1; i <= n; i++) {
        if (b[i]) ans.push_back(i);
    }
    cout << ans.size() << endl;
    rep(i, ans.size()) {
        printf("%d%c", ans[i], i+1==ans.size()?'\n':' ');
    }
    return 0;
}


Measured memory_bytes: 5272
import math

a, b, C = map(float, input().split())
radC = math.radians(C)

print(a * b * math.sin(radC) / 2)
print(a + b + math.sqrt(a ** 2 + b ** 2 - 2 * a * b * math.cos(radC)))
print(b * math.sin(radC))



Measured memory_bytes: 5688
#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 cnt=0;
  rep(i,n){
    int a,b;
    cin>>a>>b;
    if(a==b) cnt++;
    else cnt=0;
    if(cnt>=3){cout<<"Yes"<<endl;return 0;}
  }
  cout<<"No"<<endl;

  return 0;
}


Measured memory_bytes: 3648
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
//#define P pair<ll,ll>
#define FOR(I,A,B) for(ll I = ll(A); I < ll(B); ++I)
#define FORR(I,A,B) for(ll I = ll((B)-1); I >= ll(A); --I)
#define TO(x,t,f) ((x)?(t):(f))
#define SORT(x) (sort(x.begin(),x.end())) // 0 2 2 3 4 5 8 9
#define POSL(x,v) (lower_bound(x.begin(),x.end(),v)-x.begin()) //xi>=v  x is sorted
#define POSU(x,v) (upper_bound(x.begin(),x.end(),v)-x.begin()) //xi>v  x is sorted
#define NUM(x,v) (POSU(x,v)-POSL(x,v))  //x is sorted
#define REV(x) (reverse(x.begin(),x.end())) //reverse
ll gcd_(ll a,ll b){if(a%b==0)return b;return gcd_(b,a%b);}
ll lcm_(ll a,ll b){ll c=gcd_(a,b);return ((a/c)*(b/c)*c);}
#define NEXTP(x) next_permutation(x.begin(),x.end())
const ll INF=ll(1e16)+ll(7);
const ll MOD=1000000007LL;
#define out(a) cout<<fixed<<setprecision((a))
//tie(a,b,c) = make_tuple(10,9,87);
#define pop_(a) __builtin_popcount((a))
ll keta(ll a){ll r=0;while(a){a/=10;r++;}return r;}






int main(){
  ll D;
  cin >> D;
  vector<ll> c(26);
  FOR(i,0,26) cin >> c[i];
  vector<ll> last(26,0),s(26);
  vector<vector<ll>> S;
  vector<ll> t_(D);

  FOR(i,0,D){
    FOR(j,0,26){
      cin >> s[j];
    }
    S.push_back(s);
  }

  ll ans = 0;

  FOR(i,0,D) cin >> t_[i];
  
  FOR(i,0,D){
    ll t;
    t = t_[i];
    t--;
    ans += S[i][t];
    last[t] = i+1;
    FOR(j,0,26){
      ans -= c[j] * (i+1 - last[j]);
    }
    //cout << ans << endl;
  }


  ll M;
  cin >> M;
  FOR(k,0,M){
    ll d,q;
    cin >> d >> q;

    t_[d-1] = q;
    ans = 0;

    vector<ll> use[26];
    FOR(i,0,26){
      use[i].push_back(0);
    }
    FOR(i,0,D){
      use[t_[i]-1].push_back(i+1);
    }
    FOR(i,0,26){
      use[i].push_back(D+1);
    }

    FOR(i,0,D){
      ans += S[i][t_[i]-1];
    }
    FOR(i,0,26){
      for(int j=1;j<use[i].size();j++){
        ll k = use[i][j]-use[i][j-1] - 1;
        ans -= c[i]*k*(k+1)/2;
      }
    }
    cout << ans << endl;
  }



}



Measured memory_bytes: 3704
#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <unordered_map>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;

int main()
{
	int k; cin>>k;
  if(k==1){
    cout<<1<<endl;
    cout<<1<<endl;
    return 0;
  }
  int ans[500][500];
  int n=(k+3)/4*2;
  for(int i=0; i<n; i++){
    for(int j=0; j<n; j++){
      if(i&1) ans[i][j]=n+1+(i+j)%n;
      else ans[i][j]=1+(i+j)%n;
      for(int t=0; t<2*n-k; t++){
        if(ans[i][j]==2*n-t) ans[i][j]-=n;
      }
    }
  }
  cout<<n<<endl;
  for(int i=0; i<n; i++){
    for(int j=0; j<n; j++){
      cout<<ans[i][j];
      if(j<n-1) cout<<" ";
    }
    cout<<endl;
  }
	return 0;
}

Measured memory_bytes: 2176
#include <bits/stdc++.h>
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define PI (acos(-1.0))
#define pback push_back
#define mpair make_pair
#define divceil(A, B) ((A + (B - 1)) / B)
#define MODN 1000000007
#define ALL(V) (V).begin(),(V).end()
#define CERR if(false) cerr

typedef long long ll;

using namespace std;

int main(){

    int n;
    string s;

    cin >> n;
    cin >> s;

    int l = 0;
    int r = 0;

    int lessl = 0;
    int lessr = 0;

    rep(i,n){
        if(s[i] == '('){
            l++;
        }else{
            r++;
        }

        if(l < r){
            lessl = max(lessl, r - l);
        }
    }

    l = 0, r = 0;

    rep(i,n){
        if(s[n - 1 - i] == '('){
            l++;
        }else{
            r++;
        }

        if(l > r){
            lessr = max(lessr, l - r);
        }
    }

    string ans;

    rep(i, lessl){
        ans += '(';
    }

    ans += s;

    rep(i, lessr){
        ans += ')';
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
solver::String->String
solver (a:b:c:d:_) = let fo = read (a:b:[]) in
                     let la = read (c:d:[]) in
                     if fo == 0 && la == 0 then "NA\n" else
                     case (fo < 13 && fo > 0, la < 13 && la > 0) of
                       (False,False) -> "NA\n"
                       (False,True ) -> "YYMM\n"
                       (True ,False) -> "MMYY\n"
                       (True ,True ) -> "AMBIGUOUS\n"

main::IO()
main=putStr.solver=<<getLine

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

int main(void) {
  int n;
  cin >> n;
  long long result = 0;
  for (int a = 1; a < n; ++a) {
    for (int b = 1; b < n; ++b) {
      if (a * b < n) {
        result++;
      } else {
        break;
      }
    }
  }

  cout << result << endl;
  return 0;
}

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

bool used[1000000];
int dist[1000000];

int main() {
  int n;
  cin >> n;
  vector<int> data(n);
  for (int i = 0; i < n; i ++) cin >> data[i],data[i]--;
  for (int i = 0; i < n; ++i) dist[i] = 1e9;
  
  int now=0;
  dist[0] = 0;
  while(now!=1) {
    int pre=now;
    now=data[now];
    if(used[now]) break;
    used[now]=true;
    dist[now]=dist[pre]+1;
  }
  
  if(dist[1]==1e9) {
    cout<<-1<<endl;
  } else {
    cout<<dist[1]<<endl;
  }
}

Measured memory_bytes: 3072
#include <bits/stdc++.h>
using namespace std;
#define rep(i, a) for(int i=0; i<(a); i++)
typedef long long ll;
template<typename T>
struct edge {
  int src, to;
  T cost;
  edge(int to, T cost) : src(-1), to(to), cost(cost) {}
  edge(int src, int to, T cost) : src(src), to(to), cost(cost) {}
  edge &operator=(const int &x) {
    to = x;
    return *this;
  }
  operator int() const { return to; }
};
template<typename T>
using Edges = vector<edge<T>>;
template<typename T>
using WeightedGraph = vector<Edges<T>>;
using UnWeightedGraph = vector<vector<int>>;
template<typename T>
using Matrix = vector<vector<T>>;

/////////////////////////////////////////////////////////////////////
const ll inf = 1LL<<60;
const ll mod = 1000000007;

int main()
{
  ll n; cin>>n;
  string s; cin>>s;

  ll right = 0;
  ll left = 0;

  ll t = 0;
  for (int i=0; i<n; i++) {
    if (s[i] == '(') t++;
    else {
      if (t>0) t--;
      else left++;
    }
  }
  t = 0;
  for (int i=n-1; i>=0; i--) {
    if (s[i] == ')') t++;
    else {
      if (t>0) t--;
      else right++;
    }
  }

  rep(i, left) cout << "(";
  cout << s;
  rep(i, right) cout << ")";
  cout << endl;

  return 0;
}


Measured memory_bytes: 3648
#include<bits/stdc++.h>
using namespace std;
int main() {
    int S,h,m,s;cin>>S;
    h=S/(60*60);
    m=(S-h*(60*60))/60;
    s=S-(h*(60*60)+m*60);
    cout<<h<<":"<<m<<":"<<s<<endl;
    return 0;
}



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

#define rep(i, n) for (int i = 0; i < (n); ++i)
typedef long long ll;

using namespace std;


struct UnionFind {
    // parで親のnode値と、サイズを同時に管理する。
    // 根ではないnodeのparは親となるnodeの値が入ってる
    // 根にはサイズ数が入っている。区別できるようにサイズはマイナスの値で入っている
    // そのため、初期値はすべて-1になる(mergeの際にmergeされる側の根に、mergeする方の根が加算される
    vector<int> par;

    UnionFind(int n) : par(n, -1) { }
    void init(int n) { par.assign(n, -1); }

    int root(int x) {
        // 上記の通り,負の値ということは、根である
        if (par[x] < 0) return x;
        return par[x] = root(par[x]);
    }

    bool merge(int x, int y) {
        x = root(x); y = root(y);
        if (x == y) return false;
        // サイズが大きいほうにマージする
        // 以下は必ずxが大きいほう(サイズはマイナスの値が入ってるので)にするように調整している
        if (par[x] > par[y]) swap(x, y);
        // xのサイズに、yのサイズを加算する
        par[x] += par[y];
        // yの根をxに更新する
        par[y] = x;
        return true;
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }

    int size(int x) {
        return -par[root(x)];
    }
};

int main() {
    ll N, M;
    cin >> N >> M;
    vector<int> A(M), B(M);
    for(int i = 0; i < M; i++) {
        // iの初期値は0だけど、島の開始は1なので調整する
        cin >> A[i] >> B[i]; --A[i], --B[i];
    }

    UnionFind tree(N);

    // はじめはすべての辺がないので、不便さはすべての島において発生する
    ll cur = N * (N-1) / 2;

    // 辺が0の状態から構築していく
    vector<ll> res;
    for (ll i = 0; i < M; ++i) {
        res.push_back(cur);

        // 読み込んだ順番と逆から辺を追加していく
        ll a = A[M-1-i], b = B[M-1-i];
        if (tree.same(a, b)) continue;

        ll sa = tree.size(a), sb = tree.size(b);
        cur -= sa * sb;
        tree.merge(a, b);
    }

    reverse(res.begin(), res.end());
    for (int i = 0; i < res.size(); ++i) cout << res[i] <<endl;
}

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

int main(){
  
  int A,B,C,D;
  
  cin >> A >> B >> C >> D;
  
  if (A+B > C+D){
    
    cout << "Left" << endl;
    
  }
  
  if (A+B == C+D){
    
    cout << "Balanced" << endl;
    
  }
  
  if (A+B < C+D){
    
    cout << "Right" << endl;
    
  }
}


Measured memory_bytes: 256
#include<math.h>
L(int ax,int ay,int bx,int by,int cx,int cy,int dx,int dy,double*X,double*Y){
	int acx,acy,bunbo;
	int r,s;
	//printf("(%d,%d)-(%d,%d) , (%d,%d)-(%d,%d) : ",ax,ay,bx,by,cx,cy,dx,dy);
	acx=cx-ax;
	acy=cy-ay;
	bunbo=(bx-ax)*(dy-cy)-(by-ay)*(dx-cx);
	if(bunbo){
		r=((dy-cy)*acx-(dx-cx)*acy);
		s=((by-ay)*acx-(bx-ax)*acy);
		if(bunbo<0){
			r=-r;
			s=-s;
			bunbo=-bunbo;
		}
		if(r>=0&&r<=bunbo&&s>=0&&s<=bunbo){
			*X=ax+r/(double)bunbo*(bx-ax);
			*Y=ay+r/(double)bunbo*(by-ay);
			//printf("(%f,%f)\n",*X,*Y);
			return 1;
		}
	}
	//printf("NA\n");
	return 0;
}
main(){
	int x1[3],y1[3],x2[3],y2[3];
	double X[3],Y[3],S;
	int i=0;
	for(;~scanf("%d%d%d%d",x1+i,y1+i,x2+i,y2+i);){
		if(++i==3){
			if(L(x1[0],y1[0],x2[0],y2[0],x1[1],y1[1],x2[1],y2[1],X+0,Y+0)&&
			   L(x1[1],y1[1],x2[1],y2[1],x1[2],y1[2],x2[2],y2[2],X+1,Y+1)&&
			   L(x1[2],y1[2],x2[2],y2[2],x1[0],y1[0],x2[0],y2[0],X+2,Y+2))
			{
				S=0;
				for(i=0;i<3;i++){
					S+=(X[i]-X[(i+1)%3])*(Y[i]+Y[(i+1)%3])/2;
				}
				S=fabs(S);
				if(S<1e-6)
					puts("kyo");
				else if(S<100000-1e-6)
					puts("syo-kichi");
				else if(S<1000000-1e-6)
					puts("kichi");
				else if(S<1900000-1e-6)
					puts("chu-kichi");
				else
					puts("dai-kichi");
			}else{
				puts("kyo");
			}
			i=0;
		}
	}
}

Measured memory_bytes: 0
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
typedef long long int ll;
using namespace std;
#define P 1000000007
#define rep(i,n) for(i=0;i<n;++i)
#define repp(i,a,n) for(i=a;i<n;++i)
#define repr(i,a,n) for(i=a;i>=n;--i)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
ll n;
ll binpowmod(ll a, ll b, ll m) {
    a %= m;
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a % m;
        a = a * a % m;
        b >>= 1;
    }
    return res;
}

ll binpow(ll a, ll b) {
    ll res = 1;
    while (b > 0) {
        if (b & 1)
            res = res * a;
        a = a * a;
        b >>= 1;
    }
    return res;
}

ll modInverse(ll n, ll p)
{
    return binpowmod(n, p-2, p);
}

string dcb(ll u)
{
    string temp="";
    ll r,t=0;
    for(ll i=0;i<n;++i)
    {
        r=u%2;
        temp+=r+'0';
        u/=2;
        
    }
    reverse(temp.begin(),temp.end());
    return temp;
}

int main() 
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    ll t,m,i,f=0,j,ans=0,x;
    cin >> n >> m >> x ;
    ll c[n];
    ll a[n][m];
    ll su[m]={0};
    rep(i,n)
    {
        cin >> c[i];
        rep(j,m)
        {
            cin >> a[i][j] ;
            su[j]+=a[i][j];
        }
    }
    rep(i,m) 
    {
        //cout << su[i] << endl;
        if(su[i]<x) 
        {
            //cout << 
            cout << -1 ;
            return 0;
        }
    }
    t=binpow(2,n)-1;
    //cout << t << endl ;
    string temp;
    ll l,cnt=0,temp1;
    ll su1[m],u;
    ans=1e18;
    for(i=0;i<=t;++i)
    {
        //temp=dcb(i);
        ll cnv[n];
        u=i;
        for(j=n-1;j>=0;--j)
        {
            cnv[j]=u%2;
            u/=2;
        }
        //cout << temp << endl;
        cnt++;
        rep(j,m) su1[j]=0;
        temp1=0;
        for(j=0;j<n;++j)
        {
            if(cnv[j]==1)
            {
                temp1+=c[j];
                for(l=0;l<m;++l)
                {
                    su1[l]+=a[j][l];
                }
            }
        }
        //cout << temp1 << endl ;
        f=0;
        for(j=0;j<m;++j)
        {
            if(su1[j]<x)
            {
                f=1;
                break;
            }
        }
        if(f==0)
        {
            //cout << temp1;
            ans=std::min(ans,temp1);
            //return 0;
        }
    }
    //cout << cnt << endl ;
    cout << ans ;
    
    return 0;
}

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

using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	REP(i, v.size()) { if (i)os << " "; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
	REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}

const ll INF = 1LL << 60;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

int main() {
	ll n;
	vector<ll> v;
	ll flag;
	ll min = 1000000;
	ll max = -1000000;
	ll minid = 0;
	ll maxid = 0;

	cin >> n;

	REP(i, n) {
		ll a;
		cin >> a;
		v.push_back(a);
		if (a < min) {
			min = a;
			minid = i;
		}
		if (a > max) {
			max = a;
			maxid = i;
		}
	}

	if (v[minid] > 0) {
		flag = 0;
		cout << n - 1 << endl;
	}
	else if (v[maxid] < 1) {
		flag = 1;
		cout << n - 1 << endl;
	}
	else {
		if (abs(v[minid]) < abs(v[maxid])) {
			flag = 0;
			cout << 2 * (n - 1) + 1 << endl;
			REP(i, n) {
				cout << maxid + 1 << " " << i + 1 << endl;
			}
		}
		else {
			flag = 1;
			cout << 2 * (n - 1) + 1 << endl;
			REP(i, n) {
				cout << minid + 1 << " " << i + 1 << endl;
			}
		}
	}

	if (flag) {
		RREP(i, n - 1) {
			cout << i + 2 << " " << i + 1 << endl;
		}
	}
	else {
		REP(i, n - 1) {
			cout << i + 1 << " " << i + 2 << endl;
		}
	}
}

Measured memory_bytes: 256
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <iostream>
#define MM 300
#define NN 105
#define MOD 1000000007
#define LL long long
using namespace std;
LL dp[NN][MM];
int n, k, star[NN];
LL fac[NN];
int main()
{
    fac[0] = 1LL;
    for(int i = 1; i <= 100; i++) fac[i] = fac[i - 1] * (LL)i % MOD;
    cin >> n >> k;
    for(int i = 1; i <= n; i++) cin >> star[i];
    memset(dp, 0, sizeof(dp));
    dp[0][0] = 1;
    for(int i = 1; i <= n; i++)
    {
        for(int j = i - 1; j >= 0; j--)
        {
            for(int x = 0; x < 256; x++)
            {
                dp[j + 1][x ^ star[i]] += dp[j][x];
                dp[j + 1][x ^ star[i]] %= MOD;
            }
        }
    }
    LL res = 0;
    for(int i = 1; i <= n; i++)
    {
        res = (res + ((dp[i][k] * fac[i]) % MOD)) % MOD;
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <iomanip>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <bitset>
#include <stack>
#include <utility>
#include <numeric>
#include <algorithm>
#include <functional>
#include <cctype>
#include <complex>
#include <string>
#include <sstream>
#include <fstream>
#include <cassert>
using namespace std;

//common
typedef long long i64,ll;

#define BR "\n"
#define ALL(c) (c).begin(),(c).end()
#define REP(i,n) for(int i=0;i<(int)(n);++i)
#define FOR(i,l,r) for(int i=(l);i<(int)(r);++i)
#define EACH(it,o) for(auto it = (o).begin(); it != (o).end(); ++it)
#define IN(l,v,r) ((l)<=(v) && (v)<(r))

//debug
#ifdef NDEBUG
#define DUMP(x)
#define DUMPLN(x)
#define DEBUG(x)
#define DEBUGLN(x)
#define LINE()
#define LINELN()
#define CHECK(exp,act)
#define STOP(e)
#else
#define DUMP(x)  cerr << #x << " = " << (x)
#define DUMPLN(x)  DUMP(x) <<endl
#define DEBUG(x) DUMP(x) << LINE() << " " << __FILE__
#define DEBUGLN(x) DEBUG(x)<<endl
#define LINE()    cerr<< " (L" << __LINE__ << ")"
#define LINELN()    LINE()<<endl
#define CHECK(exp,act)  if(exp!=act){DUMPLN(exp);DEBUGLN(act);}
#define STOP(e)  CHECK(e,true);if(!(e)) exit(1);
#endif

template<class T> inline string toString(const vector<T>& x) {
	stringstream ss;
	REP(i,x.size()){
		if(i!=0)ss<<" ";
		ss<< x[i];
	}
	return ss.str();
}

template<class T> inline string toString(const vector<vector<T> >& map) {
	stringstream ss;
	REP(i,map.size()){
		if(i!=0)ss<<BR;
		ss<< toString(map[i]);
	}
	return ss.str();
}
template<class K,class V>  string toString(map<K,V>& x) {
	string res;stringstream ss;
	for(auto& p:x)ss<< p.first<<":" << p.second<<" ";
	return ss.str();
}

string BITtoString(int bit){
    stringstream ss;
    while(bit!=0){ss<<(bit%2);bit/=2;}
    string res=ss.str();reverse(ALL(res));
    return res;
}

template<typename T,typename V> inline T pmod(T v,V MOD){
	return (v%MOD+MOD)%MOD;
}

class Main{
public:
	
	bool comp(int h1,int w1,int h2,int w2){
		int d1=h1*h1+w1*w1;
		int d2=h2*h2+w2*w2;
		if(d1!=d2)return d1<d2;
		return h1<h2;
	}

	void run(){

		while(true){
			int h,w; cin >> h >> w;if(h==0 && w==0)return;


			int mh=-1,mw=-1;
			for(int h2=1;h2<=150;h2++)
			for(int w2=1;w2<=150;w2++)if(h2<w2){
				if(comp(h,w,h2,w2)){
					if(mh==-1){
						mh=h2;mw=w2;
					}else{
						if(comp(h2,w2,mh,mw)){
							mh=h2;mw=w2;
						}
					}
				}
			}
			cout <<mh <<" "<<mw <<endl;
		}
	}
};

 int main(){
	//ios::sync_with_stdio(false);
 	Main().run();
 	return 0;
 }

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

int main() {
    int a, b;
    vector<int> v(101,0);
    while (cin >> a >> b) {
        if (a == 0 && b == 0) {
            string res = "OK";
            if (v[1] % 2 != 1) res = "NG";
            if (v[2] % 2 != 1) res = "NG";
            for (int i=3; i<=100; ++i) {
                if (v[i] % 2 == 1) res = "NG";
            }
            cout << res << endl;
            v.assign(101,0);
        } else {
            ++ v[a];
            ++ v[b];
        }
    }
    return 0;
}

Measured memory_bytes: 1204
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
#define rep(i, n) for (ll i = 0; i < n; i++)
#define FOR(i, a, b) for (ll i = a; i < b; i++)
#define is(a, b) a == b
#define len(v) ll(v.size())

const ll mod=1e9+7;

//vector書き出し
template <class T>
void cout_vec(const vector<T> &vec1){
  rep(i,len(vec1)){
    cout<<vec1[i]<<' ';
  }
  cout<<'\n';
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int m;
    cin>>m;
    cout<<24-m+24<<endl;
}

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

#define FOR(i,b,e) for(int i=(b); i <= (e); ++i)
#define FORD(i,b,e) for(int i=(b); i >= (e); --i)
#define REP(i,n) for(int i=0; i < (n); ++i)
#define SIZE(c) (int) (c).size()
#define ALL(c) (c).begin(), (c).end()
#define PB push_back
#define MP make_pair
#define ST first
#define ND second
#define FWD(i,a,b) for (int i=(a); i<(b); ++i)
#define BCK(i,a,b) for (int i=(a); i>(b); --i)
#define PI 3.14159265358979311600
#define pb push_back
#define mp make_pair
#define st first
#define nd second

using namespace std;

typedef long long ll;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;

typedef vector < int > VI;
typedef vector<ll> VL;

typedef long double K;

#define int long long

int n, l, t;
vector<int> x, w, b;

long long bumps(int i, int j) {
	if (w[i] == 2) {
		swap(i, j);
	}
	long long dst = (x[j] > x[i]) ? (x[j] - x[i]) : (l - x[i] + x[j]);
	long long my_time = l;
	long long result = (t / my_time) * 2;
	my_time = t % my_time;
	//cout << dst << ' ' << my_time << ' ' << x[i] << ' ' << x[j] << endl;
	if ((dst + 1) / 2 <= my_time) {
		my_time -= (dst + 1) / 2;
		++result;
		dst = l - dst % 2;
		if (my_time >= (dst + 1) / 2) {
			++result;
		}
	}
	return result;
}

int go(int pos, int val) {
	long long cnt = 0;
	REP(i, n) {
		if (w[i] != w[pos]) {
			cnt += bumps(pos, i);
			cnt %= n;
		}
	}
	if (w[pos] == 2) {
		return (pos - cnt + n) % n;
	}

	return (pos + cnt) % n;
}

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

	cin >> n >> l >> t;
	x.resize(n);
	w.resize(n);
	b.resize(n);
	REP(i, n) {
		cin >> x[i] >> w[i];
		int add = (w[i] == 1) ? t : (l - t % l);
		b[i] = (x[i] + add) % l;
	}

	srand(time(0));
	int rnd = 0;

	int val = b[rnd];
	int pos = go(rnd, val);

	// cout << pos << ' ' << val << endl;
	// cout << pos << endl;
	sort(b.begin(), b.end());
	int result = 0;
	REP(i, n) {
		if (b[i] == val) {
			if (i + 1 < n && b[i + 1] == val) {
				if (w[rnd] == 2) {
					result = i;
				} else {
					result = i + 1;
				}
			} else {
				result = i;
			}
			// result = i;
			break;
		}
	}

	vector<int> r(n);

	REP(i, n) {
		int now, ps;
		now = (pos + i) % n;
		ps = (result + i) % n;
		r[now] = b[ps];
	}

	for (auto& item : r) {
		cout << item << '\n';
	}

	return 0;
}

Measured memory_bytes: 4352
#include "stdio.h"
int main(){
    int N;
    int H[100];
    int i,j;
    int ret = 0;
    int flag;
    scanf("%d",&N);
    for(i=0;i<N;i++){
        scanf("%d",&H[i]);
    }
    for(i=0;i<N;i++){
        flag = 0;
        for(j=0;j<i;j++){
            if (H[i] < H[j]){
                flag = 1;
                break;
            }
        }
        if (flag==0){
            ret++;
        }
    }
    printf("%d\n",ret);
    return 0;
}


Measured memory_bytes: 128
#include<bits/stdc++.h>
#define mod 1000000007
#define int long long int
#define phi 1.6180339
#define rep(i,n) for(auto i=0;i<(n);i++)
#define endl "\n"
#define For(i,a,b) for(auto i=(a);i<(b);i++)
#define op1 cin.tie(NULL)
#define op2 cout.tie(NULL)
#define op3 std::ios_base::sync_with_stdio(false)
#define MAXX 1000001
using namespace std;
vector<int> arr(MAXX);
void trozen()
{
    int n;
    cin>>n;
    vector<int> v1(n+1);
    for(int i=1;i<=n;i++)cin>>v1[i];
    vector<int> dp(n+1);
    dp[0]=0;
    for(int i=1;i<=n;i++)
    {
        if(i==1)
        {
            dp[i]=0;
            continue;
        }
        if(i==2) {dp[i]=abs(v1[i-1]-v1[i]);continue;}
        dp[i]=min(abs(v1[i]-v1[i-1])+dp[i-1],abs(v1[i]-v1[i-2])+dp[i-2]);

    }
    cout<<dp[n]<<endl;
}
int32_t main()
{
    op1;op2;op3;
    /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
    #endif*/
    trozen();
    return 0;
}


Measured memory_bytes: 12680
#include<stdio.h>

int main(void){
    int H,W;
    int i,j,k;
    
    for(k=1;k<1000;k++){
        scanf("%d %d",&H,&W);
        if(H!=0||W!=0){
            for(i=1;i<=H;i++){
                for(j=1;j<=W;j++){
                    printf("#");
                }
            printf("\n");
            }
            printf("\n");
        }
    }
    
    return 0;
}



Measured memory_bytes: 2040
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include <map>
#include <cmath>
#include <string>
using namespace std;

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

#define PI 3.14
typedef long long ll;


ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll c, ll d) { return c / gcd(c, d) * d; }

int main() {
  double r;
  cin >> r;

  cout << 2.0*r*PI << endl;
  return 0;
}

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

int main(){
  int w;  
  while(cin >> w){
	int bit = pow(2,9);
	vector<int> a;
	for(int i=0;i<10;i++){
	  if(w/bit) a.push_back(bit);
	  w = w%bit;
	  bit /= 2;
	}
	reverse(a.begin(),a.end());
	for(int i=0;i<a.size();i++){
	  cout << a[i];
	  if(i==a.size()-1) cout << endl;
	  else cout << ' ';
	}
  }
  return 0;
}

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


int main(){
    string s;
    cin >> s;
    int size = s.size();
    int maxlen = 0;
    while (true){
        rep(i, 2){
            s.pop_back();
        }
        size = s.size();
        bool match = 1;
        int k = size/2;
        rep(i, size/2){
            if (s.at(i) != s.at(i+k)){
                match = 0;
                break;
            }
        }
        if (match){
            maxlen = s.size();
            break;
        }
    }
    cout << maxlen << endl;
}

Measured memory_bytes: 256
N = int(input())

divisors = []
for x in range(1, int(N**0.5) + 1):
    if N % x == 0:
        divisors.append(x)

sums = []
for x in divisors:
    i, j = x, N // x
    sums.append(i + j)

print(min(sums) - 2)


Measured memory_bytes: 3188
#include <numeric>
#include <iostream>
#include <array>
#include <string>
#include <vector>
#include <cassert>
#include <algorithm>
#include <math.h> 
#include <set>
#include <map>
#include <utility>
#include <deque>
#include <queue>


using namespace std;

#define ll long long int
#define rep(i, n) for(ll i = 0; i < n; i++)
#define repp(i, n) for(int i = 1; i <= n; i++)
#define sort(v) sort((v).begin(), (v).end())
#define riverse(v) reverse((v).begin(), (v).end())
#define pb push_back
#define mp make_pair
using vi = vector<int>;
using vs = vector<string>;
using vll = vector<ll>;
using vvi = vector<vi>;
const ll MOD = 1e9 + 7;
vi alphabet = { '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' };


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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0;i<(n);i++)
#define all(x) (x).begin(),(x).end()
using ll = long long;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

int main() {
	
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	ll ans=0;
	
	int n; cin >> n;
	//vector<int> a(n),b(n); rep(i,m) cin >> a[i];
	
	string s,t; cin >> s >> t;
	
	
	rep(i,n){
		cout << s[i] << t[i];
	}
	
	cout << endl;
	
	//cout << ans << "\n";
	
	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <algorithm>
int N, E, head[100001], next[199999], to[199999], root, q[100001], fa[100001];
long long a[100001], b[100001];
int main()
{
	scanf("%d", &N);
	for (int i = 1; i <= N; i++)
		scanf("%lld", a + i);
	if (N == 2)
	{
		puts(a[1] == a[2] ? "YES" : "NO");
		return 0;
	}
	for (int i = 1, u, v; i < N; i++)
	{
		scanf("%d%d", &u, &v);
		next[++E] = head[u], to[E] = v, head[u] = E;
		next[++E] = head[v], to[E] = u, head[v] = E;
	}
	do root++; while (!next[head[root]]);
	do
	{
		int H = 0, T = 1, u;
		q[1] = root;
		while (H < T)
			for (int e = head[u = q[++H]]; e; e = next[e])
				if (to[e] != fa[u])
					fa[q[++T] = to[e]] = u;
	}
	while (0);
	for (int i = 1; i <= N; i++)
		for (int e = head[q[i]]; e; e = next[e])
			if (to[e] != fa[q[i]])
				a[q[i]] -= a[to[e]];
	for (int i = 1; i <= N; i++)
		if (!next[head[i]])
		{
			b[i] = a[i];
			a[i] = 0;
		}
	for (int i = N; i > 1; i--)
		a[fa[q[i]]] -= a[q[i]];
	for (int i = 1; i <= N; i++)
		if ((a[i] = -a[i]) < 0)
		{
			puts("NO");
			return 0;
		}
	for (int i = N; i; i--)
	{
		int u = q[i];
		if (!next[head[u]])
			continue;
		long long SUM = 0, MAX = 0;
		for (int e = head[u]; e; e = next[e])
			if (to[e] != fa[u])
			{
				SUM += b[to[e]];
				MAX = std::max(MAX, b[to[e]]);
			}
		if (a[u] > std::min(SUM >> 1, SUM - MAX))
		{
			puts("NO");
			return 0;
		}
		b[u] = SUM - (a[u] << 1);
	}
	puts(b[root] ? "NO" : "YES");
	return 0;
}


Measured memory_bytes: 4480