akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <boost/range/algorithm.hpp>
#include <boost/range/numeric.hpp>
#include <boost/integer/common_factor.hpp>
#include <boost/integer/common_factor_rt.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>

using std::string;
using std::vector;
using std::set;
using std::multiset;
using std::unordered_set;
using std::map;
using std::multimap;
using std::unordered_map;
using std::pair;
using std::cin;
using std::cout;

using boost::multiprecision::cpp_int;
using cpp_dec_float_1000 = boost::multiprecision::number<boost::multiprecision::cpp_dec_float<1000, boost::int128_type>>;

typedef uintmax_t    ull;
typedef intmax_t     ll;
typedef uint64_t     ul;
typedef uint32_t     ui;
typedef uint8_t      uc;

constexpr char CRLF  = '\n';
constexpr char SPACE = ' ';
constexpr char VECTOR_COUT_SEPARATOR = SPACE;
constexpr ll INF = 1000'000'007;
constexpr int MOD = 1000'000'007;

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; }
template<class T> std::ostream& operator<< (std::ostream& os, const std::vector<T>& vc) { for(auto it = vc.begin(); it != vc.end(); ++it) { if (std::next(it) == vc.end()) os << *it; else os << *it << VECTOR_COUT_SEPARATOR; } return os; }
template<class T1, class T2> inline std::ostream & operator<< (std::ostream & os, const std::pair<T1, T2> & p) { return os << p.first << ' ' << p.second; }
template<class T> T modinv(T a, T m) { T b = m, u = 1, v = 0; while (b) { T t = a / b; a -= t * b; boost::swap(a, b); u -= t * v; boost::swap(u, v); } u %= m; if (u < 0) u += m; return u; }
template<class T> inline bool isSosuu(const T& n) { if (n == T(1)) { return false; } for (T i = 2; i*i <= n; ++i) { if (n % i == 0) { return false; } } return true; }
template<class T> vector<vector<T>> split (const vector<T>& S, T delim) { vector<vector<T>> ret{}; vector<T> buff{}; for (auto c : S) { if (c == delim) { if (!buff.empty()) ret.push_back(buff); buff.clear(); } else { buff.push_back(c); } } if (!buff.empty()) ret.push_back(buff); return ret; }
template<class T> inline void printYesNo(const T& t) { cout << (t ? "Yes" : "No") << CRLF; }
template<class T = int64_t> T modpow(T N, T P, T M) { T ret{1}; N %= M; while (P) { if (P & 0x01) { ret *= N; ret %= M; } P >>= 1; N *= N; N %= M; } return ret; }

/** code for assert debug begin */
int gErr = 0;
#define ASSERT(p) if(!(p)){ gErr = 1; }else{ ; }
/** code for assert debug end */

struct Tmp
{
public:
  int N;
  Tmp(int N)
  : N(N)
  {}
};

void solve(void)
{
  int N; cin >> N;
  vector<int> T(N);
  for (auto& t : T) { cin >> t; }
  auto sum = boost::accumulate(T, 0);
  
  int M; cin >> M;
  for (int _ = 0; _ < M; ++_) {
    int i; cin >> i;
    --i;
    int x; cin >> x;
    auto diff = T[i] - x;
    auto res = sum - diff;
    cout << res << CRLF;
  }

  return;
}

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

  solve();

  return 0;
}


Measured memory_bytes: 256
#define r return
#define a (int dx,int dy,int x,int y,char m,int c)
i,j,n,f[6];
w[8]={1,1,0,-1,-1,-1,0,1};
h[8]={0,1,1,1,0,-1,-1,-1};
char t[10][10],mark[2]={'o','x'};
 
int l a{
if(t[x][y]=='.'||t[x][y]=='0')r 0;if(t[x][y]==m)r c;r l(dx,dy,x+dx,y+dy,m,c+1);}
int s a{int k,d;d=0;if(t[x][y]!='.')r 0;for(k=0;k<8;k++)d+=l(w[k],h[k],x+w[k],y+h[k],m,0);r d;}
int p a{
  if(t[x][y]=='0'||t[x][y]=='.')r 0;if(t[x][y]==m)r 1;
  if(p(dx,dy,x+dx,y+dy,m,0)){t[x][y]=m;r 1;}
  else r 0;
}
int o a{int k;t[x][y]=m;for(k=0;k<8;k++)p(w[k],h[k],x+w[k],y+h[k],m,0);r 0;}
 
int main(){
  for(i=0;i<10;i++)t[0][i]=t[9][i]='0';
  for(i=1;i<9;i++){
    scanf("%s",&t[i][1]);
    t[i][0]='0';
    t[i][9]='0';
  }
  f[1]=-1;
  for(n=0;;n=(n+1)%2){
    f[n]=-1;
    for(i=n?8:1;n?i>-1:i<9;n?i--:i++){
      for(j=n?8:1;n?j>-1:j<9;n?j--:j++){
        if(f[n]<s(0,0,i,j,mark[n],0)){
          f[2+n]=i;
          f[4+n]=j;
          f[n]=s(0,0,i,j,mark[n],0);
        }
      }
    }
    if(f[n]!=0)o(0,0,f[2+n],f[4+n],mark[n],0);
    if(f[0]==0&&f[1]==0)break;
  }
  for(i=1;i<9;i++){
    for(j=1;j<9;j++){
      printf("%c",t[i][j]);
    }
    puts("");
  }
  r 0;
}

Measured memory_bytes: 524
#include <stdio.h>

int main(){
	
	int m,n,s;
	
	
	scanf("%d %d",&n,&m);
	
	if(m%n==0){
		
		printf("%d\n",m/n);
		
	}else{
		s=m/n;
		for(s;s>0;s--){
			if(m%s==0){
				printf("%d\n",s);
				break;
			}
		}
	}
	
	return 0;
}


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

