akhauriyash/Code-Regression huggingface dataset:
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		Console.WriteLine(A[0][0] != A[1][0] ? 1 : 0);
	}
	int[][] A;
	public Sol(){
		A = new int[2][];
		A[0] = ria();
		A[1] = ria();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


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

using namespace std;

int main(int argc, const char *argv[]) {
  using ll = long long;
  ll n;
  cin >> n;

  auto f = [](ll a, ll b) -> ll {
    return max(to_string(a).size(), to_string(b).size());
  };

  ll ans = to_string(n).size();
  for (ll i = 2; i * i <= n; i++) {
    if (n % i == 0) {
      ans = min(ans, f(i, n / i));
    }
  }

  cout << ans << '\n';

  return 0;
}

Measured memory_bytes: 256
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort()
q.sort()
r.sort()
r.reverse()
pp = p[a-x:]
qq = q[b-y:]
ll = pp+qq
ll.sort()
ans = sum(ll)
subll = ll[:c]
rr = r+subll
rr.sort()
subrr = rr[c:]
ans += sum(subrr)-sum(subll)
print(ans)

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

using ll = long long;

#define pb push_back
#define ff first
#define ss second
#define all(a) a.begin(), a.end()
#define sz(a) (int)(a.size())
#define clr(a, b) memset(a, b, sizeof(a))
#define REP(i, a, b) for(int i=(int)(a); i<(int)(b); ++i)
#define REPD(i, a, b) for(int i=(int)(a)-1; i>=(int)(b); --i)

template<typename T> inline bool chkmin(T &a, const T &b) { return a > b ? a = b, 1 : 0; }
template<typename T> inline bool chkmax(T &a, const T &b) { return a < b ? a = b, 1 : 0; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin >> s;
    REP(i, 0, sz(s)) {
    	if(s[i] == '?') s[i] = 'D';
    }
    cout << s << "\n";
    return 0;
}


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

using namespace std;

typedef pair<int, int> P;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
// #define int long long
#define pb push_back
#define mp make_pair
#define eps 1e-9
#define INF 2000000000               // 2e9
#define LLINF 2000000000000000000ll  // 2e18 (llmax:9e18)
#define fi first
#define sec second
#define all(x) (x).begin(), (x).end()
#define sq(x) ((x) * (x))
#define dmp(x) cerr << #x << ": " << x << endl;

template <class T>
void chmin(T &a, const T &b) {
  if (a > b) a = b;
}
template <class T>
void chmax(T &a, const T &b) {
  if (a < b) a = b;
}

template <class T>
using MaxHeap = priority_queue<T>;
template <class T>
using MinHeap = priority_queue<T, vector<T>, greater<T>>;
template <class T>
vector<T> vect(int len, T elem) {
  return vector<T>(len, elem);
}

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << p.fi << ',' << p.sec;
  return os;
}
template <class T, class U>
istream &operator>>(istream &is, pair<T, U> &p) {
  is >> p.fi >> p.sec;
  return is;
}
template <class T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) {
    os << vec[i];
    if (i + 1 < vec.size()) os << ' ';
  }
  return os;
}
template <class T>
istream &operator>>(istream &is, vector<T> &vec) {
  for (int i = 0; i < vec.size(); i++) is >> vec[i];
  return is;
}
void fastio() {
  cin.tie(0);
  ios::sync_with_stdio(0);
  cout << fixed << setprecision(20);
}

#define endl "\n"

void solve() {
  string s;
  cin >> s;
  string t;
  while (t.size() < s.size()) t += "hi";
  if (s == t)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return;
}

signed main() {
  fastio();
  solve();
  // int t; cin >> t; while(t--)solve();
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define nl "\n"
using namespace std;
void solve()
{
	int n;
	scanf("%d",&n);
	
	vector<int> div(n+1, 0);
	for(int i = 1; i<=n; i++)
	{
		for(int j = 0; j<=n; j += i)
			div[j]++;
	}
	ll ans = 0;
	for(ll i = 1; i<=n; i++)
		ans += (i * (ll)div[i]);
	
	printf("%lld\n",ans);
}
int main()
{
	solve();
	return 0;
}

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


int main(void){
	int N;
	cin >> N;
	int ans;
	if (N <= 104) ans = 0;
	else if(N <= 134) ans = 1;
	else if(N <= 164) ans = 2;
	else if(N <= 188) ans = 3;
	else if(N <= 194) ans = 4;
	else ans = 5;
	cout << ans << endl;
}

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

void solve() {
	int x; cin >> x;
	cout << 1 - x;
}

int main() {
	ios_base::sync_with_stdio(false); cin.tie(NULL);
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	// int t; cin >> t;
	// while (t--)
	solve();

}



Measured memory_bytes: 3592
#include <iostream>
#include <sstream>
#include <vector>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <utility>
#include <map>
#include <list>
#include <climits>
#include <set>
#include <deque>
#include <stack>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <bitset>

// #define cerr if(false)cerr
#define watch(x) cerr << "> " << #x << ": " << x << "\n";

using namespace std;

template <typename T>
std::ostream &operator <<(std::ostream &out, vector<T> &v) {
	for (typename vector<T>::size_type i = 0; i < v.size(); ++i)
		out << v[i] << " ";
	out << "\n";
    return out;
}
template <typename T, typename N>
std::ostream &operator <<(std::ostream &out, vector<pair<T, N> > &v) {
	for (size_t i = 0; i < v.size(); ++i)
		out << "(" << v[i].first << ", " << v[i].second << ") ";
	out << "\n";
    return out;
}
template <typename T>
std::ostream &operator <<(std::ostream &out, vector<vector<T> > &v) {
	for (size_t i = 0; i < v.size(); ++i) {
		for (size_t j = 0; j < v[i].size(); ++j) {
			out << v[i][j] << " ";
		}
		out << "\n";
	}
   	return out;
}

int main() {

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

	int n, q;
	cin >> n >> q;

	string s;
	cin >> s;

	vector<int> pre_sum(n);
	for (int i = 1; i < n; ++i) {
		pre_sum[i] = pre_sum[i - 1];
		if (s[i] == 'C' && s[i - 1] == 'A') {
			++pre_sum[i];
		}
	}	

	int l, r;
	while (q--) {
		cin >> l >> r;
		--l;
		--r;

		cout << pre_sum[r] - pre_sum[l] << "\n";
	}

	return 0;

}

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

#define pb         push_back

const int INF = 100000000;
const int N = 300000;

int Eratos[N];

void era(){
	for(int i=0; i<N; i++){
		Eratos[i] = 1;
	}

	Eratos[0] = Eratos[1] = 0;
	for(int i=2; i<N; i++){
		if(Eratos[i] == 0) continue;
		for(int j=2; i*j < N; j++){
			Eratos[j*i] = 0;
		}
	}
}

int main(void) {
	era();
	while(1){
		int n; 
		cin >> n;
		if(n == 0) break;

		int ans = 0;
		for(int i=n+1; i<=2*n; i++){
			if(Eratos[i] == 1) ans++;
		}
		cout << ans << endl;
	} 
	return 0;
}

Measured memory_bytes: 2332
import java.util.Scanner;

public class Main {
	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);

		int k = sc.nextInt();
		int x = sc.nextInt();
		for (int i = x - k + 1; i <= x + k - 1; i++) {
			System.out.print(i + " ");
		}

		System.out.println();

		sc.close();
	}
}


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

