akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define int long long int
#define ii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define pb push_back
using namespace std;
#define output(x) for (auto a:x) cout<<a<<" ";cout<<endl;
#define output2(x) for (auto a:x) cout<<a.fi<<" "<<a.se<<endl;
#define PI 3.14159265

// DEBUG TEMPLATE
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
  *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "
  
// DEBUG TEMPLATE ENDS

#define MOD 1000000007
int power(int x,int y,int mod = MOD) 
{ 
  int ret = 1;
  x = x % mod;
  while (y){
    if(y&1) ret = (ret*x)%mod;
    y = y>>1;
    x = (x*x)%mod;
    } 
    return ret%mod; 
}


void solve()
{ 
  int n,k;
  cin>>n>>k;
  vector<int> inp(n);
  for (auto &x:inp) cin>>x;
  sort(inp.begin(),inp.end());
  int ans = 0;
  for (auto x:inp){
    ans+=x;
    k--;
    if (k==0) break;
  }
  cout<<ans<<endl;
}


/*
  
*/
signed main(){
  int t = 1;
  // cin>>t;
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  for (int test=1;test<=t;test++){
    // debug() << imie(test);
    solve();
  }
}
// Check MOD values plox :(


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

#define loop(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(i, n) for (int i = 0; i < n; ++i)
#define dump(a) cerr << #a << " = " << (a) << "(L:" << __LINE__ << ")" << endl

const long long MOD = 1000000007;

void solve(long long N, std::vector<long long> A) {
    std::vector<long long> B(N);
    for (int i = N - 2; 0 <= i; i--) {
        B[i] = B[i + 1] + A[i + 1];
        B[i] %= MOD;
    }
    long long ans = 0;
    rep (i, N) {
        ans += A[i] * B[i];
        ans %= MOD;
    }
    cout << ans << endl;
}

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


Measured memory_bytes: 6428
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7L;

string s;

int main(){

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

cin>>s;

cout<<2018;
for(int i=4; i<10; i++){
  cout<<s[i];
}
cout<<endl;


}



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

typedef long long int ll;
typedef unsigned long long ull;
typedef long double ld;
const int mod = 1e9 + 7;
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define INF 1999999999
#define MODA 1000000007
#define PI 3.1415926535897932384626433
//cout << fixed << setprecision(2);


int main()
{
    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int n;
    cin >> n;
    vector<ll> a(n);
    for (int i = 0; i < n; i++)
    {
        cin >> a[i];
        if (a[i] == 0)
        {
            cout << 0 << endl;
            return 0;
        }
    }

    ll ans = a[0];
    for (int j = 1; j < n; j++)
    {
        ans *= a[j];
        
    }
    if (0 < ans && ans <= 1000000000000000000)
    {
        cout << ans << endl;
    }
    else
        cout << "-1" << endl;
    return 0;
}


Measured memory_bytes: 3996
import java.util.Arrays;
import java.util.HashSet;
import java.util.Scanner;
import java.util.Vector;

public class Main {
	public static void main(String args[]) {
		Scanner in = new Scanner(System.in);
		String[] arr= {"AC","WA","TLE","RE"};
		int n = in.nextInt();
		int x[] = new int[4];
		while (n--!=0) {
			String string = in.next();
			if (string.equals("AC")) {
				x[0]++;
			}else if(string.equals("WA")) {
				x[1]++;
			}else if (string.equals("TLE")) {
				x[2]++;
			}else {
				x[3]++;
			}
		}
		for (int i = 0; i < arr.length; i++) {
			System.out.println(arr[i]+" x "+x[i]);
		}
	}
}

Measured memory_bytes: 49000
#include <bits/stdc++.h>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define REP(i,n) for(int i=0;i<n;i++)
#define FOR(i,n1,n2) for(int i=n1;i<n2;i++)
#define bFOR(i,n1,n2) for(int i=n1;i>=n2;i--)
#define speed_up    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);

typedef long long int ll;
typedef pair<ll,ll> Pi;
const int INF=(ll)(1LL<<30)-1;
const double INFd=100000000000.0;
const ll INFl=(ll)9223372036854775807;
const int MAX=10000;
const ll MOD=(ll)1e9+7;
ll gcd(ll a,ll b){return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){return a/gcd(a, b)*b;}
int dx[4]={0,-1,0,1},dy[4]={-1,0,1,0};
int mdx[4]={0,1,0,-1},mdy[4]={-1,0,1,0};


template<typename A, size_t N, typename T>
void Fill(A (&array)[N], const T &val){
    std::fill( (T*)array, (T*)(array+N), val );
}

ll n,k;
ll a[100100],b[100100];
ll ans=1;
vector<ll> temp[100100];
vector<ll> ab[100100];
ll parent[100100];
ll alr[100100];
int main(){
	cin>>n>>k;
	REP(i,100100)alr[i]=0;
	for(ll i=0;i<n-1;i++){
		ll s,t;
		cin>>s>>t;
		temp[s].push_back(t);
		temp[t].push_back(s);
	}
	alr[1]=1;
	parent[1]=1;
	queue<ll> qq;
	qq.push(1);
	while(qq.size()){
		ll t1=qq.front();qq.pop();
		for(ll i=0;i<temp[t1].size();i++){
			if(!alr[temp[t1][i]]){
				ab[t1].push_back(temp[t1][i]);
				alr[temp[t1][i]]=1;
				parent[temp[t1][i]]=t1;
				qq.push(temp[t1][i]);
			}
		}
	}
	ans*=k;
	ans%=MOD;
	for(ll i=0;i<ab[1].size();i++){
		qq.push(ab[1][i]);
		ans*=(k-i-1);
		ans%=MOD;
	}
	while(qq.size()){
		ll t1=qq.front();qq.pop();
		for(ll i=0;i<ab[t1].size();i++){
			ans*=(k-i-2);
			ans%=MOD;
			qq.push(ab[t1][i]);
		}
	}
	cout<<ans<<endl;
	return 0;
}

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