int main() {
	int n, l;
	cin>>n>>l;
	int sum = (l+l+n-1)*n/2;
	int remove;
	if (l+n-1 <= 0)
		remove = l+n-1;
	else if (l >=0 )
		remove = l;
	else
		remove = 0;
	cout<<sum-remove<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <utility>
#include <stack>
#include <functional>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <numeric>

#define rep(i,j,k) for(int i=(int)j;i<(int)k;i++)
#define Sort(x) sort((x).begin(),(x).end())
#define all(x) (x).begin(),(x).end()
#define fi first
#define se second
#define vi vector<int>
#define INF (int)1e9
#define INFL 1e18
#define MOD 1000000007
#define pb push_back
#define MP make_pair
typedef long long int ll;
typedef std::pair<int,int> P;
int D=1;
int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

using namespace std;

int main(){
    int n;cin>>n;
    vector<vector<int>> v(n,vector<int>(n,INF));
    rep(i,0,n)v[i][i]=0;
    rep(i,0,n){
        int u,k; cin>>u>>k;
        rep(j,0,k){
            int to,cost;
            cin>>to>>cost;
            v[u][to]=cost;
        }
    }
    
    rep(i,0,n){
        rep(j,0,n){
            rep(k,0,n){
                v[j][k]=min(v[j][k],v[j][i]+v[i][k]);
            }
        }
    }
    rep(i,0,n){
        cout<<i<<" "<<v[0][i]<<endl;
    }
    
    return 0;
}



Measured memory_bytes: 3220
/*                        ______
 _______   /\     |``\   |        |  /
    |     /  \    |__/   |____    |/
    |    / _ _\   |  \   |        |\
    |   /      \  |   \  |______  |  \

            Dept. of CSE
        Comilla  University

*/
#include<bits/stdc++.h>
#define pi 2*acos(0.0)
#define ll long long
#define FIO ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define Node struct node
#define spc " "
#define  E  2.71828182845904523536
#define pb push_back
#define pp pop_back
#define valid(nx,ny) nx>=0 && nx<n && ny>=0 && ny<m
#define ee endl
#define pii pair<int,int>
#define infinity 10000000000000000
#define mod 1000000007
int fx[]={0,0,+1,-1};
int fy[]={+1,-1,0,0};

using namespace std;
///check n=1;
///check corner case;
const int maX=1e5+1;
vector<ll>Graph[maX],cost[maX];
ll visit[maX];


int main()
{
    ll n,i,j,cc=0,mn=100000000000LL;
    cin>>n;
    ll ara[n];
    for(i=0;i<n;i++)cin>>ara[i];
    sort(ara,ara+n);
    for(i=1;i<=100;i++){
        cc=0;
        for(j=0;j<n;j++){
            ll x=abs(i-ara[j]);
            cc+=x*x;
        }
        mn=min(cc,mn);
    }
    cout<<mn<<endl;
return 0;
}


Measured memory_bytes: 4992
import java.util.Scanner;
public class Main {
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        String str = scan.nextLine();
        //String[] num = str.split(" ",0);
        int s,a,b,c;
        /*
        a = Integer.valueOf(num[0]);
        b = Integer.valueOf(num[1]);
        */
        s = Integer.valueOf(str);
        a = s / 3600;
        s =s % 3600;
        b = s / 60;
        c = s % 60;
        System.out.println(a+":"+b+":"+c);
        scan.close();
    }
}


Measured memory_bytes: 26196
//naveen mall
#include<bits/stdc++.h>
using namespace std;
#define fast ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb               push_back
#define sz(c)            (int)c.size()
#define len(c)           (int)c.length()
#define vec              vector
#define int              long long int
#define all(c)           c.begin(), c.end()
#define rall(c)          c.rbegin(), c.rend()
#define trav(a,i)        for(auto i: a)
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define invect(v,n)       for(int i=0;i<n;i++ ){int arb;cin>>arb;v.pb(arb);}
#define inset(s,n)        fl(i,0,n){int aset;cin>>aset;s.insert(aset);}
#define display(c)        trav(c,i) cout<<i<<" ";cout<<"\n";
#define F                 first
#define S                 second
#define pii               pair<int,int>
#define PB                pop_back
#define endl              "\n"
#define what(x) cerr <<  #x << " is " << x << endl;
int sum() { return 0; }template<typename T,typename... Args>T sum(T a, Args... args) { return a + sum(args...); }

 #define pi 3.14159265
 
void solve()
{  
  int r;
  cin>>r;
   float ans=2*pi*r;
   cout<<fixed<<setprecision(6)<<ans;
 
}
signed main()
{fast
    int t;
 t=1;
  //cin>>t;
  while(t--)
     {
      solve();
     }
 
 
 
}

Measured memory_bytes: 3804
#include<cstdio>
#include<cstring>
#include<string>
#include<iostream>
#include<cmath>
#include<algorithm>
#include<queue>
#include<map>
#include<ctime>

using namespace std;

template <typename T>

inline T read()
{
	T x=0,f=1;char c=getchar();
	while(!isdigit(c))
	{if(c=='-') f=-f;c=getchar();}
	while(isdigit(c))
	{x=(x<<3)+(x<<1)+(c-48);c=getchar();}
	return x*f;
}

#define lint long long int
#define ulint unsigned lint

const int inf=1e9+1e7;
const int MAXN=2e6+1e1;
const int Mod=1e9+7;

lint fac[MAXN];
lint inv[MAXN];

int r1,c1,r2,c2;

lint Ans1,Ans2;

lint qpow(lint A,int B)
{

	lint res=1;

	while(B>0)
	{
		if(B&1) (res*=A)%=Mod;
		(A*=A)%=Mod;
		B>>=1;
	}

	return res;

}

lint C(int A,int B)
{

	return ( A<B ? 0 : (((fac[A]*inv[B])%Mod)*inv[A-B])%Mod );

}

int main(void)
{

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

	scanf("%d%d%d%d",&r1,&c1,&r2,&c2);

	int n=max(c1,c2)+r2+2;

	fac[0]=inv[0]=1;

	for(int i=1;i<=n;i++) fac[i]=(fac[i-1]*i)%Mod;

	inv[n]=qpow(fac[n],Mod-2);

	for(int i=n;i;i--) inv[i-1]=(inv[i]*i)%Mod;

	for(int i=r1;i<=r2;i++) (Ans1+=C(i+c2+1,i+1))%=Mod;

	for(int i=r1;i<=r2;i++) (Ans2+=C(i+c1,i+1))%=Mod;

	printf("%lld\n",(Ans1-Ans2+Mod)%Mod);

	return 0;

}


Measured memory_bytes: 31488
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.*;
 
public class Main {
 