using namespace std;
typedef vector<int> vi;

int main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);
	
	int N, K;
	cin >> N >> K;
	vi p(N);
	for(int i = 0; i < N; ++i) cin >> p[i];
	sort(p.begin(), p.end());
	int ans = 0;
	for(int i = 0; i < K; ++i) ans += p[i];
	cout << ans << "\n";
	
	return 0;
}

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

#define GET_MACRO(_1,_2,_3,_4,NAME,...) NAME
#define REP2(i,n) for(int i=0;i<(int)(n);i++)
#define REP3(i,m,n) for(int i=m;i<(int)(n);i++)
#define REP4(i,m,n,s) for(int i=m;(s>0 and i<(int)(n)) or (s<0 and i>(int)(n));i+=s)
#define REP(...) GET_MACRO(__VA_ARGS__, REP4, REP3, REP2)(__VA_ARGS__)
#define REPIT(i,c) for(__typeof((c).begin()) i=(c).begin();i!=(c).end();i++)
#define PIS(x) printf("%d ",x)
#define PN() putchar('\n')
#define MP make_pair
#define PB push_back
#define EB emplace_back
#define MT make_tuple

using PII = pair<int, int>;
using TI3 = tuple<int, int, int>;
using LL = long long;
using ULL =  unsigned long long;
using MAT = array<array<LL, 2>, 2>;

void RI() {}
template<typename... T>
void RI( int& head, T&... tail ) {
    scanf("%d", &head);
    RI(tail...);
}
void RLL() {}
template<typename... T>
void RLL( LL& head, T&... tail ) {
    scanf("%lld", &head);
    RLL(tail...);
}
void print() {putchar('\n');}
template<typename T, typename... U>
void print(T head, U... tail) {
    cout << head << " ";
    print(tail...);
}

const int MOD = 1000000007;
#define MAX_N 300005


int main()
{
    int n, m;
    RI(n, m);
    int x = m * 1900 + (n - m) * 100;
    REP(i, m) {
        x *= 2;
    }
    printf("%d\n", x);
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
	#include <cstdio>
	#include <cstring>
	#include <cmath>
	#include <cstring>
	#include <chrono>
	#include <complex>
	#define endl "\n"
	#define ll long long int
	#define vi vector<int>
	#define vll vector<ll>
	#define vvi vector < vi >
	#define pii pair<int,int>
	#define pll pair<long long, long long>
	#define mod 1000000007
	#define inf 1000000000000000001;
	#define all(c) c.begin(),c.end()
	#define mp(x,y) make_pair(x,y)
	#define mem(a,val) memset(a,val,sizeof(a))
	#define eb emplace_back
	#define f first
	#define s second
	
	using namespace std;
	int main()
	{
		std::ios::sync_with_stdio(false);
		int n,x,t;
		cin>>n>>x>>t;
		ll total=n/x;
		if(n%x)
			total++;
		ll ans=total*t;
		cout<<ans;
		return 0;
	}


Measured memory_bytes: 3648
import java.util.*;
import java.io.*;
import java.util.function.*;

class Main {
    static Scanner scanner = new Scanner();
    static int mod = 1000000007;
    static int inf = 0x7ffffff;

    void solve() {
        int n = scanner.nextInt();
        int t = scanner.nextInt();
        int[][] ab = new int[n][2];
        for (int i = 0; i < n; i++) {
            ab[i][0] = scanner.nextInt();
            ab[i][1] = scanner.nextInt();
        }
        Arrays.sort(ab, Comparator.comparingInt(array -> array[0]));
        int[][] dp1 = new int[6006][n + 1];
        int[][] dp2 = new int[6006][n + 1];
        for (int i = 1; i < 6006; i++) {
            for (int j = 0; j < n; j++) {
                if (0 <= i - ab[j][0]) {
                    dp1[i][j + 1] = dp2[i][j + 1] = dp2[i - ab[j][0]][j] + ab[j][1];
                }
            }
            for (int j = 1; j <= n; j++) {
                dp2[i][j] = Math.max(dp2[i][j - 1], dp2[i][j]);
            }
        }
        int max = 0;
        for (int i = 0; i < 6006; i++) {
            for (int j = 0; j < n; j++) {
                if (i - ab[j][0] < t) {
                    max = Math.max(max, dp1[i][j + 1]);
                }
            }
        }
        System.out.println(max);
    }

    public static void main(String[]$) throws Exception {
        new Main().solve();
        System.out.flush();
    }
}

class System {
    static PrintWriter out = new PrintWriter(java.lang.System.out);

    static void exit() {
        java.lang.System.exit(0);
    }
}

class Scanner {
    private BufferedReader reader = new BufferedReader(new InputStreamReader(java.lang.System.in), 0x10000);
    private StringTokenizer tokenizer;

    String next() {
        try {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                tokenizer = new StringTokenizer(reader.readLine());
            }
        } catch (IOException ignored) {
        }
        return tokenizer.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    char[][] nextCharArray(int n, int m) {
        char[][] a = new char[n][m];
        for (int i = 0; i < n; i++) {
            a[i] = next().toCharArray();
        }
        return a;
    }

    int[] nextIntArray(int n) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextInt();
        }
        return a;
    }

    int[] nextIntArray(int n, IntUnaryOperator op) {
        int[] a = new int[n];
        for (int i = 0; i < n; i++) {
            a[i] = op.applyAsInt(nextInt());
        }
        return a;
    }

    long[] nextLongArray(int n) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = nextLong();
        }
        return a;
    }

    long[] nextLongArray(int n, LongUnaryOperator op) {
        long[] a = new long[n];
        for (int i = 0; i < n; i++) {
            a[i] = op.applyAsLong(nextLong());
        }
        return a;
    }
}