int main(){
  int H, W;
  char a[100][100];
  int i, j;
  cin >> H >> W;
  for(i=0; i<H; i++){
    for(j=0; j<W; j++){
      cin >> a[i][j];
    }
  }
  for(i=0; i<W+2; i++){
    cout << "#";
  }
  cout << endl;
  for(i=0; i<H ;i++){
    cout << "#";
    for(j=0; j<W; j++){
      cout << a[i][j];
    }
    cout << "#" << endl;
  }
  for(i=0; i<W+2; i++){
    cout << "#";
  }
  cout << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define MAX 300005
struct BIT{
  int a[MAX];
  void init(){
    for(int i=0;i<MAX;i++)a[i]=0;
  }
  void add(int i,int x){
    i++;

    while(i<MAX){
      a[i]+=x;
      i+=(i&-i);
    }
  }

  int sum(int i){
    i++;
    
    int res=0;
    while(i){
      res+=a[i];
      i-=(i&-i);
    }
    return res;
  }
};


BIT T;
string str;
int N,K;

set<int> t[26];

int main(){
  T.init();
  cin>>str>>K;
  N=str.size();
  
  for(int i=0;i<N;i++){
    int ch=str[i]-'a';
    t[ ch ].insert(i);
  }

  for(int i=0;i<N;i++){
    for(int j=0;j<26;j++){
      if(t[j].empty())continue;
      int index=*t[j].begin();
      int flg = index - T.sum(index);
      if(flg>K)continue;
      K-=flg;
      cout<<(char)('a'+j);
      T.add(index,1);
      t[j].erase(index);
      break;
    }
  }
  cout<<endl;
  return 0;
}

Measured memory_bytes: 13704
#include<iostream>
#include <cstdio>
#include<cmath>
#include<vector>
#include<algorithm>

using namespace std;

////Nayeem Shahriar Joy,Applied Physics &Electronic Engineering,University of Rajshahi.

int main()

{
    vector<int>p;
   int t,a,b,c,d;
   cin>>t;
   while(t--)
   {
       for(int i=0;i<3;i++){
       cin>>a;
       p.push_back(a);
       }
       sort(p.begin(),p.end());
       b=p[0]*p[0];
       c=p[1]*p[1];
       d=p[2]*p[2];
       if(b+c==d)
       {
           cout<<"YES"<<endl;
       }
       else{
        cout<<"NO"<<endl;
       }
       p.clear();
   }
   return 0;
}

Measured memory_bytes: 3028
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
ll a[505][505];
bool chk[23333333];
ll gcd(ll x,ll y){return y?gcd(y,x%y):x;}
ll lcm(ll x,ll y){return x/gcd(x,y)*y;}
int nxtPrime(int&x){
    auto chk=[&](int x){
        if(x<2)return false;
        for(int i=2;i*i<=x;i++)
            if(x%i==0)
                return false;
        return true;
    };
    do x++;while(!chk(x));
    ::chk[x]=true;
    return x;
}
int main(){
    int n,p=0;cin>>n;
    if(n==2)return puts("4 7\n23 10"),0;
    for(int i=1,j=n-(~n&1);i<=n;i++,j--)
        if(!a[i][j]&&1<=j&&j<=n)
            a[i][j]=nxtPrime(p);
    for(int i=n,j=n;i>=1;i--,j--)
        if(!a[i][j])
            a[i][j]=nxtPrime(p);
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            if((i+j)%2==0){
                if(a[i][j])continue;
                auto get=[&](int dx,int dy)->ll{
                    int x=i,y=j;
                    while(1<=x&&x<=n&&1<=y&&y<=n){
                        if(chk[a[x][y]])return a[x][y];
                        x+=dx,y+=dy;
                    }
                    return 1;
                };
                a[i][j]=get(+1,+1)*get(+1,-1)*get(-1,+1)*get(-1,-1);
            }
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            if((i+j)%2==1){
                auto upd=[&](int dx,int dy){
                    if(a[i+dx][j+dy])
                        a[i][j]=lcm(a[i][j],a[i+dx][j+dy]);
                };
                a[i][j]=1;
                upd(+1,0);
                upd(-1,0);
                upd(0,+1);
                upd(0,-1);
                a[i][j]++;
            }
    for(int i=1;i<=n;i++)
        for(int j=1;j<=n;j++)
            cout<<a[i][j]<<" \n"[j==n];
    return 0;
}

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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

long long N;

bool check(long long h, long long n, long long w) {
  return 4*h*n*w == N*(n*w+h*w+h*n);
}

void solve() {
  scanf("%lld", &N);
  for (long long h = 1; h <= 3500; ++h) {
    for (long long n = 1; n <= 3500; ++n) {
      if (4*h*n-N*n-N*h == 0) continue;
      long long w = N*h*n/(4*h*n-N*n-N*h);
      if (w <= 0) continue;
      if (check(h, n, w)) {
	printf("%lld %lld %lld\n", h, n, w);
	return;
      }
    }
  }
}

int main() {
  init();
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Measured memory_bytes: 3856
#include<bits/stdc++.h>
#define ll long long
#define here cout<<"here\n"
#define pb push_back
#define mp make_pair
#define si(x) scanf("%d",&x)
#define sl(x) scanf("%lld",&x)
#define pf printf
#define pfi(x) printf("%d\n",x)
#define pfl(x) printf("%lld\n",x)
using namespace std;

const ll mod = 1e9+7;

const int MAX = 500005;

ll modexp(ll x, ll n)
{
    if(n==0)
        return 1LL;
    if(n%2==0)
    {
        ll y = modexp(x,n/2)%mod;
        return (y*y)%mod;
    }
    return (x*modexp(x,n-1)%mod)%mod;
}

ll powr(ll x, ll n)
{
    ll ans = 1;
    for(int i=1;i<=n;i++)
        ans=ans*x;
    return ans;
}

int main()
{
    string s;
    cin>>s;
    stack<char> st;
    int ans = 0;
    for(int i=0;i<s.size();i++)
    {
        if(st.empty()==true)
            st.push(s[i]);
        else
        {
            if(st.top()!=s[i])
            {
                st.pop();
                ans+=2;
            }
            else
                st.push(s[i]);
        }
    }
    pfi(ans);
    return 0;
}


Measured memory_bytes: 512
N = int(input())
Z = []
max = 0
for i in range(N):
    A = int(input())
    Z.append([list(map(int, input().split())) for i in range(A)])
for a in range(2 ** N):
    flag = 1
    for i in range(N):
        if (((a >> i) + 1) & 1):
            continue
        z = Z[i]
        for x in z:
            if not (((a >> (x[0] - 1)) + 1 - x[1]) & 1):
                flag = 0
                break
        if flag == 0:
            break
    if flag == 1:
        x = bin(a).count('1')
        if x > max:
            max = x
print(max)

Measured memory_bytes: 9172
#include<stdio.h>
int main()
{
    char a[10];
    int n[10]={0},j=0,t,i,k;

    scanf("%s",a);

    for(k=0;a[k]!='\0';k=i+1)
    {
            for(i=k;a[i]!='\0';i++)
        {
        if(a[i]=='A' || a[i]=='C' || a[i]=='G' || a[i]=='T')
            n[j]++;
        else
            break;
        }

        j++;
    }

    for(int i=0;i<10-1;i++)
        for(int j=0;j<9-i;j++)
    {
        if(n[j]<n[j+1])
        {
            t=n[j];
            n[j]=n[j+1];
            n[j+1]=t;
        }

    }


    printf("%d",n[0]);




}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for(int i = int(a); i < int(b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
const long long INFLL = 1LL << 60;
const int INFINT = 1 << 30;
const long long MOD = 1e9 + 7;

template <class T> void vecout(T V) {
    auto t = V.begin();
    while(t != V.end()) {
        cout << *t++;
        if(t != V.end()) cout << " ";
    }
    cout << endl;
};

template <typename T> T modpow(T a, T n, T mod) { // a^n % mod
    T res = 1;
    while(n > 0) {
        if(n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

template <typename T> T gcd(T a, T b) {
    if(a > b) gcd(b, a);
    T r;
    while(r = a % b) {
        a = b;
        b = r;
    }
    return b;
}
template <typename T> T lcm(T a, T b) { return a * b / gcd(a, b); }

template <typename T> T EP(T n) {
    T r = floor(sqrt(n));
    T m = n;
    set<T> p;
    if(((n % 2) == 0) && 2 <= r) {
        p.insert(2);
        while(n % 2 == 0) {
            n /= 2;
        }
    }
    for(int i = 3; i <= r; i += 2) {
        if(n % i == 0) {
            p.insert(i);
            while(n % i == 0) {
                n /= i;
            }
        }
    }
    if(r < n) p.insert(n);
    for(auto e : p)
        m = m / e * (e - 1);
    return m;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n;
    cin >> n;
    cout << EP(n) << endl;
}


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

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

    for (size_t i = 0; i < n; i++)
    {
        cin>>a.at(i);
    }
    

    for (size_t i = 0; i < n; i++)
    {
        if (a.at(i)%2==0)
        {
            if (a.at(i)%3==0 || a.at(i)%5==0)
            {
                
            } else
            {
                cout<<"DENIED";
                return 0;
            }
            
            
        }
        
    }
    cout<<"APPROVED";
}

Measured memory_bytes: 764
#include <algorithm>
#include <iostream>
#include <cstring>
#include <cstdio>
#include <cmath>
using namespace std;
char c[200233];
int main()
{
	int n;
	scanf("%d",&n);
	int sumw=0,sumr=0;
	for (int i=1;i<=n;i++)
	{
		cin>>c[i];
		if (c[i]=='W') sumw++;
		else sumr++;
	}
	int ans=0;
	for (int i=1;i<=sumr;i++)
		if (c[i]=='W') ans++;
		printf("%d\n",ans);
		return 0;
}

Measured memory_bytes: 3424
using System;

class Program
{
	static void Main(string[] args)
	{
		int N = int.Parse(Console.ReadLine());
		string S = Console.ReadLine(),re = "";
		int[] C = new int[S.Length];
		for(int i = 0;i < S.Length;i++)
		{
			C[i] = (int)S[i];
			C[i] = C[i] + N;
			if (C[i] > 90) C[i] -= 26;
			re += (char)C[i];
		}
		Console.WriteLine(re);
	}
}


Measured memory_bytes: 34772
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

#include <limits.h>

using namespace std;

typedef long long ll;

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

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

int main(void) {
    ll X;
    cin >> X;

    int ans = 0;
    ll acc = 100;
    while (acc < X) {
        acc = (ll) acc * 1.01;
        ans++;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3636
#include <stdio.h>
#include <queue>
using namespace std;

int arr[30];

class floppy {
  private:
    int p[30];
  public:
    floppy(int a) {
      int i;
      for(i = 0; i < 30; ++i) p[i] = arr[i];
    }
    floppy(){}
    void swp(int a, int b) {
      int t;
      t = p[a], p[a] = p[b], p[b] = t;
    }
    void t1() {
      swp(9, 20), swp(0, 23), swp(3, 26), swp(6, 29), swp(15, 17);
    }
    void t2() {
      swp(11, 18), swp(2, 21), swp(5, 24), swp(8, 27), swp(12, 14);
    }
    void t3() {
      swp(12, 17), swp(6, 21), swp(7, 22), swp(8, 23), swp(9, 11);
    }
    void t4() {
      swp(14, 15), swp(0, 27), swp(1, 28), swp(2, 29), swp(18, 20);
    }
    bool same() {
      bool s = true;
      int i;
      for(i = 1; i < 9; ++i) if(p[i] != p[0]) s = false;
      for(i = 10; i < 12; ++i) if(p[i] != p[9]) s = false;
      for(i = 13; i < 15; ++i) if(p[i] != p[12]) s = false;
      for(i = 16; i < 18; ++i) if(p[i] != p[15]) s = false;
      for(i = 19; i < 21; ++i) if(p[i] != p[18]) s = false;
      for(i = 22; i < 30; ++i) if(p[i] != p[21]) s = false;
      return s;
    }
    bool print() {
      int i;
      for(i = 0; i < 30; ++i) printf("%d ", p[i]);
      printf("\n");
    }
};

int main(void) {
  int n, i, j, k;
  scanf("%d", &n);
  for(i = 0; i < n; ++i) {
    queue<floppy> q;
    for(j = 0; j < 30; ++j) scanf("%d", &arr[j]);
    floppy f(0);
    if(f.same()) {
      printf("0\n");
      continue;
    }
    q.push(f);
    for(j = 1; j < 10; ++j) {
      bool s = false;
      queue<floppy> q2;
      while(!q.empty()) {
        floppy tmp, tmp2;
        tmp = q.front(), q.pop();
        tmp2 = tmp, tmp2.t1();
        if(tmp2.same()) {
          s = true;
          break;
        } else q2.push(tmp2);
        tmp2 = tmp, tmp2.t2();
        if(tmp2.same()) {
          s = true;
          break;
        } else q2.push(tmp2);
        tmp2 = tmp, tmp2.t3();
        if(tmp2.same()) {
          s = true;
          break;
        } else q2.push(tmp2);
        tmp2 = tmp, tmp2.t4();
        if(tmp2.same()) {
          s = true;
          break;
        } else q2.push(tmp2);
      }
      if(s) {
        printf("%d\n", j);
        break;
      }
      while(!q2.empty()) q.push(q2.front()), q2.pop();
    }
  }
  return 0;
}


Measured memory_bytes: 5004
# coding=utf-8


def vector_minus(v1, v2):
    return [elm1 - elm2 for elm1, elm2 in zip(v1, v2)]


def scalar_multi(scalar, vector):
    return [scalar*elm for elm in vector]


def gcd(n1, n2):
    if n1 < n2:
        n1, n2 = n2, n1

    if n1 == n2 or n2 == 0:
        return n1
    n1, n2 = n2, (n1 % n2)
    return gcd(n1, n2)


def solve_int(number1, number2):
    """
    answer1 = 1
    while True:
        if (1+number1*answer1) % number2 == 0:
            return -answer1, (1+number1*answer1)//number2
        answer1 += 1
    """
    if number1 < number2:
        if number1 == 1:
            return 1, 0
        reverse_flag = 1
        n1, n2 = number2, number1
    else:
        if number2 == 1:
            return 0, 1
        reverse_flag = 0
        n1, n2 = number1, number2

    quotient1 = []
    coeff1 = [1, 0]
    quotient2 = []
    coeff2 = [0, 1]

    while True:
        quotient1.append(n1//n2)
        coeff1 = vector_minus(coeff1, scalar_multi(n1//n2, coeff2))
        if n1 % n2 == 1:
            if reverse_flag:
                return coeff1[1], coeff1[0]
            else:
                return coeff1[0], coeff1[1]

        r_memo = n1 % n2
        quotient2.append(n2//r_memo)
        coeff2 = vector_minus(coeff2, scalar_multi(n2//r_memo, coeff1))
        if n2 % r_memo == 1:
            if reverse_flag:
                return coeff2[1], coeff2[0]
            else:
                return coeff2[0], coeff2[1]

        n1, n2 = n1 % n2, n2 % r_memo


def modify_solution(x_sp_s, y_sp_s, n1, n2):
    x_memo, y_memo = x_sp_s, y_sp_s
    if abs(x_sp_s + n2) + abs(y_sp_s - n1) < (abs(x_memo) + abs(y_memo)):
        m = y_sp_s//n1
        if m == 0:
            return x_sp_s+n2, y_sp_s-n1
        return modify_solution(x_sp_s + m*n2, y_sp_s - m*n1, n1, n2)
    if abs(x_sp_s + n2) + abs(y_sp_s - n1) == (abs(x_memo) + abs(y_memo)):
        pass
    return x_memo, y_memo


if __name__ == '__main__':
    a, b = map(int, input().split())
    right_side = gcd(a, b)
    if right_side > 1:
        a //= right_side
        b //= right_side

    x_sp, y_sp = solve_int(a, b)
    if x_sp > y_sp:
        m2 = x_sp//b
        x_sp -= (m2+1)*b
        y_sp += (m2+1)*a
    x_sp, y_sp = modify_solution(x_sp, y_sp, a, b)
    print(x_sp, y_sp)



Measured memory_bytes: 5632
import java.util.*;
import java.io.*;
 
public class Main{
    public static void main(String[] args){
        Main m = new Main();
        m.input();

    }
    public void input(){
        Scanner sc = new Scanner(System.in);
        int c = sc.nextInt();
        int u = sc.nextInt();
        int x = sc.nextInt();
        
        if(x > c + u || x < c){
             System.out.println("NO");
        }else{
             System.out.println("YES");
        }
        
        sc.close();
    }


}

Measured memory_bytes: 23636
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
typedef long long ll;
int main() {
  int n; cin>>n;
  vector<int> a(n);
  bool ans=true;
  
  rep(i, n) {
    cin>>a.at(i);
    int b=a.at(i);
    if(b%2==0){
      if(b%3!=0&&b%5!=0) ans=false;
    }
  }
  
  if(ans==true) cout << "APPROVED";
  else cout << "DENIED";
  
}

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

namespace ConsolePractice
{
    class Program
    {
        static void Main(string[] args)
        {                        
            string[] str1 = Console.ReadLine().Split(' ');
            int N = int.Parse(str1[0]);
            string[] str2 = Console.ReadLine().Split(' ');
            int T = int.Parse(str2[0]);
            int A = int.Parse(str2[1]);
            string[] str3 = Console.ReadLine().Split(' ');
            int[] H = new int[N];
            for(int i = 0; i < N; i++)
            {
                H[i] = int.Parse(str3[i]);
            }
            double[] temperature = new double[N];
            double min = int.MaxValue;
            double point = 0;
            for(int i = 0; i < N; i++)
            {
                temperature[i] = T - H[i] * 0.006;
                if (min > Math.Abs(temperature[i] - A))
                {
                    min = Math.Abs(temperature[i] - A);
                    point = i+1;
                }
            }


            Console.Write(point.ToString());
           
        }
    }
}


Measured memory_bytes: 11164
import Foundation

func readInts() -> [Int] {
    readLine()!.split(separator: " ").map { Int($0)! }
}

func main() {
    let ab = readInts()
    let (a,b) = (ab[0],ab[1])
    var cost = a * 10
    
    for _ in cost...10000 {
        if cost * 8 / 100 == a && cost * 10 / 100 == b {
            print(cost)
            return
        }
        cost += 1
    }
    print(-1)
}
main()


Measured memory_bytes: 13596
#include<stdio.h>

int main(){
  int a, b;
  while(scanf("%d %d", &a, &b) != EOF){
    int i=0;
    int c=a+b;
    while(c != 0){
      i++;
      c = c / 10;
    }
    printf("%d\n", i);
  }
  return 0;
}

Measured memory_bytes: 2664
#include<bits/stdc++.h>
 
using namespace std;
 
int main(){
  int n;
  cin>>n;
  while(n!=0){
    if(n%10==7){
      cout<<"Yes"<<endl;
      return 0;
    }
    n/=10;
  }
  cout<<"No"<<endl;
  return 0;
}

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

int main() {
	int N, M, C[20], DP[50010] = {}, INF = INT_MAX / 2;
	cin >> N >> M;
	for (int i = 0; i < M; i++) cin >> C[i];
	for (int i = 0; i <= N; i++) DP[i] = INF;
	DP[0] = 0;
	for (int i = 0; i <= N; i++) {
		for (int j = 0; j < M; j++) {
			if (i >= C[j]) DP[i] = min(DP[i], DP[i - C[j]] + 1);
		}
	}
	cout << DP[N] << endl;
}


Measured memory_bytes: 3292
#include <stdio.h>
#include <stdlib.h>


#define	ll_int	long long int


ll_int *WORK;

void Rotate(ll_int *box, int n, int b, int m, int e)
{
	int i;

	for(i = 0; i < e - b; i++)
		box[b + ((i + (e - m)) % (e - b))] = WORK[b + i];
}


void Print_box(ll_int *box, int n)
{
	int i;

	for(i = 0; i < n; i++){
		printf("%lld", box[i]);
		if(i != n - 1)
			printf(" ");
	}
	printf("\n");
}


int main()
{
	int n, q;
	int b, m, e;
	ll_int *box;
	int i, j;


	scanf("%d", &n);

	box = (ll_int *)malloc(sizeof(ll_int) * n);
	WORK = (ll_int *)malloc(sizeof(ll_int) * n);

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

	scanf("%d", &q);

	for(i = 0; i < q; i++){
		for(j = 0; j < n; j++)
			WORK[j] = box[j];

		scanf("%d %d %d", &b, &m ,&e);

		Rotate(box, n, b, m, e);
	}


	Print_box(box, n);

	return 0;
}


Measured memory_bytes: 2112
n = int(input())
s = input()

max_cnt = 0
for i in range(1, n - 1):
    left = s[:i]
    right = s[i:]
    cnt = 0
    found = set()
    for c in left:
        if c not in found and right.find(c) != -1:
            cnt += 1
            found.add(c)
    max_cnt = max(max_cnt, cnt)

print(max_cnt)


Measured memory_bytes: 3060
//url:
//problem name:

#include <bits/stdc++.h>
#define REP(i,n) for (int i = 0; i < (n); ++i)
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;}
using namespace std;
using ll = long long;
using P = pair<int,int>;
using Pl = pair<long,long>;
using veci = vector<int>;
using vecl = vector<long>;
using vecveci = vector<vector<int>>;
using vecvecl = vector<vector<long,long>>;

int main() {
    string S; cin >> S;
    map<char,int> res;
    for(auto c:S) {
        if(res.count(c)) {
            cout << "no" << endl;
            return 0;
        } else res[c] = 1;
    }
    cout << "yes" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <algorithm>
#include <functional>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
#define DEBUG
#define PI 3.141592653589793238462643383279
 
#define _GLIBCXX_DEBUG
#ifdef DEBUG
#define s(...) show(__VA_ARGS__);
#define sl(...) show(__VA_ARGS__);cout<<endl;
#else
#define s(...)
#define sl(...)
#endif
void show() {}
template <class Head,class... Args>void show(Head t,Args... args){std::cout<<t<<" ";show(args...);}
#define REP(i, n) for(ll i = 0; i < n; i++)
#define REPR(i, n) for(ll i = n; i >= 0; i--)
#define FOR(i, m, n) for(ll i = m; i < n; i++)
#define REP1(i, n) for(ll i = 1; i <= n; i++)
#define REPR1(i, n) for(ll i = n; i >= 1; i--)
#define FOR1(i, m, n) for(ll i = m; i <= n; i++)
const ll INF = LLONG_MAX;
#define VEC(type,A,N) vector<type> A(N)
#define VECi(type,A,N,i) vector<type> A(N,i)
#define VEC2(type,A,N,M) vector<vector<type>> A(N,vector<type>(M))
#define VEC2i(type,A,N,M,i) vector<vector<type>> A(N,vector<type>(M,i))
#define ALL(v) v.begin(), v.end()
ll frac(ll k){
    int s = 1;
    for (ll i=1; i<=k; ++i)s *= i;
    return s;
}
ll gcd(ll a, ll b){
   if (a%b==0)return(b);
   else return(gcd(b, a%b));
}
ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}
ll antidiv(ll N,ll C,ll D){
    return N-floor(N/C)-floor(N/D)+floor(N/lcm(C,D));
}
vector<ll> yakusuu(ll N){
    vector<ll> ret;
    for (ll i = 1; i * i <= N; i++) {
        if (N % i == 0) {
            ret.push_back(i);
            if (i * i != N) ret.push_back(N / i);
        }
    }
    sort(ret.begin(), ret.end());
    return ret;
}
int main(){
    ll N,cnt=0,cnt2=0;
    cin>>N;
    REP(i,N){
        ll t;
        cin>>t;
        if(t%4==0)cnt++;
        else if(t%2==0)cnt2++;
    }
    if((N-cnt2)==1)cout<<(cnt==1?"Yes":"No");
    else cout<<(cnt*2+(N%2)>=(cnt2>=2?(N-cnt2):N)?"Yes":"No");
    //ll t=N*M;
    //cout<<fixed<<setprecision(20)<<N*M<<endl;
    //cout<<fixed<<setprecision(0)<<floor(t);
    //N-=F;
    //cout<<N/(M+F);
    //cout<<fixed<<setprecision(32)<<m;
    //sort(ALL(C),[](auto& a, auto& b) {return a[2] < b[2];});
    //if(equal(D.begin(), D.end()-1, K.begin()))cout<<"Yes";else cout<<"No";
    cout<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,b,a) for(int i=b;i>=a;i--)
#define fori(a) for(auto i : a )
#define all(a) begin(a), end(a)
#define set(a,b) memset(a,b,sizeof(a))
#define sz(a) a.size()
double pi=acos(-1);
#define ll long long
#define ull unsigned long long
#define pb push_back
#define PF push_front //deque
// #define mp make_pair
#define pq priority_queue
const ll mod=1000000007;
#define f first
#define s second
#define pii pair< ll, ll >
#define vi vector<int>
#define vpii vector<pii>
#define debug(v) for(auto i:v) cout<<i<<" ";
#define tc int t; cin >> t; while(t--)

using namespace boost::multiprecision;
using namespace std;
void optimizeIO(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}


const int N=1000005;
ll fact[N],invfact[N];
ll power(ll x,ll y){
  if(y<=0) return 1LL;
  ll z=power(x,y/2);
  if(y%2) return (((z*z)%mod)*x)%mod;
  return (z*z)%mod;
}

void pre(){
  fact[0]=invfact[0]=invfact[1]=fact[1]=1;
  rep(i,2,N) fact[i]=(i*fact[i-1])%mod;
  rep(i,2,N) invfact[i]=(invfact[i-1]*power(i,mod-2))%mod;
}
ll nCr(ll n,ll k){ return (((fact[n]*invfact[n-k])%mod)*invfact[k])%mod; }



const int N1=1e6+1;
vector<int> isprime(N1,1),prime;
void seive(){
  rep(i,2,sqrt(N1)+1){
      if(isprime[i]){
        for(int j=i*i;j<N1;j+=i) isprime[j]=0;
        prime.pb(i);
      }
  }
  rep(i,sqrt(N1)+1,N1) if(isprime[i]) prime.pb(i);
}



struct dsu {
    vector<int> par, rank;
    dsu(int n): par(n+1), rank(n+1) {
        for (int i = 0; i <= n; i++) {
            par[i] = i;
            rank[i]= 1;
        }
    }
    int root(int a) {
        if (a == par[a]) return a;
        return par[a] = root(par[a]);
    }
    void merge(int a, int b) {
        a = root(a);
        b = root(b);
        if (a == b) return;
        if (rank[a] > rank[b]) swap(a, b);
        par[b] = a;
    }
    set<int> parent(int n){
        set<int> s;
        for(int i=1;i<=n;i++){
            s.insert(root(i));
        }
        return s;
    }
};

void solve(){
  int a[3][3];
  string ans="";
  rep(i,0,3){
    string s;
    cin>>s;
    ans+=s[i];
  }
  cout<<ans<<endl;
}

int main(){
    optimizeIO();
    int r=1;
    {solve();}
}


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

int main() {
string S;
  cin>>S;
  bool a=true;
  for(int i=0;i<S.size();i++){
    if(i%2==0){
      if(S.at(i)=='L'){
a=false;
        goto l;
      }
    }
    if(i%2!=0){
      if(S.at(i)=='R'){
 a=false;
        goto l;
      }
    }
  }
 l:if(a==true){
  cout<<"Yes"<<endl;
 }
  else if(a==false){
    cout<<"No"<<endl;
  }

}

Measured memory_bytes: 256
//https://atcoder.jp/contests/ddcc2020-qual/tasks/ddcc2020_qual_a
#include <bits/stdc++.h>
#if LOCAL
#include "dump.hpp"
#else
#define dump(...)
#endif
using namespace std;
using ll=long long;
#define FOR(i,a,b) for(ll i=(a);i<(b);++i)
#define REP(i,n) FOR(i,0,n)
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 main() {
#if LOCAL&01
    std::ifstream in("./test/sample-1.in"); //input.txt
    std::cin.rdbuf(in.rdbuf());
#else
    cin.tie(0);
    ios::sync_with_stdio(false);
#endif
    ll X, Y;cin>>X>>Y;
    vector<ll> tbl={
        0,300000,200000,100000,
    };
    ll ans=0;
    ans+=X<tbl.size()?tbl.at(X):0;
    ans+=Y<tbl.size()?tbl.at(Y):0;
    if (X==1&&Y==1) ans+=400000;

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-8;
const ll mod=1e9+7;
const int dx[4]={-1,0,1,0},dy[4]={0,-1,0,1};

const int M=201;
ll C[M][M];
int n;
vvi g;
vvl dp;

void dfs(int v){
	dp[v]=vl(1,1);
	for(auto u:g[v]){
		dfs(u);
		int s1=dp[v].size(),s2=dp[u].size();
		vl DP(s1+s2-1);
		for(int i=0;i<s1;i++) for(int j=0;j<s2;j++) if(dp[v][i]&&dp[u][j]){
			for(int k=max(i,j);k<=i+j;k++){
				(DP[k]+=dp[v][i]*dp[u][j]%mod*C[i][i+j-k]%mod*C[k][i])%=mod;
			}
		}
		dp[v]=DP;
	}
	dp[v].push_back(0);
	int sz=dp[v].size();
	for(int i=sz-1;i>0;i--) dp[v][i]=dp[v][i-1];
	dp[v][0]=0;
}

int main(){
	C[0][0]++;
	for(int i=0;i<M-1;i++) for(int j=0;j<=i;j++){
		(C[i+1][j]+=C[i][j])%=mod;
		(C[i+1][j+1]+=C[i][j])%=mod;
	}
	cin>>n;
	g=vvi(n);
	dp=vvl(n);
	vi d(n);
	for(int i=1;i<n;i++){
		int u,v;
		cin>>u>>v;
		g[u].push_back(v);
		d[v]++;
	}
	for(int i=0;i<n;i++) if(!d[i]){
		dfs(i);
		ll res=0;
		for(auto j:dp[i]) (res+=j)%=mod;
		cout<<res<<endl;
	}
}


Measured memory_bytes: 3508
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <numeric>

using namespace std;

using ll = long long;

#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define REPD(i,n) for(ll i=n-1;i>=0;i--)
#define FOR(i,a,b) for(ll i=a;i<=(ll)(b);i++)
#define FORD(i,a,b) for(ll i=a;i>=(ll)(b);i--)

#define input(...) __VA_ARGS__; in(__VA_ARGS__)

#if __has_include("debugger.cpp")
  #include "debugger.cpp"
#else
void print() {
  std::cout << std::endl;
}

template <class Head, class... Tail>
void print(Head&& head, Tail&&... tail) {
  cout << head;
  if (sizeof...(tail) > 0) cout << " ";
  print(std::forward<Tail>(tail)...);
}
# endif

void in() { }

template <class Head, class... Tail>
void in(Head&& head, Tail&&... tail) {
  cin >> head;
  in(std::forward<Tail>(tail)...);
}

int main() {
  ll input(a, b, c);
  ll input(k);

  while (a >= b) {
    b *= 2;
    k--;
  }
  while (b >= c) {
    c *= 2;
    k--;
  }
  print(k >= 0 ? "Yes" : "No");
}


Measured memory_bytes: 3620
#!/usr/bin/env python3
import sys


def solve(N: int, H: "List[int]"):
    longest = 0
    current = 0
    for i in range(N-1):
        if H[i] >= H[i+1]:
            current += 1
        else:
            if current > longest:
                longest = current
            current = 0
    if current > longest:
        longest = current
    print(longest)
    return


# Generated by 1.1.5 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    H = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, H)

if __name__ == '__main__':
    main()


Measured memory_bytes: 15876
#include <iostream>

using namespace std;

int main() {
    int m, f, r;
    while (true) {
        cin >> m >> f >> r;
        if (m == -1 && f == -1 && r == -1) break;
        if (m == -1 || f == -1) {
            cout << "F" << endl;
            continue;
        }
        if (m + f >= 80) {
            cout << "A" << endl;
            continue;
        }
        if (m + f >= 65) {
            cout << "B" << endl;
            continue;
        }
        if (m + f >= 50) {
            cout << "C" << endl;
            continue;
        }
        if (m + f >= 30) {
            if (r >= 50) {
                cout << "C" << endl;
                continue;
            }
            cout << "D" << endl;
            continue;
        }
        cout << "F" << endl;
    }
    return 0;
}


Measured memory_bytes: 3092
#include <iostream>
#include <fstream>
#include <typeinfo>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <string>
#include <algorithm>
#include <cstdio>
#include <queue>
#include <iomanip>
#include <cctype>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<char> vc;
typedef vector<vc> vvc;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<25;
const double pi=acos(-1);
const double eps=1e-8;
const vi emp;

int n;
vi a(6);

int main(){
	cin>>n;
	double t;
	for(int i=0;i<n;i++){
		cin>>t;
		if(t<165) a[0]++;
		else if(t<170) a[1]++;
		else if(t<175) a[2]++;
		else if(t<180) a[3]++;
		else if(t<185) a[4]++;
		else a[5]++;
	}
	for(int i=0;i<6;i++){
		cout<<i+1<<':';
		for(int j=0;j<a[i];j++) cout<<'*';
		cout<<endl;
	}
}

Measured memory_bytes: 1232
n = gets.to_i
a = gets.split.map(&:to_i)
cnt = n
n.times do |e|
  if a[e]%2 == 0
    if a[e]%3 != 0 && a[e]%5 != 0
      cnt += 1
    end
  end
end
puts n == cnt ? "APPROVED":"DENIED"


Measured memory_bytes: 1788
#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 k, a, b;
  cin >> k >> a >> b;
  string ans = "NG";

  for (int i = a; i <= b; i++) {
    if (i%k == 0) {
      ans = "OK";
      break;
    }
  }

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


Measured memory_bytes: 3624
#include<bits/stdc++.h>
#define rep(i, n) for (long long i = 0; i < (int)(n); i++)
#define sum(a) accumulate(a.begin(),a.end(),0LL)
#define put(i) cout<<fixed<<i<<endl
using namespace std;
using ll = long long;

ll mod = 1e9+7;
vector<ll> cnt(1e3+1,0);

void disassenmble(ll n){
   for(long long i = 2; i * i <= n; i++){
       if(n % i != 0){ continue; }
       ll ex = 0;
       while(n % i == 0){
           ex++;
           n /= i;
       }
       cnt[i] += ex;
   }
   if(n != 1) ++cnt[n];
}

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

    ll ans = 1;
    for(long long i = 1; i <= n; i++) disassenmble(i);
    for(long long i = 2; i <= n; i++){
        if(cnt[i]) ans = (ans * (cnt[i] + 1)) % mod;
    }
    //for(long long i = 0; i <= n; i++){ cout << cnt[i] << " ";} cout << endl;
    put(ans);
}

Measured memory_bytes: 3648
/*Made by Shivam Solanki*/
#include<bits/stdc++.h>
using namespace std;
#define DEBUG(x) cout << '>' << #x << ':' << x << endl;
#define ll long long int
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vll> vvl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef vector<pii> vp;
typedef vector<pll> vpll;
typedef map<int,int> mii;
typedef map<ll,ll> mll;
typedef set<int> sii;
typedef set<ll> sll;
typedef priority_queue<int> pq;
typedef unordered_map<int,int> umii;
typedef unordered_map<ll,ll> umll;
#define rep(i,k,n) for (int i = k; i < n; ++i) 
#define repr(i,k,n) for (int i = n; i>=k; --i)
#define REP(i,k,n) for (int i = k; i <= n; ++i) 
#define REPR(i,k,n) for (int i = k; i >= n; --i)
#define repll(i,k,n) for (ll i = k; i < n; ++i) 
#define pb push_back
#define mp make_pair
#define gcd __gcd
#define F first
#define S second
#define fastio ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
const int INF = 1e9+5;
const int MOD = 1e9+7;

void solve(){
    int r;
    cin>>r;
    cout<<r*r;
}
    
int main(){
    // #ifndef ONLINE_JUDGE  
        // freopen("input.txt", "r", stdin); 
        // freopen("output.txt", "w", stdout); 
    // #endif 
    // fastio;
    int t=1;
        // cin>>t;
    while(t--)
        solve();
    return 0;
}

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

typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
static const double EPS = 1e-12;
static const double PI = acos(-1.0);

template <class T>
using V = vector<T>;
template <class T>
using VV = V<V<T>>;

#define FOR(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(a) (a).begin(), (a).end()
#ifdef LOCAL
#define dbg(x) cerr << __LINE__ << " : " << #x << " = " << (x) << endl
#else
#define dbg(x) true
#endif

void solve(long long N, long long D, std::vector<long long> X, std::vector<long long> Y) {
  ll ans = 0;
  REP(i, N) {
    if (X[i] * X[i] + Y[i] * Y[i] <= D * D) {
      ans++;
    }
  }
  cout << ans << endl;
}

int main() {
  long long N;
  scanf("%lld", &N);
  long long D;
  scanf("%lld", &D);
  std::vector<long long> X(N);
  std::vector<long long> Y(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &X[i]);
    scanf("%lld", &Y[i]);
  }
  solve(N, D, std::move(X), std::move(Y));
  return 0;
}


Measured memory_bytes: 6448
def is_p(n)
  n = n.to_s
  n[0] == n[4] && n[1] == n[3]
end
  

a, b = gets.split.map{|i|i.to_i}
ans = 0

a.upto(b) do |i|
  if is_p(i)
    ans+=1
  end
end

puts ans

Measured memory_bytes: 1788
#include "math.h"
#include<stdio.h>
#include<map>
#include<string>
#include<iostream>
#include<vector>

using namespace std;

int main(void){
    int N,K;
    string S;

    cin >> N >> K;
    cin >> S;

    S[K-1] = S[K-1]+32;
    
    cout<<S<<endl;
    return 0;

}



Measured memory_bytes: 256
class UnionFindTree:
    def __init__(self, size):
        self.parent = list(range(size))
        self.dist = [0] * size
 
    def find_root(self, x):
        if self.parent[x] == x:
            return x, 0
        else:
            self.parent[x], d = self.find_root(self.parent[x])
            self.dist[x] += d
            return self.parent[x], self.dist[x]
 
    def union(self, x, y, d):
        r1, d1 = self.find_root(x)
        r2, d2 = self.find_root(y)
        if r1 != r2:
            self.parent[r2] = r1
            self.dist[r2] = (d1 - d2) + d
        else:
            if (d2 - d1) != d:
                return False
        return True
import sys
import math
stdin = sys.stdin
 
ni = lambda: int(ns())
na = lambda: list(map(int, input().split()))
ns = lambda: input()

def main():
    N,M = na()
    tree = UnionFindTree(N+1)
    for i in range(M):
        l,r,d = na()
        if(not tree.union(l,r,d)):
            print("No")
            return
        
    print("Yes")

main()

Measured memory_bytes: 9844
import itertools

n = int(input())
p = [int(x) for x in input().split()]
q = [int(x) for x in input().split()]
p = tuple(p)
q = tuple(q)

m = [x for x in range(1, n+1)]
all = list(itertools.permutations(m))
a = all.index(p)
b = all.index(q)
print(abs(a - b))


Measured memory_bytes: 8052
#include <iostream>
#include <vector>
#define rep(i,n) for(int i= 0; i<n;i++)
#define loop(i,f,n) for(int i = f; i<n; i++)
#define MAX 1000000
using namespace std;

int main(){
	
	int n,num = 0;
	vector<int>stac(MAX,0);
	cin >> n;
	int tuki = 0;
	int r;
	int cc = 0;
	bool checking = true;
	rep(i,n)
	{
		int temp;
		char s;
		cin >> s >> temp;
		num +=temp;
		if(s == '(')
		{	
			tuki+= temp;
			cc+= temp;
		}
		else if(s == ')')
		{
			tuki -= temp;
			cc-= temp;
		}
		if(cc < 0)
		  checking = false;
	}
//		cout << checking << endl;
		/*?\???°?????¨??????????????¶s?????????*/
		if(cc <0 || checking == false)
		{	
			cout << "NO" << endl;
			return 0;
		}		
		if(num % 2)
		{
			cout << "NO" << endl;
			return 0;
		}

		if(tuki == 0)
		{
			cout << "YES" << endl;
			return 0;
		}
		else 
			cout << "NO"<< endl;
		return 0;


	}

Measured memory_bytes: 6616
#include<bits/stdc++.h>
using namespace std;
int i[11111111];
int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int a,b,c,d=0;
  string s;
  cin >>a;
  if(a%2!=0) cout <<a*2<<'\n';
  else cout <<a<<'\n';
  return (0);
}


Measured memory_bytes: 256
import copy
import numpy as np

S = input()

N = int(S)

S = input()

P = list(map(int, S.split()))

check = []

count = 0

for i in range(0, N-2, 1):

    check = P[i:i+3]
    check = np.array(check)
    check = check.argsort()
    if check[1] == 1:
        count = count + 1

print(count)


Measured memory_bytes: 12508
import collections
N=int(input())
A=list(map(int,input().split()))
A=sorted(A)
c=collections.Counter(A)
if __name__=="__main__":
    if 1 in A:
        if c[1]==1:
            print(1)
        else:
            print(0)
    else:
        A=[]
        dp=[True for _ in range(10**6+10)]
        for key,value in c.items():
            if value==1:
                A.append(key)
            else:
                if dp[key]:
                    i=2
                    while i*key<=10**6:
                        dp[i*key]=False
                        i+=1 
        if len(A)==0:
            print(0)
        else:
            for a in A:
                if dp[a]:
                    i=2
                    while i*a<=10**6:
                        dp[i*a]=False
                        i+=1 
            ans=0
            for a in A:
                if dp[a]:
                    ans+=1
            print(ans)



Measured memory_bytes: 41220
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdint.h>
#include <math.h>
#include <time.h>

typedef int32_t i32;
typedef int64_t i64;
typedef double f64;

void *const null=(void *)0;
i64 const llinf=4611686018427387903LL;
i64 const mod=1000000009LL;
f64 const pi=3.141592653589793;
f64 const rad=57.295779513082323;

#define CODE_

i32 main(void){
    char *s=(char *)calloc(10001LL,sizeof(char));
    i64 n,joi,ioi;
    while(scanf("%s%*c",s)!=EOF){
        n=strlen(s)-2LL;
        joi=0LL;
        ioi=0LL;
        for(i64 i=0LL;i<n;++i){
            if(s[i]=='J'&&s[i+1LL]=='O'&&s[i+2LL]=='I') ++joi;
            else if(s[i]=='I'&&s[i+1LL]=='O'&&s[i+2LL]=='I') ++ioi;
        }
        printf("%lli\n%lli\n",joi,ioi);
    }
    return 0;
}



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

int main(){
  int a,b,c,d,e,f;
  cin>>a;
  cin>>b;
  
  c=a+b;
  d=a-b;
  e=a*b;
  f=c;
  if(f<d){
    f=d;
  }
  if(f<e){
    f=e;
  }
  cout<<f<<endl;
  
  return 0;
}

  

Measured memory_bytes: 256
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#define GRAPH_MATRIX_SIZE 100

typedef struct {
  uint32_t index;
  size_t len;
  uint32_t array[GRAPH_MATRIX_SIZE];
} graph_vertex_t;

bool graph_converts_to_matrix(graph_vertex_t vertexes[], size_t len, uint32_t matrix[][100])
{
  if ((vertexes == NULL) || (len == 0)) return false;
  uint32_t i, j;
  for (i = 0; i < len; i++) {
    for (j = 0; j < len; j++) {
      matrix[i][j] = 0;
    }
  }

  uint32_t n, m;
  for (n = 0; n < len; n++) {
    graph_vertex_t v = vertexes[n];
    for (m = 0; m < v.len; m++) {
      matrix[v.index - 1][v.array[m] - 1] = 1;
    }
  }

  return true;
}

#if !defined(TEST)
#include <stdio.h>
static graph_vertex_t vertexes[GRAPH_MATRIX_SIZE];
int32_t main(void)
{
  int32_t num;
  scanf("%d", &num);
  uint32_t i;
  for (i = 0; i < num; i++) {
    graph_vertex_t *v = &vertexes[i];

    scanf("%d", &v->index);
    scanf("%lu", &v->len);
    uint32_t j;
    for (j = 0; j < v->len; j++) {
      scanf("%d", &v->array[j]);
    }
  }

  uint32_t matrix[GRAPH_MATRIX_SIZE][GRAPH_MATRIX_SIZE];
  graph_converts_to_matrix(vertexes, num, matrix);
  for (i = 0; i < num; i++) {
    uint32_t j;
    for (j = 0; j < num; j++) {
      if (j != 0) printf(" ");
      printf("%d", matrix[i][j]);
    }
    printf("\n");
  }

  return 0;
}
#endif

Measured memory_bytes: 680