    void solve() throws IOException {
        int sx = ni();
        int sy = ni();
        int tx = ni();
        int ty = ni();

        String ans = "";
        int cx = sx;
        int cy = sy;
        while(cx != tx){
            ans += "R";
            cx +=1;
        }
        while(cy!=ty){
            ans += "U";
            cy += 1;
        }
        while(cx!=sx){
            ans += "L";
            cx -=1;
        }
        while(cy!=sy){
            ans += "D";
            cy -=1;
        }
        ans += "L";
        cx--;
        while(cy!=ty+1){
            ans += "U";
            cy ++;
        }
        while(cx!=tx){
            ans += "R";
            cx++;
        }
        ans += "D";
        cy--;
        ans += "R";
        cx++;
        while(cy!=sy-1){
            ans += "D";
            cy--;
        }
        while(cx!=sx){
            ans += "L";
            cx--;
        }
        ans += "U";
        cy++;

 
        out.println(ans);
    }

    final int mod = 1000000007;
    int mul(int x, int y){
        return (int)((x * 1L * y) % mod);
    }
    int add(int x, int y) {
        x += y;
        return x >= mod ? (x - mod) : x;
    }
    int sub(int x, int y){
        x = add(x,mod-y);
        return x >= mod ? (x - mod) : x;
    }
    String ns() throws IOException {
        while (!tok.hasMoreTokens()) {
            tok = new StringTokenizer(in.readLine(), " ");
        }
        return tok.nextToken();
    }
 
    int ni() throws IOException {
        return Integer.parseInt(ns());
    }
 
    long nl() throws IOException {
        return Long.parseLong(ns());
    }
 
    double nd() throws IOException {
        return Double.parseDouble(ns());
    }
 
    String[] nsa(int n) throws IOException {
        String[] res = new String[n];
        for (int i = 0; i < n; i++) {
            res[i] = ns();
        }
        return res;
    }
 
    int[] nia(int n) throws IOException {
        int[] res = new int[n];
        for (int i = 0; i < n; i++) {
            res[i] = ni();
        }
        return res;
    }
 
    long[] nla(int n) throws IOException {
        long[] res = new long[n];
        for (int i = 0; i < n; i++) {
            res[i] = nl();
        }
        return res;
    }
 
    static BufferedReader in;
    static PrintWriter out;
    static StringTokenizer tok;
 
    public static void main(String[] args) throws IOException {
        in = new BufferedReader(new InputStreamReader(System.in));
        out = new PrintWriter(System.out);
        tok = new StringTokenizer("");
        Main main = new Main();
        main.solve();
        out.close();
    }
}

Measured memory_bytes: 53044
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.HashSet;
import java.util.Set;
import java.io.IOException;
import java.util.NoSuchElementException;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FasterScanner in = new FasterScanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, FasterScanner in, PrintWriter out) {
            String s = in.next();
            Set<Character> c = new HashSet<>();
            for (int i = 0; i < s.length(); i++) {
                c.add(s.charAt(i));
            }

            if (c.size() < 26) {
                char cc = 'a';
                while (cc < 'z' && c.contains(cc)) {
                    cc++;
                }
                out.print(s + cc);
                return;
            }

            for (int i = s.length() - 1; i >= 0; i--) {
                char cc = s.charAt(i);
                while (cc < 'z') {
                    cc++;
                    for (int j = i + 1; j < s.length(); j++) {
                        if (s.charAt(j) == cc) {
                            out.println(s.substring(0, i) + cc);
                            return;
                        }
                    }
                }
            }

            out.println(-1);
        }

    }

    static class FasterScanner {
        private InputStream in;
        private byte[] buffer;
        private int bufPointer;
        private int bufLength;

        public FasterScanner(InputStream in) {
            this.in = in;
            buffer = new byte[1024];
        }

        private boolean hasNextByte() {
            if (bufPointer < bufLength) return true;
            bufPointer = 0;
            try {
                bufLength = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            return (bufLength > 0);
        }

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

        private static boolean isPrintableChar(int c) {
            return (c >= 33 && c <= 126);
        }

        public boolean hasNext() {
            while (hasNextByte() && !isPrintableChar(buffer[bufPointer])) bufPointer++;
            return hasNextByte();
        }

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

    }
}



Measured memory_bytes: 21460
s=input()
for i,c in enumerate(s):
    if i == 0:
        continue
    if i == 1:
        if s[i-1] == s[i]:
            print(i, i+1)
            break
        continue
    if s[i-1] == s[i]:
        print(i, i+1)
        break
    if s[i-2] == s[i]:
        print(i-1, i+1)
        break
else:
    print(-1, -1)

Measured memory_bytes: 72964
package main

import (
	"fmt"
)