Measured memory_bytes: 184148
// {{{ Templates
#include <bits/stdc++.h>

#define show(x) cerr << #x << " = " << x << endl

using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vi = vector<int>;

template <typename T>
ostream& operator<<(ostream& os, const vector<T>& v)
{
    os << "sz:" << v.size() << "\n[";
    for (const auto& p : v) {
        os << p << ",";
    }
    os << "]\n";
    return os;
}

template <typename S, typename T>
ostream& operator<<(ostream& os, const pair<S, T>& p)
{
    os << "(" << p.first << "," << p.second
       << ")";
    return os;
}


constexpr ll MOD = (ll)1e9 + 7LL;

template <typename T>
constexpr T INF = numeric_limits<T>::max() / 100;

// }}}

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

    int N;
    cin >> N;
    vector<int> a(N, 0);
    for (int i = 0; i < N; i++) {
        cin >> a[i];
        a[i]--;
    }

    int cnt = 0;
    for (int i = 0; i < N; i++) {
        if (a[a[i]] == i) {
            cnt++;
        }
    }
    cout << cnt / 2 << endl;

    return 0;
}


Measured memory_bytes: 640
import java.util.Scanner;

public class Main {
    
    static Node NIL;
    static Node root;
    static StringBuilder sb;

    public static void main(String[] args) {
        
        Scanner sc = new Scanner(System.in);
        
        NIL = new Node(-1);
        root = NIL;
        sb = new StringBuilder();
        int m = Integer.parseInt(sc.next());
        
        for(int i = 0; i < m; i++){
            String s = sc.next();
            switch (s) {
                case "insert":
                    intsert(Integer.parseInt(sc.next()));
                    break;
                case "find":
                    int key = Integer.parseInt(sc.next());
                    if(find(root, key) != NIL){
                        sb.append("yes").append(System.lineSeparator());
                    }else{
                        sb.append("no").append(System.lineSeparator());
                    }   break;
                case "print":
                    inPerse(root);
                    sb.append(System.lineSeparator());
                    prePerse(root);
                    sb.append(System.lineSeparator());
                    break;
                default:
                    break;
            }
        }
        System.out.print(sb);
    }
    
    static void intsert(int key){
        
        Node y = NIL;
        Node x = root;
        Node z = new Node(key);
        
        while(x != NIL){
            y = x;
            if(z.key < x.key){
                x = x.left;
            }else{
                x = x.right;
            }
        }
        z.parent = y;
        
        if(y == NIL){
            root = z;
        }else if(z.key < y.key){
            y.left = z;
        }else{
            y.right = z;
        }
    }
    
    static Node find(Node x, int key){
        
        while(x != NIL && key != x.key){
            if(key < x.key){
                x = x.left;
            }else{
                x = x.right;
            }
        }
        return x;
    }
    
    static void prePerse(Node u){
        
        if(u == NIL) return;
        sb.append(" ").append(u.key);
        prePerse(u.left);
        prePerse(u.right);
    }
    
    static void inPerse(Node u){
        
        if(u == NIL) return;
        inPerse(u.left);
        sb.append(" ").append(u.key);
        inPerse(u.right);
    }
    
    static class Node {
        int key;
        Node parent, left, right;

        public Node(int key) {
            this.key = key;
            parent = NIL;
            left = NIL;
            right = NIL;
        }
    }
}


Measured memory_bytes: 203228
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define inf 1001001001
#define mod 1000000007
#define pi 3.141592653589793
ll gcd(ll a,ll b){
    if(b>a) swap(a,b);
    if(b==0) return a;
    return gcd(b,a%b);
}
ll lcm(ll a,ll b){
    ll g=gcd(a,b);
    return a/g*b;
}

ll rep_jijo(ll n,ll x){
    if(x==0) return 1;
    if(x%2==0){
        ll t=rep_jijo(n,x/2);
        return t*t%mod;
    }
    return n*rep_jijo(n,x-1)%mod;
}
ll com(ll n,ll r){
    ll x=1,y=1;
    ll tmp=n;
    while(tmp>=n-r+1){
        x=x*tmp%mod;
        tmp--;
    }
    while(r>0){
        y=y*r%mod;
        r--;
    }
    return x*rep_jijo(y,mod-2)%mod;
}

int main (){
    int n,m;
    ll ans=0;
    cin >> n >> m;
    map<ll,ll>mp;
    rep(i,n){
        ll a;
        cin >> a;
        mp[a]++;
    }
    rep(i,m){
        ll b,c;
        cin >> b >> c;
        mp[c]+=b;
    }
    ll len=mp.size();
    ll i=len-1;
    vector<pair<ll,ll>>A(len);
    for(auto p:mp){
        A[i]=make_pair(p.first,p.second);
        i--;
    }
    int j=0;
    rep(i,n){
        ans+=A[j].first;
        A[j].second--;
        if(A[j].second<=0)j++;
    }
    cout << ans << endl;
    return 0;

}


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

int main(){
  int x, y;
  cin >> x >> y;
  string str = "No";

  
   for (int i = 0;i < x + 1;i++) {
      int total = 2 * x + 2 * i ;

     if(total == y){
        str = "Yes";
     }

   }
        
   

  cout << str << endl; 

}

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

#define FOR(i, a, b) for(ll i = (a); i < (ll)(b); i++)
#define REP(i, n) FOR(i, 0, n)
#define YYS(x, arr) for(auto& x: arr)
#define PW(x) (1LL<<(x))
#define SZ(x) ((ll)(x).size())

#define pb emplace_back
#define fi first
#define se second

using namespace std;

using ld = long double;
using ll = long long int;

const ll INF = (ll)1e9 + 10;
const ll INFLL = (ll)1e18 + 10;
const ll MOD = 1e9 + 7;

template<class T> T &chmin(T &a, const T &b){return a = min(a, b);}
template<class T> T &chmax(T &a, const T &b){return a = max(a, b);}
template<class T> void UNIQUE(vector<T> &a){a.erase(unique(a.begin(), a.end()), a.end());}