func main() {
	var N int
	fmt.Scan(&N)
	a := make([]int, N+1)
	i := 1
	maxn := 1
	for ; i <= N; i++ {
		n := i
		for {
			if n%2 == 1 {
				break
			} else {
				a[i]++
				n /= 2
				if a[i] > a[maxn] {
					maxn = i
				}
			}
		}
	}
	fmt.Println(maxn)
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define lowbit(x) (x&(-x))
#define CSE(x,y) memset(x,y,sizeof(x))
#define INF 0x3f3f3f3f
#define Abs(x) (x>=0?x:(-x))
#define FAST ios::sync_with_stdio(false);cin.tie(0);
using namespace std;

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

const int maxn = 211111;
int sp[] = { 1,2,4,8,16,32,64,128,256,512,1024,2048,4096,8192,16384,32768,65536,131072,262144 };
char str[maxn];
int mod1[maxn], mod2[maxn];

int popcount(int x) {
	int ans = 0;
	for (int i = 0; i < 19; i++) {
		if (x & sp[i]) {
			ans++;
		}
	}
	return ans;
}

int main()
{
	int n, all = 0;
	cin >> n;
	cin >> str;
	for (int i = 0; i < n; i++) {
		if (str[i] == '1')
			all++;
	}
	int all1 = all - 1, all2 = all + 1;
	if (all1)
		mod1[n - 1] = 1 % all1;
	else
		mod1[n - 1] = 0;
	mod2[n - 1] = 1 % all2;
	for (int i = n - 2; i >= 0; i--) {
		if (all1)
			mod1[i] = mod1[i + 1] * 2 % all1;
		else
			mod1[i] = 0;
		mod2[i] = mod2[i + 1] * 2 % all2;
	}
	ll summ1 = 0, summ2 = 0;
	for (int i = 0; i < n; i++) {
		if (str[i] == '1') {
			summ1 += mod1[i];
			summ2 += mod2[i];
		}
	}
	for (int i = 0; i < n; i++) {
		int pp;
		if (str[i] == '1') {
			if (all1 == 0) {
				cout << "0" << endl;
				continue;
			}
			pp = (summ1 - mod1[i]) % all1;
		}
		else {
			pp = (summ2 + mod2[i]) % all2;
		}
		int ans = 1;
		while (pp) {
			pp = pp % popcount(pp);
			ans++;
		}
		cout << ans << endl;
	}
	return 0;
}

Measured memory_bytes: 5412
// inputに入力データ全体が入る
function Main(input) {
	// 1行目がinput[0], 2行目がinput[1], …に入る
    input = input.split("\n");
    // 数値の配列を作る
    const numList0 = input[0].split(' ').map(x => parseInt(x, 10));
    const A = numList0[0];
    const P = numList0[1];

    const kakera = A * 3 + P;
    console.log(Math.floor(kakera / 2));
}
 
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 21064
S = input()
Q = int(input())
flg = 0
senntou = ''
ushiro = ''
for i in range(Q):
    A = list(input().split())
    if int(A[0]) == 1 and flg == 0:
        flg = 1
        continue
    elif int(A[0]) == 1 and flg == 1:
        flg = 0
        continue
    if (int(A[1]) == 1 and flg == 0) or (int(A[1]) == 2 and flg == 1):
        senntou = A[2] + senntou
    else:
        ushiro = ushiro + A[2]
if flg == 0:
    print(senntou + S + ushiro)
if flg == 1:
    print(ushiro[::-1] + S[::-1] + senntou[::-1])

Measured memory_bytes: 4444
#include<bits/stdc++.h>
    using namespace std;
    int main()
    {
      int n;
      string str;
      cin>>n;
      n=n%26;
      cin>>str;
      for(int i=0;i<str.size();i++)
      {
        int ascii=str[i];
 	ascii+=n;
	if(ascii<=90)
	str[i]=ascii;
	else
	str[i]=ascii-26;
      }
      cout<<str<<endl;
      
      return 0;
    }

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

using namespace std;

const int N = 5002;

int n, m, p_cnt[N][N], X[N], Y[N];
vector<int> vx, vy;

int conv(vector<int>& vec, int x){
  return lower_bound(vec.begin(), vec.end(), x) - vec.begin();
}

main(){
  cin >> n >> m;
  for(int i=0;i<n;i++){
    cin >> X[i] >> Y[i];
    vx.push_back(X[i]);
    vy.push_back(Y[i]);
  }
  sort(vx.begin(), vx.end());
  sort(vy.begin(), vy.end());

  fill(p_cnt[0], p_cnt[N], 0);
  for(int i=0;i<n;i++){
    int x = conv(vx, X[i]);
    int y = conv(vy, Y[i]);
    p_cnt[y+1][x+1]++;
  }

  for(int i=0;i<vy.size()+2;i++){
    for(int j=0;j<vx.size()+2;j++){
      if(i == 0 && j == 0) continue;
      else if(i == 0) p_cnt[i][j] += p_cnt[i][j-1];
      else if(j == 0) p_cnt[i][j] += p_cnt[i-1][j];
      else p_cnt[i][j] += p_cnt[i][j-1] + p_cnt[i-1][j] - p_cnt[i-1][j-1];
    }
  }

  for(int i=0;i<m;i++){
    int x1, y1, x2, y2;
    cin >> x1 >> y1 >> x2 >> y2;
    x1 = conv(vx, x1);
    y1 = conv(vy, y1);
    x2 = conv(vx, x2+1);
    y2 = conv(vy, y2+1);
    cout << p_cnt[y2][x2] - p_cnt[y2][x1] - p_cnt[y1][x2] + p_cnt[y1][x1] << endl;
  }
}

Measured memory_bytes: 99068
i = list(map(int, input().split()))
n = i[0]
k = i[1]

lists = []
for j in range(k):
  d = int(input())
  a = list(map(int, input().split()))
  for b in range(d):
    lists.append(a[b])
    
    
c = len(set(lists))
print(n-c)

Measured memory_bytes: 9188
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int X = sc.nextInt();
		int A = sc.nextInt();
		int B = sc.nextInt();
		int rest = (X - A) % B;
		System.out.println(rest);
	}

}


Measured memory_bytes: 22612
#include "bits/stdc++.h"
#define ll long long
#define ALL(x) x.begin(),x.end()
#define MOD (1000000000+7)
using namespace std;


int main(){
ll N;
cin>>N;
vector<pair<ll,ll>> a(N);

ll tmp;
for(ll i=0;i<N;i++){
  cin>>tmp;
  a[i] = make_pair(tmp,i);
}

sort(ALL(a));

for(ll i=0;i<N;i++){
  cout<<a[i].second+1<<" ";
}



}



Measured memory_bytes: 2432
from itertools import product
import bisect
import sys


def input():
    return sys.stdin.readline()[:-1]

# N = int(input())
# A = [int(x) for x in input().split()]
# a, b, c = map(int, input().split())
# name1 = str(input())
# alph = {"A": 1, "B": 2, "C": 3, "D": 4, "E": 5}
# b = list(map(lambda x: math.ceil(x/10)*10, a))


r, d, x = map(int, input().split())
for i in range(10):
    x = r*x-d
    print(x)


Measured memory_bytes: 3060
#include <bits/stdc++.h>
 
using namespace std;
typedef long long LL;
typedef pair<int,int> pii;
typedef int ftype;
 
#define pb push_back 
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second 
#define debug(x)  do{cerr<<#x<<": "<<x<<"\n";}while(0)
#define debugv(x) do{cerr<<#x<<": ";for(auto&e: (x))cerr<<e<<" ";cerr<<"\n";}while(0)
#define fori(i, n) for (int i = 0; i < (int)(n); ++i)
#define forn(i, n) for (int i = 1; i <= (int)(n); ++i)
#define ford(i, n) for (int i = (int)(n); i >= 0; --i)
#define fore(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#define RETURN(x) do{cout << x << '\n'; return 0;}while(0)
#define FIRSTWIN do{cout << "Monocarp\n"; return 0;}while(0)
#define SECONDWIN do{cout << "Bicarp\n"; return 0;}while(0)

const int MAXN = 3e2+5;
const int MOD = 1e9+7;
const int INF = 1e9+1;

int N,M,L;
vector<pii> edges[MAXN];
int H[MAXN];
int D[MAXN][MAXN];
int E[MAXN][MAXN];
int visited[MAXN];

int main() {
#ifdef OJ
    freopen("input.txt", "rt", stdin);
    //freopen("output.txt", "wt", stdout);
#endif
    ios::sync_with_stdio(false);
    cin.tie(0);

    cin >> N >> M >> L;
    fori(i,M) {
        int a,b,c;
        cin >> a >> b >> c;
        if(c > L) continue;
        --a; --b;
        edges[a].pb({b,c});
        edges[b].pb({a,c});
    }

    fori(u,N) {
        fori(i,N) visited[i] = 0;
        fori(i,N) H[i] = -1;
        H[u] = L;

        //set<pii> qu;
        //qu.insert({L,u});

        while(1) {
            int mx = -1;
            int v;
            fori(k,N) {
                if(visited[k]) continue;
                if(H[k] == -1) continue;
                if(mx < H[k]) {
                    mx = H[k];
                    v = k;
                }
            }

            if(mx == -1) break;
            int l = mx;
            visited[v] = 1;

            for(auto e: edges[v]) {
                int k = e.fi;
                int c = e.se;
                if(visited[k]) continue;
                if(c <= l) {
                    //visited[k] = 1;
                    D[u][k] = 1;
                    H[k] = max(H[k],l-c);
                }
            }
        }
    }

    fori(i,N) {
        fori(i,N) visited[i] = 0;
        queue<pii> qu;
        qu.push({i,0});
        visited[i] = 1;

        while(qu.size()) {
            int u = qu.front().fi;
            int d = qu.front().se;
            qu.pop();
            fori(k,N) {
                if(visited[k]) continue;
                if(!D[u][k]) continue;
                E[i][k] = d+1;
                visited[k] = 1;
                qu.push({k,d+1});
            }
        }
    }

    int Q; 
    cin >> Q;
    fori(q,Q) {
        int a, b;
        cin >> a >> b;
        --a; --b;
        cout << E[a][b]-1 << '\n';
    }
    return 0;
}


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

#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

struct State {
	ll pos, coin, dist;
	const bool operator<(const State& s) const {
		return dist > s.dist;
	}
};

struct Edge {
	ll from, to, cost, time;
};

int n, m, s;
vector<Edge> G[51];
ll dist[51][2501];
ll c[51], d[51];
ll ans[51];

int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin.exceptions(cin.failbit);

	cin >> n >> m >> s;

	rep(i, 0, m) {
		int u, v, a, b; cin >> u >> v >> a >> b;
		G[u].push_back(Edge {u, v, a, b});
		G[v].push_back(Edge {v, u, a, b});
	}

	rep(i, 1, n + 1) cin >> c[i] >> d[i];

	// initial state
	s = min(s, 2500);

	rep(i, 1, n + 1) rep(j, 0, 2501) dist[i][j] = 0x3f3f3f3f3f3f3f3fll;
	rep(i, 1, n + 1) ans[i] = 0x3f3f3f3f3f3f3f3fll;

	priority_queue<State> pq;
	pq.push(State {1, s, 0});
	dist[1][s] = 0;

	while (!pq.empty()) {
		State st = pq.top(); pq.pop();
		if (st.dist > dist[st.pos][st.coin]) continue;

		ans[st.pos] = min(ans[st.pos], st.dist);

		// walk
		for (Edge e : G[st.pos]) if (st.coin >= e.cost && st.dist + e.time < dist[e.to][st.coin - e.cost]) {
			dist[e.to][st.coin - e.cost] = st.dist + e.time;
			pq.push(State {e.to, st.coin - e.cost, st.dist + e.time});
		}

		// add coin
		{
			ll ncoin = min(2500ll, st.coin + c[st.pos]);
			if (st.dist + d[st.pos] < dist[st.pos][ncoin]) {
				dist[st.pos][ncoin] = st.dist + d[st.pos];
				pq.push({st.pos, ncoin, st.dist + d[st.pos]});
			}
		}
	}

	rep(i, 2, n + 1) cout << ans[i] << endl;
}


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

namespace Atcoder116_B
{
    class Program
    {
        const int ARRAYMAX = 1000000;

        static void Main(string[] args)
        {
            int s = int.Parse(Console.ReadLine());
            int i = 1;
            int[] a = new int[ARRAYMAX];
            a[0] = s;
            int result = 0;

            while (true)
            {
                //奇数と偶数で場合分け
                if (a[i - 1] % 2 == 0)
                {
                    a[i] = a[i - 1] / 2;
                }
                else
                {
                    a[i] = 3 * a[i - 1] + 1;
                }
                //一致しているか探す
                for (int j = 0; j < i; j++)
                {
                    for (int k = j + 1; k <= i; k++)
                    {
                        if (a[j] == a[k])
                        {
                            result = k+1;

                            goto last;
                        }
                    }
                }
                i++;
            }
        last:;

            Console.WriteLine(result);
        }
    }
}


Measured memory_bytes: 11088
import heapq
n,m=map(int,input().split())
a=list(map(int,input().split()))