template<class S, class T> ostream& operator <<(ostream &os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator <<(ostream &os, const vector<T> v){
  for(int i = 0; i < v.size(); i++){if(i < 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator <<(ostream &os, const vector<vector<T>> v){
  for(int i = 0; i < v.size(); i++){if(i < 0){os << endl;} os << v[i];} return os;
}

ll in(){long long int x; assert(scanf("%lld", &x) == 1); return x;}
ld fin(){double x; assert(scanf("%lf", &x) == 1); return x;}
char yuyushiki[10000010]; string stin(){assert(scanf("%s", yuyushiki) == 1); return yuyushiki;}

// head

vector<int> G[100010];

int ans = -1;

int dfs(int x, int p = -1){
  vector<int> cnt(30);
  int chor = 0;
  YYS(w, G[x]){
    if(w == p){
      continue;
    }
    int res = dfs(w, x);
    chor |= res;
    REP(i, 30){
      if(res & PW(i)){
        cnt[i]++;
      }
    }
  }
  // cout << x << " " << chor << endl;
  int ma = -1;
  REP(i, 30){
    if(cnt[i] >= 2){
      chmax(ma, (int)i);
    }
  }
  FOR(i, ma+1, 30){
    if(cnt[i] == 0){
      chor |= PW(i);
      chor &= PW(30) - PW(i);
      chmax(ans, (int)i);
      // cout << x << " " << i << endl;
      return chor;
    }
  }
}

int main(){

  int n = in();
  REP(i, n-1){
    int a = in() - 1;
    int b = in() - 1;
    G[a].pb(b);
    G[b].pb(a);
  }

  dfs(0);

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


Measured memory_bytes: 21120
#include <iostream>
#include <algorithm>
#include <cmath>

using namespace std;

typedef long long ll;

int main()
{
    ll n, a, b, x;
    cin >> n >> a >> b >> x;
    ll ans = 0;
    for (ll i = 0; i < n - 1; i++)
    {
        ll nx;
        cin >> nx;
        ans += min((nx - x) * a, b);
        x = nx;
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <functional>
#include <map>
#include <queue>
#define REP(i,n) for(int (i)=0; (i)<(n); (i)++)
using namespace std;
using ll = long long;
ll MOD = 1e9+7;


int main(int argc, const char * argv[]) {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n,w,h;
    cin >> n >> w >> h;
    cout << (n-w+1)*(n-h+1)<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<functional>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<unordered_map>
#include<climits>
#include<cstdlib>
#include<cmath>
#include<string>
#include<iomanip>

using namespace std;

#define INF 1 << 29
#define LL long long int

LL const MOD = 1000000007;

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

    LL k;
    cin >> k;

    LL a = (k+49)/50;

    LL b = a+49;
    vector<LL> ans(50,b);
    for(LL i = 0; i < 50*a - k; i++){
        ans[i] -= 50;
        for(LL j = 0; j < 50; j++){
            if(i != j){
                ans[j]++;
            }
        }
    }

    cout << 50 << endl;

    for(LL i = 0; i < 50; i++){
        if(i > 0)cout << " ";
        cout << ans[i];
    }
    cout << endl;
    
    return 0;
}

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

int main(){
    string s;
    cin>>s;
    int n=s.size();
    int m=n/2;
    int ans=0;
    for(int i=0;i<m;i++){
        if(s.at(i) != s.at(n-i-1))ans++;
    }   
    cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
bool cmp(char a,char b){
	return a>b;
}
char a[120],b[120];
int main(){
	cin>>a>>b;
	sort(a,a+strlen(a));
	sort(b,b+strlen(b),cmp);
	if(strcmp(a,b)<0)cout<<"Yes\n";
	else cout<<"No\n";
	return 0;
}

Measured memory_bytes: 256
using namespace std;

#define visual

#ifdef visual
#include <iostream>
#include <fstream>
#include <vector>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <assert.h>
#include <functional>
#include <math.h>
#include <string>
#include <ctime>
#endif
#ifndef visual
#include <bits/stdc++.h>
#endif

typedef long long ll;


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

    int n;
    cin >> n;

    vector<bool> v;
    for (int i = 0; i < n; i++) {
        int x, y;
        cin >> x >> y;
        v.push_back(x == y);
    }
    for (int i = 0; i < n - 2; i++) {
        if (v[i] && v[i + 1] && v[i + 2]) {
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;

}


Measured memory_bytes: 3608
#include<iostream>
#include<cstring>
#include<cmath>

using namespace std;

#define IOS ios::sync_with_stdio(0);cin.tie(0);

int main(){
	IOS;
	string a,b;
	while(cin>>a>>b){
		a=a+b;
		int ans=0;
		for(int i=0;i<a.size();i++){
			ans+=(a[i]-'0')*pow(10,a.size()-i-1);
		}
		bool flag=false;
		for(int i=1;i<ans/2;i++){
			if( i*i == ans){
				flag=true;
				break;
			}
		}
		if(flag){
			cout<<"Yes"<<endl;
		}
		else{
			cout<<"No"<<endl;
		}
		
	}
	return 0;
}

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

Measured memory_bytes: 2688
import java.util.Scanner;

class Main{
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int a=sc.nextInt();
        int b=sc.nextInt();
        int c=sc.nextInt();
        int count=0;
        for(int i=a;i<=b;i++){
            if(c%i==0) count++;
        } 
        System.out.println(count);
    }
}


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

int main() {
  string str = "aiueo" ;
  char c ;
  cin >> c ;
  
    if ( c == str.at(0) ) {
      cout << "vowel" <<endl;
    }
  else if ( c == str.at(1) ){
    cout << "vowel" <<endl;
  }
  else if ( c == str.at(2) ){
    cout << "vowel" <<endl;
  }
  else if ( c == str.at(3) ){
    cout << "vowel" <<endl;
  }
  else if ( c == str.at(4) ){
    cout << "vowel" <<endl;
  }
  else {
    cout << "consonant" <<endl;
  }
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdint>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <unordered_map>
#include <unordered_set>

int main()
{
    int R;
    std::cin >> R;

    if (R < 1200) {
        std::cout << "ABC" << std::endl;
    } else if (R < 2800) {
        std::cout << "ARC" << std::endl;
    } else {
        std::cout << "AGC" << std::endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define mp make_pair
#define fi first
#define se second
#define eb emplace_back
using namespace std;
const int mod = 1e9 + 7;
const int maxn = 2e5 + 233;
string s;
ll f[1010][5],g[1010][5];
int main()
{
	cin>>s;
	int n = s.length();
	ll ans = 0;
	int k;cin>>k;
	if(k==1)ans += 9*(n-1);
	if(k==2){
		for(int i=2;i<n;i++)
			ans += 9*(i-1)*9;
	}
	if(k==3){
		for(int i=3;i<n;i++)
			ans += 9*9*9*(i-1)*(i-2)/2;
	}
//	cout << ans << endl;
	f[0][1] = 1;
	g[0][1] = s[0]-'1';
	for(int i=1;i<n;i++)
	for(int j=1;j<=k;j++){
		if(s[i]=='0'){
			f[i][j] = f[i-1][j];
			g[i][j] = g[i-1][j] + g[i-1][j-1]*9;
		}
		else{
			f[i][j] = f[i-1][j-1];
			g[i][j] = g[i-1][j] + f[i-1][j] + f[i-1][j-1]*(s[i]-'1') + g[i-1][j-1]*9;
		}
	}
//	cout<<"!"<<g[n-1][k]<<" "<<f[n-1][k]<<endl;
	ans += g[n-1][k]+f[n-1][k];
	cout << ans << endl; 
}


Measured memory_bytes: 256
//by Himanshu Shukla
#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
#define FASTIO ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0)
#define ll long long
#define v32 vector<int>
#define v64 vector<ll>
#define s32 set<int>
#define s64 set<ll>
#define graph vector<s32>
#define p32 pair<int,int>
#define p64 pair<ll,ll>
#define fi first
#define se second
#define ln '\n'
#define debug(x) cout << (#x) << ": " << (x) << ln
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
inline ll add(ll a, ll b, ll m) { return (((a % m + b % m) % m + m) % m); }
inline ll mul(ll a, ll b, ll m) { return (((a % m * b % m) % m + m) % m); }
const double EPS = 1e-6;
const ll MOD = 1e9 + 7;
template <typename T, typename U>
ostream& operator<<(ostream& out, const pair<T,U>& p){
	out << '[' << p.fi << ", " << p.se << ']';
	return out;
}
template <template <typename, typename...> class ContainerType, typename ValueType, typename ...Args>
void print_container(const ContainerType<ValueType, Args...>& c){
	cout << "{ ";
	for(const auto& v : c)
		cout << v << ' ';
	cout << '}' << ln;
}

int main()
{
	FASTIO;
	string str;
	cin >> str;
	int n = str.length();
	ll k = 1;
	string prev,temp;
	prev.push_back(str[0]);
	for(int i = 1;i < n;i++){
		temp.push_back(str[i]);
		if(temp == prev) continue;
		prev = temp;
		temp.clear();
		k++;
	}
	cout << k << ln;
	return 0;
}


Measured memory_bytes: 720
import java.util.Scanner;
public class Main {
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a =sc.nextInt();
        int b =sc.nextInt();
        int area = a*b;
        int length=2*(a+b);
        System.out.println(area+" "+length);
        sc.close();

    }
    
}


Measured memory_bytes: 26200
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<stack>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<numeric>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b));i>=((int)(a));i--)
typedef long long ll;
typedef pair<ll, ll> mp;
ll MOD = 1e9+7;
//LLONG_MIN

/*
*/
ll n,x[1010],a[1010][2];
vector<int> child[1010];

bool f(int s){
	bool ok=true;
	if(child[s].size()==0){
		a[s][0]=x[s];//色0
		a[s][1]=0;//色1
	}else{
		ok=false;
		int sum=0,dp[5010]={};
		dp[0]=1;
		rep(i,child[s].size()){
			int t=child[s][i],dp2[5010]={};
			if(!f(t))return false;
			sum+=a[t][0]+a[t][1];
			rep(j,5010){
				if(dp[j]==1){
					if(j+a[t][0]<5010)dp2[j+a[t][0]]=1;
					if(j+a[t][1]<5010)dp2[j+a[t][1]]=1;
				}
			}
			rep(j,5010)dp[j]=dp2[j];
		}
		ireg(j,0,x[s]){
			if(dp[j]==1){//x[s]に一番近いやつを採用
				a[s][0]=x[s];//何故なら，ここが固定であることから，
				a[s][1]=sum-j;//ここを最小化するのが最適なので
				ok=true;
				break;
			}
		}
	}
	return ok;
}

int main(void){
	cin>>n;
	reg(i,1,n-1){
		int p;
		cin>>p;
		child[p-1].push_back(i);//0-originにする（1敗）
	}
	rep(i,n)cin>>x[i];
	cout<<(f(0)?"POSSIBLE":"IMPOSSIBLE")<<endl;
	// rep(i,n)cout<<a[i][0]<<","<<a[i][1]<<endl;
	return 0;
}

Measured memory_bytes: 17024
using System;

public class Program {
    public static void Main() {
        int n = int.Parse(Console.ReadLine());
        int max = int.MinValue;
        int min = int.MaxValue;
        int[] r = new int[n];
        for (int i = 0; i < n; i++) {
            r[i] = int.Parse(Console.ReadLine());
            max = Math.Max(max, r[i]-min);
            min = Math.Min(min, r[i]);
        }
        Console.WriteLine(max);
    }
}

Measured memory_bytes: 10892
#include<algorithm>
#include<array>
#include<cmath>
#include<iostream>
#include<iomanip>
#include<iso646.h>
#include<queue>
#include<stack>
#include<string>
#include<vector>

using std::cin;
using std::cout;
using std::endl;
using std::string;
using std::vector;

#define FOR(counter,initial_value,condition) for(int counter = initial_value; counter < condition;counter++)


int main()
{
	int w, h, n;
	vector<int> a;
	vector<int> x;
	vector<int> y;
	cin >> w >> h >> n;
	a.resize(n);
	x.resize(n);
	y.resize(n);
	fill(a.begin(), a.end(), 0);
	fill(x.begin(), x.end(), 0);
	fill(y.begin(), y.end(), 0);
	FOR(i, 0, n) {
		cin >> x[i] >> y[i] >> a[i];
	}
	int left=0, right=w, bot=0, top=h;
	FOR(i, 0, n) {
		if (a[i] == 1) {
			left = std::max(left, x[i]);
		}
		if (a[i] == 2) {
			right = std::min(right, x[i]);
		}
		if (a[i] == 3) {
			bot = std::max(bot, y[i]);
		}
		if (a[i] == 4) {
			top = std::min(top, y[i]);
		}
	}
	if (right - left < 0 or top - bot < 0) {
		cout << 0 << endl;
		return 0;
	}
	cout << (right - left)*(top - bot) << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i,n) for (int (i) = 0; (i) < (n); i++)
#define ll long long
using namespace std;
int main() {
  ll a,b,c,d; cin >> a >> b >> c  >> d;
  cout << max(a*b,c*d);
}

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

#define fi first
#define se second
#define pb push_back
#define sz(a) (int)(a).size()
#define mp(a, b) make_pair((a), (b))
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;

const ll MOD = 1e9 + 7;
const ll INF = 1e18;
const ll IINF = INT_MAX;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    string s;
    cin >> s;
    int tot = 0;
    for (int i = 0; i < sz(s); i++) {
        int cur = s[i] - '0';
        tot += cur;
        tot %= 9;
    }
    cout << (tot == 0 ? "Yes" : "No") << '\n';
    return 0;
}

Measured memory_bytes: 3740
#include <bits/stdc++.h>
#define ll long long
#define rep(X,N) for(ll X = 0; X < (N); X++)
#define pback push_back
#define mpair make_pair
#define MODN 1000000007

using namespace std;



int main(){

    string s;
    cin >> s;
    vector<int> ans;
    vector<int> v;
    int ssize = s.size();

    rep(i,ssize){
        ans.pback(0);
        v.pback(0);
    }

    int index = 0;

    while(index < ssize){

        //Rの個数を探査
        int count = 0;
        int tmpindex = index;
        while(s[tmpindex] == 'R'){
            count++;
            v[tmpindex] = count;
            tmpindex++;
        }

        for(int i = index; i < index + count; i++){
            v[i] = count - v[i];
        }

        //indexはRの隣がLになったところを示している
        index = tmpindex;

        //必ず最後の文字がLのためここでbreakする条件などは考えなくてよい

        //同様にLの個数を探査
        count = 0;

        while(s[tmpindex] == 'L'){
            count++;
            v[tmpindex] = -1 * (count - 1);
            tmpindex++;
            if(tmpindex == ssize) break;
        }
        index = tmpindex;
    }

    //ここまでの処理でvがRLからの距離が入力された配列となる
    //v[i]の値が奇数ならもうひとつずらす処理をする
    /*
    rep(i,ssize){
        cerr << v[i] << " ";
    }*/
    
    rep(i,ssize){
        int d = v[i];

        if(abs(d) % 2 == 1){
            if(d > 0){
                d = d + 1;
            }else d = d - 1;
        }

        ans[i + d]++;
    }

    rep(i,ssize){
        cout << ans[i] << " ";
    }

    cout << endl;



    return 0;

}

Measured memory_bytes: 1524
#include <bits/stdc++.h>
#define N 100005
using namespace std;
int n, m, i, j, u[N], v[N], c[N];
long long k, s, ans;
struct AI{
	int a, i;
	bool operator < (const AI &A) const{
		return a > A.a;
	}
} a[N], b[N];
//int byi(AI a, AI b){
//	if(a.i == b.i) return a.a > b.a;
//	return a.i < b.i;
//}
//int bya(AI a, AI b){
//	if(a.a == b.a) return a.i < b.i;
//	return a.a > b.a;
//}
int main(){
	scanf("%d%d", &n, &m);
	for(i=1; i<=n; i++){
		scanf("%d%d", &a[i].i, &a[i].a);
	}
//	memcpy(b, a, sizeof(a));
//	sort(a+1, a+n+1, byi);
//	sort(b+1, b+n+1, bya);
	sort(a+1, a+n+1);
	for(i=1; i<=n; i++){
		if(!u[a[i].i]){
			v[i] = u[a[i].i] = 1;
			c[++k] = i;
			s += a[i].a;
			if(k == m) break;
		}
	}
	for(i=1; i<=n; i++){
		if(v[i]) continue;
		if(k < m) m--, s += a[i].a, v[i] = 1;
	}
	ans = s + k * k;
	for(i=1; i<=n; i++){
		if(v[i]) continue;
		if(a[i].a <= a[c[k]].a) break;
		s += a[i].a - a[c[k--]].a;
		if(s+k*k > ans) ans = s + k*k;
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 2048
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int M=55;
int n,p,x,ans;
ll dp[M][2],A[M];
int main(){
	scanf("%d %d",&n,&p);
	for(int i=1;i<=n;i++)cin>>A[i];
	for(int i=1;i<=n;i++)dp[i][A[i]%2]=1;
	dp[0][0]=1;
	for(int i=1;i<=n;i++){
		for(int k=0;k<2;k++){
			for(int j=i-1;j>=0;j--){
				if(A[i]%2==0)dp[i][k]+=dp[j][k];
				else dp[i][k]+=dp[j][!k];
			}
		}
	}
	printf("%lld\n",dp[n][p]);
	return 0;
}

Measured memory_bytes: 256
/*----------------by syr----------------*/
#include<algorithm>
#include<bitset>
#include<cctype>
#include<cstring>
#include<cstdlib>
#include<deque>
#include<fstream>
#include<functional>
#include<iomanip>
#include<iostream>
#include<iterator>
#include<limits>
#include<list>
#include<map>
#include<math.h>
#include<queue>
#include<set>
#include<stack>
#include<stdio.h>
#include<sstream>
#include<string>
#include<time.h>
#include<utility>
#include<vector>

using namespace std;

const int INF=1e9+7;

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

bool check(int x){
//	printf("%d\n",x);
	for(int i=1;i<=n;i++) if(a[i]>=x) b[i]=1;else b[i]=0;
//	for(int i=1;i<=n;i++) printf("%d ",b[i]);
//	puts("");
	int l=1,r=1;
	if(b[1]==b[2]){
		while(true){
			while(b[r]==b[r+1]&&r+1<=n) ++r;
//			printf("l=%d r=%d\n",l,r);
			if(l<=m&&r>=m){
				if(b[r]==1) return 1;
				else return 0;
			}
			l=r;
			while(b[r]!=b[r+1]&&r+1<=n) ++r;
			if(l<=m&&r>=m){
				if(m<=(l+r)>>1) return b[l];
				else return b[r];
			}
			l=r;
		}
	}else{
		while(true){
			while(b[r]!=b[r+1]&&r+1<=n){
				++r;
			}
//			printf("l=%d r=%d\n",l,r);
			if(l<=m&&r>=m){
				if(m<=(l+r)>>1) return b[l];
				else return b[r];
			}
			l=r;
			while(b[r]==b[r+1]&&r+1<=n) ++r;
			if(l<=m&&r>=m){
				if(b[r]==1) return 1;
				else return 0;
			}
			l=r;
		}
	}
	return false;
}

int main(){
	scanf("%d",&m);
	n=(m<<1)-1;
	for(int i=1;i<=n;i++) scanf("%d",a+i);
	int lb=1,rb=n+1;
	while(lb+1<rb){
		int md=(lb+rb)>>1;
		if(check(md)) lb=md;
		else rb=md;
	}
	printf("%d\n",lb);
	return 0;
}


Measured memory_bytes: 1792
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <string>
#include <queue>
#include <algorithm>
#include <map>
#include <cmath>
#include <numeric>
#include <list>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cstring>

#define rep(i, n) for (int i = 0; i < n; i++)
#define rep1(i, n) for (int i = 1; i <= n; i++)
#define show(a, n) rep(i,n) {cout<<a[i]<<' ';} cout<<endl;

using namespace std;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef long long ll;
typedef pair<long long, long long> pll;

const int INF = 1 << 30;
const long long INFL = 1LL << 62;
const int MOD = 1000000007;
const int MAX = 100000;
const int N = 100000;

ll gcd(ll a, ll b) {
    if (b==0) return a;
    else return gcd(b,a%b);
}

ll lcm(ll a, ll b) {
    return a/gcd(a,b)*b;
}

ll no_div(ll a, ll c, ll d) {
	return a - a / c - a / d + a / lcm(c, d);
}

int main() {
	ll a, b, c, d;
	cin >> a >> b >> c >> d;
	cout << no_div(b, c, d) - no_div(a - 1, c, d) << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <climits>
#include <set>
#include <algorithm>
#include <unordered_map>
#include <queue>
#include <iomanip>
#include <map>
#include <utility>
#include <numeric>
#include <chrono>
#include <ctime>

#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define P pair<int, int>
#define debug(x) cerr << #x << ": " << x << ", "
#define debugln(x) cerr << #x << ": " << x << '\n'

using namespace std;
using ll = long long;
const int mod = 1e9+7;

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

  int N, K; cin >> N >> K;
  vector<int> h(N);
  rep(i, N) {
    cin >> h.at(i);
  }
  sort(h.begin(), h.end());
  int ans = INT_MAX;
  for(int i=0; i<=N-K; i++) {
    ans = min(ans, h.at(i+K-1) - h.at(i));
  }
  cout << ans << endl;
}

Measured memory_bytes: 768
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <deque>
#include <algorithm>
#include <cmath>
#include <cstring>

using namespace std;

#define REP(i,n) for(int i = 0; i < n; i++)
#define RREP(i,n) for(int i = n - 1; i >= 0; i--)

#define ALL(v) v.begin(),v.end()
#define pb push_back
#define mp make_pair
#define F first
#define S second

#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

#define y0 y3487465
#define y1 y8687969

#define m0(x) memset(x,0,sizeof(x))
#define m1(x) memset(x,63,sizeof(x))

typedef long long ll;
typedef pair<int,int> pi;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pi> vpi;
typedef vector<ll> vll;
typedef vector<vll> vvll;

double EPS = 1e-9;
int INFi = 1000000005;
long long INFll = 1000000000000000005ll;
double PI = acos(-1);
int dirx[8] = {-1,0,0,1,-1,-1,1,1};
int diry[8] = {0,1,-1,0,-1,1,-1,1};
ll MOD = 1000000007;

int N;
const int MAX_N = 100000;
ll A[MAX_N]; 

int main(){
  cin >> N;
  REP(i, N) cin >> A[i];
  ll ans = 0;
  REP(i, N - 1) {
    if(A[i] % 2 == 1 && A[i + 1] > 0) {
      A[i]--;
      A[i + 1]--;
      ans++;
    }
  }
  REP(i, N) {
    ans += A[i] / 2;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;
bool isPalindrome(string x){
	
}

int main(){
	string S;
	cin >> S;
	int  N = S.size()/2;
	for(int x=0;x<N;x++){
		if(S[x]!=S[S.length()-1-x]){
			cout << "No";
			return 0;
		}
	}
	N = (S.size()-1)/2;
	for(int x=0;x<N/2;x++){
		if(S[x]!=S[N-1-x]){
			cout << "No";
			return 0;
		}
	}
	N = (S.size()+3)/2-1;
	for(int x=N;x<S.size()-1;x++){
		if(S[x]!=S[N+S.size()-1-x]){
			cout << "No";
			return 0;
		}
	}
	cout << "Yes";

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i=0; i<(n); i++)
int main()
{
    int a, b, k;
    cin >> a >> b >> k;

    vector<int> v;
    for(int i=1; i <= max(a, b); i++){
        if(a%i == 0 && b%i == 0){
            v.push_back(i); 
        }
    }

    cout << v[v.size()-k];

    return 0;
}

Measured memory_bytes: 256
n = int(input())
p = [0] * (n + 1)
for i in range(1, n + 1):
    r, c = [int(v) for v in input().split()]
    p[i-1] = r
    p[i] = c

N_MAX = 100
M_MAX = 1 << 21
m = [[-1] * (n+1) for i in range(n+1)]

for i in range(1, n + 1):
    m[i][i] = 0

for l in range(2, n+1):
    for i in range(1, n - l + 2):
        j = i + l - 1
        m[i][j] = M_MAX
        for k in range(i, j):
            m[i][j] = min(m[i][j], m[i][k] + m[k+1][j] + p[i-1] * p[k] * p[j])

print(m[1][n])


Measured memory_bytes: 5680
n = int(input())
p = list(map(int,input().split()))
ans = 0
for i in range(n-2):
  a = [p[i],p[i+1],p[i+2]]
  if p[i]<p[i+1]<p[i+2] or p[i]>p[i+1]>p[i+2]:
    ans += 1
print(ans)


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

namespace ABC064C
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string[] vals = Console.ReadLine().Split(' ');

            int hai = 0;
            int cha = 0;
            int midori = 0;
            int mizu = 0;
            int ao = 0;
            int ki = 0;
            int daidai = 0;
            int aka = 0;

            int overR = 0;

            int a;
            for(int i=0; i < N; i++)
            {
                a = int.Parse(vals[i]);

                if(1 <= a && a <= 399)
                {
                    hai = 1;
                }
                else if(400 <= a && a <= 799)
                {
                    cha = 1;
                }
                else if(800 <= a && a <= 1199)
                {
                    midori = 1;
                }
                else if(1200 <= a && a <= 1599)
                {
                    mizu = 1;
                }
                else if(1600 <= a && a <= 1999)
                {
                    ao = 1;
                }
                else if(2000 <= a && a <= 2399)
                {
                    ki = 1;
                }
                else if(2400 <= a && a <= 2799)
                {
                    daidai = 1;
                }
                else if(2800 <= a && a <= 3199)
                {
                    aka = 1;
                }
                else if(3200 <= a)
                {
                    overR++;
                }
            }

            int num = hai + cha + midori + mizu + ao + ki + daidai + aka;

            //int max = Math.Min(num + overR, 8);
            int max = num + overR;


            if(num == 0 && overR >= 1)
            {
                num = 1;
            }

            Console.WriteLine("{0} {1}", num, max);

        }
    }
}


Measured memory_bytes: 13140
/**
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⡀⠀⠀⠀⠀⢀⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⣠⡖⠁⠀⠀⠀⠀⠀⠀⠈⢲⣄⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⠀⣼⡏⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢹⣧⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣸⣿⠁⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠈⣿⣇⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⣿⣿⡇⠀⢀⣀⣤⣤⣤⣤⣀⡀⠀⢸⣿⣿⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⠀⠀⠀⢻⣿⣿⣔⢿⡿⠟⠛⠛⠻⢿⡿⣢⣿⣿⡟⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠀⣀⣤⣶⣾⣿⣿⣿⣷⣤⣀⡀⢀⣀⣤⣾⣿⣿⣿⣷⣶⣤⡀⠀⠀⠀⠀
⠀⠀⢠⣾⣿⡿⠿⠿⠿⣿⣿⣿⣿⡿⠏⠻⢿⣿⣿⣿⣿⠿⠿⠿⢿⣿⣷⡀⠀⠀
⠀⢠⡿⠋⠁⠀⠀⢸⣿⡇⠉⠻⣿⠇⠀⠀⠸⣿⡿⠋⢰⣿⡇⠀⠀⠈⠙⢿⡄⠀
⠀⡿⠁⠀⠀⠀⠀⠘⣿⣷⡀⠀⠰⣿⣶⣶⣿⡎⠀⢀⣾⣿⠇⠀⠀⠀⠀⠈⢿⠀
⠀⡇⠀⠀⠀⠀⠀⠀⠹⣿⣷⣄⠀⣿⣿⣿⣿⠀⣠⣾⣿⠏⠀⠀⠀⠀⠀⠀⢸⠀
⠀⠁⠀⠀⠀⠀⠀⠀⠀⠈⠻⢿⢇⣿⣿⣿⣿⡸⣿⠟⠁⠀⠀⠀⠀⠀⠀⠀⠈⠀
⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⢀⣼⣿⣿⣿⣿⣧⡀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀
⠀⠀⠀⠐⢤⣀⣀⢀⣀⣠⣴⣿⣿⠿⠋⠙⠿⣿⣿⣦⣄⣀⠀⠀⣀⡠⠂⠀⠀⠀
⠀⠀⠀⠀⠀⠈⠉⠛⠛⠛⠛⠉⠀⠀⠀⠀⠀⠈⠉⠛⠛⠛⠛⠋⠁⠀⠀
 *    author:  Daredevil666
 *    institution: IIT Patna
**/
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define nl cout<<"\n";
#define ll long long int
#define REP(i,a,n) for(i=a;i<=n;i++)
#define F(i,a,b) for(i=a;i<b;i++)
#define RF(i,b,a) for(i=b;i>=a;i--)
#define IOS  ios::sync_with_stdio(false);cin.tie(0);
using namespace std;
const ll mod=1e9+7;
const ll MAXN=100200;
ll i,j,mask,test;
int main()
{
IOS
/*#ifndef ONLINE_JUDGE
   freopen("input.txt","r",stdin);
   freopen("output.txt","w",stdout);
#endif // ONLINE_JUDGE*/
string s="ACL",p="";
ll k;
cin>>k;
F(i,0,k)
{
    p+=s;
}
cout<<p;
return 0;
}


Measured memory_bytes: 3652
import sys
import math

a,b,x = list(map(int, input().split()))

sq = a*a*b

if sq/2 == x:
    print("45.00000000")

elif sq/2 > x:
    t = (x*2)/(a*b)
    d = math.atan(b/t)
    print(math.degrees(d))

else:
    t = 2*b - (2*x)/(a*a)
    d = math.atan(t/a)
    print(math.degrees(d))


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

vector<int> G[26];
bool flag[26];
bool visited[26];
int degree[26];

void dfs(int v) {
    visited[v] = true;
    
    for (int i=0; i<G[v].size(); i++) {
        if (!visited[G[v][i]]) {
            dfs(G[v][i]);
        }
    }
}

int main() {
    while (true) {
        int n; cin >> n;
        
        if (n==0) {
            break;
        }
        
        for (int i=0; i<26; i++) {
            G[i].clear();
        }
        
        for (int i=0; i<26; i++) {
            flag[i] = false;
            visited[i] = false;
            degree[i] = 0;
        }
        
        int s, t;
        
        for (int i=0; i<n; i++) {
            string w; cin >> w;
            s = w[0]-'a';
            t = w[w.size()-1]-'a';
            G[s].push_back(t);
            flag[s] = true;
            flag[t] = true;
            degree[s]++;
            degree[t]--;
        }
        
        dfs(s);
        
        bool judge = true;
        
        for (int i=0; i<26; i++) {
            if (flag[i] && !visited[i]) {
                judge &= false;
            }
            
            if (degree[i]!=0) {
                judge &= false;
            }
        }
        
        if (judge) {
            cout << "OK" << endl;
        }
        else {
            cout << "NG" << endl;
        }
    }
}


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

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using LL = long long;
using VL = vector<LL>;
using VVL = vector<VL>;
using PLL = pair<LL, LL>;
using VS = vector<string>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))

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

#define FF first
#define SS second
template<class S, class T>
istream& operator>>(istream& is, pair<S,T>& p){
  return is >> p.FF >> p.SS;
}
template<class S, class T>
ostream& operator<<(ostream& os, const pair<S,T>& p){
  return os << p.FF << " " << p.SS;
}
template<class T>
void maxi(T& x, T y){
  if(x < y) x = y;
}
template<class T>
void mini(T& x, T y){
  if(x > y) x = y;
}


const double EPS = 1e-10;
const double PI  = acos(-1.0);
const LL MOD = 1e9+7;

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

  string S;
  cin >> S;
  int ans = 0;
  VI cnt(26);
  int N = SZ(S);
  REP(i,N) cnt[S[i]-'a']++;

  REP(i,26) ans += cnt[i] % 2;
  cout << ans/2 << endl;

  return 0;
}

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

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;

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

  cout << fixed << setprecision(10);

  int a, b, h, m;
  cin >> a >> b >> h >> m;
  double ax = a * cos(2.0 * M_PI * (h * 60 + m) / 720);
  double ay = a * sin(2.0 * M_PI * (h * 60 + m) / 720);
  double bx = b * cos(2.0 * M_PI * m / 60);
  double by = b * sin(2.0 * M_PI * m / 60);
  double dx = ax - bx;
  double dy = ay - by;
  cout << sqrt(dx * dx + dy * dy) << endl;
}

Measured memory_bytes: 4104