a=[-1*i for i in a]
heapq.heapify(a)
for i in range(m):
    ma=heapq.heappop(a)
    ma*=-1
    heapq.heappush(a,-1*(ma//2))
print(sum(a)*-1)


Measured memory_bytes: 14180
#include "stdio.h"
 
int main(){
    int n, a[100], x, i;
    scanf("%d",&n);
    for(i=0;i<n;i++){
        scanf("%d", &a[i]); 
    }
    for(i=0;i<n-1;i++){
        printf("%d ", a[n-1-i]);    
    }
    printf("%d\n", a[0]);
    return 0;
}

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

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

    vector<string> s(N+1);
    for(int i=1; i<N+1; i++){
        cin >> s.at(i);
        sort(s.at(i).begin(), s.at(i).end());
    }

    sort(s.begin(), s.end());
    ll cnt = 1;
    ll ans = 0;

    for(int i=1; i<N; i++){
        if(s.at(i) == s.at(i+1)){
            cnt++;
        }
        else{
            if(cnt!=1) ans += cnt*(cnt-1)/2;
            cnt = 1;
        }

        if(i==N-1 && s.at(i) == s.at(i+1)){
            ans += cnt*(cnt-1)/2;
        }
    }

    cout << ans << endl;

}

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

void solve() {
  int a, b;
  cin >> a >> b;
  int ans = a + b;
  ans = max(ans, a * b);
  ans = max(ans, a-b);
  cout << ans << endl;
}

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


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

auto solve(long long N, long long K, std::vector<long long> a, std::vector<long long> b) {
    vector<tuple<long long, long long>> vs;
    for(int i = 0; i < N; ++i) {
        vs.push_back(make_tuple(a[i], b[i]));
    }
    sort(begin(vs), end(vs));

    long long acc = 0;
    for(const auto& v : vs) {
        acc += get<1>(v);
        if(K <= acc) {
            return get<0>(v);
        }
    }
    return b[N-1];
}

int main() {
  long long N;
  scanf("%lld", &N);
  long long K;
  scanf("%lld", &K);
  std::vector<long long> a(N);
  std::vector<long long> b(N);
  for (int i = 0; i < N; i++) {
    scanf("%lld", &a[i]);
    scanf("%lld", &b[i]);
  }
  auto result = solve(N, K, std::move(a), std::move(b));
  cout << result << endl;
  return 0;
}


Measured memory_bytes: 3956
#include <iostream>
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
int main(){
    int n,m;
    cin>>n>>m;
    vector<pair<vector<int>,int>> hoge(m);
    
    for(int i=0;i<m;i++){
        int k;
        cin>>k;
        vector<int> tmp(k);
        for(int l=0;l<k;l++){
            cin>>tmp.at(l);
        }
        hoge.at(i).first=tmp;
    }
    
    for(int i=0;i<m;i++) cin>>hoge.at(i).second;
    
    long long ans=0;
    
    for(int i=0;i<(1<<n);i++){
        bitset<10> tmp(i);
        vector<int> suit(n,0);
        for(int j=0;j<n;j++){
            if(tmp.test(j)) suit.at(j)=1;
        }
        
        bool ok=true;
        for(int j=0;j<m;j++){
            int sum=0;
            for(int y=0;y<hoge.at(j).first.size();y++){
                if(suit.at(hoge.at(j).first.at(y)-1)==1) sum++;
            }
            if(sum%2!=hoge.at(j).second) ok=false;
        }
        
        if(ok) ans++;
    }
    
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  string S;
  cin >> S;
  int count = 0;
  int size = S.length();

  for (int i = 0; i < size / 2; i++) {
    if (S[i] != S[size -1 - i]) {
      count++;
    }
  }

  cout << count << endl;
  return 0;
}


Measured memory_bytes: 256
//https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8 より
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

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

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };
    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };
    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };
    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };
    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

//

fn run() {
    input! {
        h: usize,
        w: usize,
        n: usize,
    }
    let m = std::cmp::max(h, w);
    let ans = (n + m - 1) / m;
    println!("{}", ans);
}

fn main() {
    run();
}


Measured memory_bytes: 4352
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
    public void main() {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

        try {
            String input[] = br.readLine().split(" ");

            println(input[0].equals(input[1]) ? "H" : "D");
        } catch (IOException e) {
            e.printStackTrace();
        }
    }

    public void print(Object o) {
        System.out.print(o);
    }

    public void println(Object o) {
        System.out.println(o);
    }

    public static void main(String[] args) {
        new Main().main();
    }
}


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

using namespace std;

const int N=100005;
vector<int> e[N];
int n,k,ans;

int dfs(int x){
	int l=1,d;
	for(int v:e[x])if((d=dfs(v))==k)ans++;else l=max(d+1,l);
	return l;
}

int main(){
	scanf("%d%d",&n,&k);
	for(int i=1,x;i<=n;i++){scanf("%d",&x);if(i>1)e[x].push_back(i);else ans+=x!=1;}
	for(auto v:e[1])dfs(v);
	printf("%d\n",ans);
	return 0;
}

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

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

  int x;
  int sum = 0;
  
  rep(cnt, N) {
    cin >> x;
    if ( x < K-x ) {
      sum += x * 2;
    } else {
      sum += (K - x) * 2;
    }
  }
  cout << sum;  
}

Measured memory_bytes: 3532
#include<iostream>
int n;

int main(){
    int k,p;
    int ans;
    std::cin>>n;
    for(int i=0;i<n;++i){
        std::cin>>k>>p;
        if(k%p==0)
            ans=p;
        else
            ans=k%p;
        std::cout<<ans<<std::endl;
    }
    return 0;
}

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

int main() {
  int n,k;
  cin >> n >> k;
  priority_queue<ll>q;
  ll ans = (ll)0;
  rep(i,n){
    int h;
    cin >> h;
    q.push(h);
  }
  rep(i,k){
    ll a = q.top(); q.pop();
  }
  rep(i,n-k){
    ans += q.top(); q.pop();
  }
  cout << ans << endl;
  return 0;
}


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

int main() {
    int A, B, K;
    cin >> A >> B >> K;

    for (int i = 1; i <= K; i++) {
        if (i % 2 == 1) {
            A /= 2;
            B += A;
        }
        else {
            B /= 2;
            A += B;
        }
    }

    cout << A << " " << B << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef priority_queue<double, vector<double>, less<double> > QUE_double;
typedef priority_queue<int, vector<int>, less<int> > QUE_int;//lessは大きい順にならべるよ
const int MAX = pow(10, 5)+1;//+1しないとREになる(out of rangeになるんかな?? )

ll gcd(ll a, ll b){//greatest common divider 最大公約数を求める
  if(b==0) return a;
  return gcd(b, a%b);
}

ll lcm(ll a, ll b){//least common multiple 最小公倍数を求める
  return a*b/gcd(a, b);
}

int main(){
  ll A, B;
  cin >> A >> B;
  
  cout << lcm(A, B) << endl;
}


Measured memory_bytes: 256
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>
#include <iomanip>

using namespace std;

#define FOR(i, a, b) for(int (i)=(a);(i)<(b);(i)++)
#define IFOR(i, a, b) for(int (i)=(a);(i)<=(b);(i)++)
#define RFOR(i, a, b) for(int (i)=(a);(i)>=(b);(i)--)
#define REP(i, n) FOR((i), 0, (n))

using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;

template<class T>
void print_container(T &container, string delim=" ") {
    bool first = true;
    for(auto &t: container){
        if(!first){
            cout << delim;
        }
        first = false;
        cout << t;
    }
    cout << endl;
}

int main() {
    int n;
    cin >> n;
    set<string> get;
    REP(i, n){
        string s;
        cin >> s;
        get.insert(s);
    }
    cout << get.size() << endl;
    return 0;
}

Measured memory_bytes: 15652
#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <vector>
using namespace std;

#define pb push_back
#define ri(x) scanf("%d",&x)
#define rii(x,y) ri(x),ri(y)
#define ms(obj,val) memset(obj,val,sizeof(obj))
#define ms2(obj,val,sz) memset(obj,val,sizeof(obj[0])*sz)
#define FOR(i,f,t) for(int i=f;i<(int)t;i++)
#define FORR(i,f,t) for(int i=f;i>(int)t;i--)

typedef long long ll;
typedef vector<int> vi;

const int MAXN=0;

int N,M;
ll ans;

int main() {
	cin >> N >> M;
	if(N == 1 && M == 1) ans = 1;
	else if(N == 1 && M > 1) ans = max(M-2,0);
	else if(M == 1 && N > 1) ans = max(N-2,0);
	else ans = 1ll * max(N-2,0) * max(M-2,0);
	cout << ans << endl;
}


Measured memory_bytes: 256
n = gets.to_i
s = gets.chomp

ans = 0
n.times do |i|
    s1 = s[0..i]
    s2 = s[(i+1)...n]
    hoge = (s1.split('') & s2.split('')).uniq
    ans = [ans, hoge.size].max
end
p ans

Measured memory_bytes: 1916
import java.util.*;

public class Main {
    static long[][] dp;
    static int[] arr;
 	public static void main (String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int k = sc.nextInt();
		dp = new long[k + 1][n + 2];
		arr = new int[n + 2];
		for (int i = 1; i <= n; i++) {
		    arr[i] = sc.nextInt();
		}
		System.out.println(dfw(k, n + 1));
	}
	
	static long dfw(int count, int idx) {
	    if (idx < 1) {
	        return 0;
	    }
	    if (dp[count][idx] != 0) {
	        return dp[count][idx];
	    }
	    long ans = Long.MAX_VALUE;
	    for (int i = 0; i <= count && i <= idx - 1; i++) {
	        ans = Math.min(ans, dfw(count - i, idx - 1 - i) + Math.max(0, arr[idx] - arr[idx - 1 - i]));
	    }
	    dp[count][idx] = ans;
	    return ans;
	}
}




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

#define ASC(vec) vec.begin(), vec.end()		// 昇順ソート 例：sort(ASC(vec));
#define DESC(vec) vec.rbegin(), vec.rend()	// 降順ソート 例:sort(DESC(vec));
#define rep(i, n) for(int i = 0; i < (n); i++)
#define Rep(i, n) for(int i = 1; i < n; i++)
#define REP(i, vec) for(auto i = vec.begin(); i != vec.end(); ++i)

const int mod = 1000000007;
const int inf = (1 << 21);
const long long INF = 1LL << 60;

using ii = pair<int, int>;
using ll = long long;
using vi = vector<int>;
using vd = vector<double>;
using vb = vector<bool>;
using vl = vector<ll>;
using vs = vector<string>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vvb = vector<vector<bool>>;
using vii = vector<pair<int, int>>;
using vll = vector<pair<ll, ll>>;

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; }
template<class T> inline T GCD(T a, T b) { return b ? GCD(b, a % b) : a; }
template<class T> inline T LCM(T a, T b) { return (a + (b - 1)) / b; }

int round_int(int a, int b) { return (a + (b - 1)) / b; }

constexpr array<int, 9> dx = { 0, 1, 0, -1, -1, 1, 1, -1, 0 };
constexpr array<int, 9> dy = { 1, 0, -1, 0, 1, 1, -1, -1, 0 };

// ──────────────────────────────────────────────────────────────────

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

	ll res = 0;

	vvl num(10, vl(10, 0));
	for (int i = 1; i <= n; ++i) {
		vi d;
		int nn = i;
		while (nn) {
			d.push_back(nn % 10);
			nn /= 10;
		}
		int a = d[0];
		int b = d.back();
		if (!a || !b) continue;
		num[a][b]++;
	}
	for (int a = 1; a < 10; ++a) {
		for (int b = 1; b < 10; ++b) {
			res += num[a][b] * num[b][a];
		}
	}
	cout << res << endl;
}

Measured memory_bytes: 256
// /*
// power code taken from geeks for geeks
// */
// cout << setprecision (2) << fixed << 1.2;

#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef long double ld;

const ll INF = 1e18 + 5;
const ll MAX_N = 1e5 + 5;
const ll MODD = 1e9 + 7;

ll max(ll a,ll b){return a>b?a:b;}
ll min(ll a,ll b){return a<b?a:b;}
double max(double a,double b){return a>b?a:b;}
double min(double a,double b){return a<b?a:b;}

ll modd(ll a){if(a<0LL) return a*-1LL;return a;}
double modd(double a){if(a<0.0) return a*-1.0;return a;}

ll modulo(ll a){return (a + MODD) % MODD; }

ll power(ll k, ll p){
    if (p == 0)
        return 1LL;
 
    ll P = power(k, p/2LL);
    P = (P * P) % MODD;
 
    if (p % 2 == 1)
        P = (P * k) % MODD;
 
    return P;
}



struct p_str {
    ll a, b;
};



void solve() {
    ll x;
    cin >> x;
    if(x < 30) {
        cout << "No\n";
    }
    else {
        cout << "Yes\n";
    }
}


int main(){




    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    



    ll t=1;


    // cin>>t;
    


    while(t--){

        solve();
    }
    return 0;
}

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

using namespace std;

using ll = long long;

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

    constexpr ll MOD = 1e9 + 7;

    int n;
    string s;
    cin >> n >> s;

    vector<int> cur(n + 1, 1), nxt(n + 1);
    cur[0] = 0;

    for (int i = 2; i <= n; ++i) {
        for (int j = 1; j <= n - i + 2; ++j) {
            (cur[j] += cur[j - 1]) %= MOD;
            nxt[j] = 0;
        }

        if (s[i - 2] == '<') {
            for (int j = 1; j <= n - i + 1; ++j)
                (nxt[j] += (cur[j] - cur[0] + MOD)) %= MOD;
        }
        else {
            for (int j = 1; j <= n - i + 1; ++j)
                (nxt[j] += (cur[n - i + 2] - cur[j] + MOD)) %= MOD;
        }

        swap(cur, nxt);
    }

    cout << cur[1] << endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<map>
#include<set>
#include<string>
#include<queue>
#include<stack>
#include<cassert>
#include<numeric>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define rrep(i,n) for(int i = 1; i <= (n); ++i)
#define drep(i,n) for(int i = (n)-1; i >= 0; --i)
using namespace std;
const int INF = 1001001001;
const long long LINF = 1001002003004005006ll;
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; }
typedef long long ll;
typedef pair<int,int> P;

int dp[3005][3005];

int main(){
  int n,t;
  cin >> n >> t;
  vector<P> v(n);
  rep(i,n){
    int a,b;
    cin >> a >> b;
    v[i]=P(a,b);
  }
  sort(v.begin(),v.end());
  rrep(i,n){
    rep(j,t){
      chmax(dp[i][j],dp[i-1][j]);
      if(j-v[i-1].first>=0)chmax(dp[i][j],dp[i-1][j-v[i-1].first]+v[i-1].second);
    }
  }
  int ans = 0;
  rep(i,n){
    chmax(ans,dp[i][t-1]+v[i].second);
  }
  cout << ans << endl;
}

Measured memory_bytes: 35456
using System;
using System.Text;
using System.Linq;
using System.Collections;
using System.Collections.Generic;


class Program {

	static long mod = 1000000007;
	static int[] ans;
	static void Main(string[] args) {

		char[] cs = new char[] { ' ' };
		//char[] cs = new char[] { ' ', ',' };

		//int n = int.Parse(Console.ReadLine());
		//int val = int.Parse(Console.ReadLine());
		//int[] vals = parseAry(Console.ReadLine().Split(cs));
		//string str = Console.ReadLine();
		//string[] strs = Console.ReadLine().Split(cs);

		int res = 0;


		//int n = int.Parse(Console.ReadLine());
		int[] vals = parseAry(Console.ReadLine().Split(cs));
		res = vals[0] / ( ( vals[1] * 2 ) + 1 );
		if ( ( vals[0] % ( ( vals[1] * 2 ) + 1 ) ) > 0 ) { res++; }

			Console.WriteLine(res);
			return;

	}



	//	文字列strをindex番目からdで上書き
	static string strOverWrite(string str, int i, string s) {
		return str.Remove(i, s.Length).Insert(i, s);
	}

	//　String[]  ----->  int[]
	static int[] parseAry(string[] str) {
		int[] nums = new int[str.Length];
		for ( int i = 0; i < str.Length; i++ ) { nums[i] = int.Parse(str[i]); }
		return nums;
	}
	//　String[]  ----->  long[]
	static long[] parseAryL(string[] str) {
		long[] nums = new long[str.Length];
		for ( int i = 0; i < str.Length; i++ ) { nums[i] = long.Parse(str[i]); }
		return nums;
	}

	//文字列を1文字ずつString[]に入れる
	static string[] strAry(String str) {
		string[] re = new string[str.Length];
		for ( int i = 0; i < str.Length; i++ ) { re[i] = str[i].ToString(); }
		return re;
	}


}

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

int main(){
  for (int i = 0; i < 4; i++) {
      int t, n;
      cin >> t >> n;
      if(t == 1) {
          cout << 6000 * n << endl;
      } else if (t == 2) {
          cout << 4000 * n << endl;
      } else if (t == 3) {
          cout << 3000 * n << endl;
      } else {
          cout << 2000 * n << endl;
      }
      
  }
  return 0;
}



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


using namespace std;
typedef long long ll;

#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VP vector<pair<int,int>>
#define VPP vector<pair<int,pair<int,int>>>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define VB vector<bool>
#define VVB vector<vector<bool>>
#define fore(i,a) for(auto &i:a)
typedef pair <int, int> P;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;

const int  INF = 1 << 29;
const ll INFL = 1LL << 60;




int main() {
	
	int k;
	cin >> k;
	int n;
	cin >> n;
	VI a(n + 1);
	REP(i, n)cin >> a[i];
	a[n] = a[0] + k;

	int ans = INF;

	REP(i, n) {
		ans = min(ans, k - (a[i + 1] - a[i]));
	}
	cout << ans << endl;



}



Measured memory_bytes: 1024
#include <stdio.h>
 
int main()
{
   int N;
   int Ans;
   
    scanf("%d", &N);
    if(N> 100000) N=100000; 
    if(N<1) N=1;

    if(N >= 100000){
        Ans = 9 + (100*9) + (10000*9); // 90909
    }
    else if(N >= 10000){
        Ans = 9 + 900 + (N-10000)+1;
    }
    else if(N >= 1000){
        Ans = 9 + 900;
    }
    else if(N >= 100){
        Ans = 9 + (N-100) + 1;
    }
    else if(N >= 10){
        Ans = 9; 
    }
    else{
        Ans = N;
    }
    
    printf("%d",Ans);
    
  return 0;  
}

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

using namespace std;

int main() {
    cin.tie(0);
    cout.tie(0);
    ios_base::sync_with_stdio(0);
    int a, b, c, d;
    cin >> a >> b >>c >>d;
    while(a > 0 && c > 0){
        a -= d;
        c -= b;
    }
    if(c <= 0)
        cout << "Yes";
    else
        cout << "No";
}

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

int N, M;
const int MAX_NM = 2.0e5 + 100;
int D[MAX_NM], T[MAX_NM];

int main() {
    cin >> N;
    for (int i = 0; i < N; i++) cin >> D[i];
    cin >> M;
    for (int i = 0; i < M; i++) cin >> T[i];

    sort(D, D+N);
    sort(T, T+M);

    bool f = true;
    int i = 0, j = 0;
    while (i < N && j < M) {
        if (D[i] == T[j]) {
            i++;
            j++;
        }
        else if (D[i] < T[j]) i++;
        else {
            f = false;
            break;
        }
    }

    if (!f) cout << "NO" << endl;
    else {
        if (j == M) cout << "YES" << endl;
        else cout << "NO" << endl;
    }

    return 0;
}


Measured memory_bytes: 1792