akhauriyash/Code-Regression huggingface dataset:
#include <algorithm>
#include <cmath>
#include <complex>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>
#include <functional>
#include <cstring>
#include <regex>
#include <random>
#include <cassert>
using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repr(i, s, n) for (int i = (s); i < (int)(n); i++)
#define revrep(i, n) for (int i = (n) - 1; i >= 0; i--)
#define revrepr(i, s, n) for (int i = (n) - 1; i >= s; i--)
#define debug(x) cerr << #x << ": " << x << "\n"

using ll = long long;
using P = pair<int, int>;

const long long MOD = 1e9+7;

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

template<class T>
istream& operator >>(istream &is, vector<T> &v) {
    for (int i = 0; i < (int)v.size(); i++) cin >> v.at(i);
    return is;
}

template<class T>
void print(const vector<T> &v, const string &delimiter) { rep(i, v.size()) cout << (0 < i ? delimiter : "") << v.at(i); cout << endl; }

template<class T>
void print(const vector<vector<T>> &vv, const string &delimiter) { for (const auto &v: vv) print(v, delimiter); }

const int MAX_V = 100000;
int par[MAX_V];
int depth[MAX_V];
int num[MAX_V];

void init(int n) {
    for(int i = 0; i < n; i++) {
        par[i] = i;
        depth[i] = 0;
        num[i] = 1;
    }
}

int root(int x) {
    if (par[x] == x) return x;
    else return par[x] = root(par[x]);
}

void unite(int x, int y) {
    x = root(x);
    y = root(y);
    if (x == y) return;

    num[x] += num[y];
    num[y] = num[x];

    if (depth[x] < depth[y]) par[x] = y;
    else {
        par[y] = x;
        if (depth[x] == depth[y]) depth[x]++;
    }
}

bool same(int x, int y) {
    return root(x) == root(y);
}

int get_num(int x) {
    return num[root(x)];
}

int main() {
    int n, m, k;
    cin >> n >> m >> k;
    init(n);

    vector<vector<int>> friend_lists(n);
    rep(i, m) {
        int a, b;
        cin >> a >> b;
        a--; b--;

        unite(a, b);

        friend_lists.at(a).push_back(b);
        friend_lists.at(b).push_back(a);
    }

    vector<vector<int>> block_lists(n);
    rep(i, k) {
        int c, d;
        cin >> c >> d;
        c--; d--;
        block_lists.at(c).push_back(d);
        block_lists.at(d).push_back(c);
    }

    vector<int> ans(n);
    rep(i, n) {
        int cnt = get_num(i) - 1;
        
        for (int b: block_lists.at(i)) {
            if (same(i, b)) cnt--;
        }
        
        for (int f: friend_lists.at(i)) {
            if (same(i, f)) cnt--;
        }

        ans.at(i) = cnt;
    }

    print(ans, " ");
}

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

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int h, w, n;
	cin >> h >> w >> n;
	int ma = max(h, w);
	int ans = (n + ma - 1) / ma;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3656
#pragma region header
#include <algorithm>
#include <bitset>
#include <tuple>
#include <cstdint>
#include <cctype>
#include <assert.h>
#include <time.h>
#include <stdlib.h>
#include <stdio.h>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <ctime>
#include <deque>
#include <fstream>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <limits>
#include <map>
#include <memory>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
#include <math.h>
#include <cstring>
#include <array>
// ===============================================================
//using系
#pragma region header
using namespace std;
using lint = long long;
using ld = long double;
using ulint = unsigned long long;
const int dx[] = { 1,0,-1,0 };
const int dy[] = { 0,1,0,-1 };
constexpr lint mod = 1000000007;
constexpr long double pi = 3.141592653589793238462643383279;
#pragma endregion
// ========================================================================
//define
#define INF (lint)10000000000000000;
#define mod (int)1000000007
#pragma region header
template <class T, class U>
inline bool chmin(T& lhs, const U& rhs) {
	if (lhs > rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
template <class T, class U>
inline bool chmax(T& lhs, const U& rhs) {
	if (lhs < rhs) {
		lhs = rhs;
		return 1;
	}
	return 0;
}
#pragma endregion
#pragma endregion
lint gcd(lint a, lint b) {
	if (a % b == 0)
		return b;
	else
		return gcd(b, a % b);
}



int main(void) {
	ios::sync_with_stdio(false);
	cin.tie(0);
	int a; cin >> a;
	if (a == 0) cout << 1 << endl;
	else cout << 0 << endl;

	return 0;
}

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

const int MAX = 200002;
const int mod = 1e9 + 7;

// fac[]・・・a! finv[]・・・(a!)^(-1) inv[]・・・a^(-1)

long long fac[MAX], finv[MAX], inv[MAX];

void pre_comb(void){
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for(int i=2; i<MAX; i++){
		fac[i] = fac[i-1] * i % mod;
		inv[i] = mod - inv[mod%i] * (mod/i) % mod;
		finv[i] = finv[i-1] * inv[i] % mod;
	}
}

long long comb(int n, int k){
	if(n < k) return 0;
	if(n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n-k] % mod) % mod;
}


int main(){
	ll N, M, K; cin >> N >> M >> K;
	ll ans = 0;
	pre_comb();
	for(int dx=1; dx<M; dx++){
		ll pat = N * N * (M-dx) % mod;
		ans = (ans + (pat * comb(N*M-2, K-2) % mod) * dx) % mod;
	}
	for(int dy=1; dy<N; dy++){
		ll pat = M * M * (N-dy) % mod;
		ans = (ans + (pat * comb(N*M-2, K-2) % mod) * dy) % mod;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 4992
#include<cstdint>
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cmath>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<deque>
#include<stack>
#include<iterator>
#include<stack>
#include<cctype>
#include<climits>
#include<string>
#include<bitset>
#include<cfloat>
#include<iomanip>
#include<numeric>
#include<utility>
#include<initializer_list>


#define repi(i,start,end)for(int64_t (i)=(start);(i)<(end);++(i))
#define rep(i,end) repi((i),0,(end))
#define rfor(x, v) for(auto& (x) : (v))
#define iterate(itr, v) for(auto (itr)=(v).begin();(itr)!=(v).end();++(itr))
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
#define vin(v) rep(i,(v).size()) cin >> (v)[i];
#define vpin(v) rep(i,(v).size()) cin >> (v)[i].first >> (v)[i].second

using namespace std;
using Int = int64_t;
using pint = pair<Int, Int>;
using vint = vector<Int>;
using vvint = vector<vint>;
using vpint = vector<pint>;
using vstr = vector<string>;

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;  }
template<class T>void println(T a){cout << a << "\n";}
template<class T>void put_line(T &v){iterate(itr,v){cout<<*itr<<((itr==--v.end())?"\n":" ");}}
// auto [x, y] = make_tuple(3, 4); => let (x, y) = (3, 4);


int main(void) {
    int n; cin >> n;
    vstr w(n); vin(w);
    set<string> s;
    rep(i, n) s.insert(w[i]);
    if(s.size() != n) {
        println("No");
        return 0;
    }
    char start = w[0].back();
    rep(i, n - 1) {
        if(w[i + 1][0] != start) {
            println("No");
            return 0;
        }
        start = w[i + 1].back();
    }
    println("Yes");


    return 0;
}


Measured memory_bytes: 256
while True:
    a, b = map(int, input().split())
    if a == 0 and b == 0:
        break
    else:
        for i, _ in enumerate(range(a)):
            if i == 0 or i == (a - 1):
                x = '#' * b
                print(x)
            else:
                print('#' + '.' * (b - 2) + '#')
        print()


Measured memory_bytes: 5612
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pb push_back
#define fi first
#define se second
typedef pair<ll,ll> P;
#define Mod 1000000007
using VP = vector<P>; using VVP = vector<VP>;
using VI = vector<ll>; using VVI = vector<VI>; using VVVI = vector<VVI>;
#define INF 1ll<<59



int main(){
  ll i,j;
  ll n;
  cin>>n;
  ll d[n];
  for(i=0;i<n;i++) cin>>d[i];
  sort(d,d+n);
  ll ans=d[n/2]-d[n/2 -1];
  cout<<ans<<endl;
  return 0;  
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
//#define cerr if (false) cerr
#define db(x) cerr << #x << "=" << x << endl
#define db2(x, y) cerr << #x << "=" << x << "," << #y << "=" << y << endl
#define db3(x, y, z) cerr << #x << "=" << x << "," << #y << "=" << y << "," << #z << "=" << z << endl
#define dbv(v) cerr << #v << "="; for (auto _x : v) cerr << _x << ", "; cerr << endl
#define dba(a, n) cerr << #a << "="; for (int _i = 0; _i < (n); ++_i) cerr << a[_i] << ", "; cerr << endl
template <typename A, typename B>
ostream& operator<<(ostream& os, const pair<A, B>& x) {
	return os << "(" << x.first << "," << x.second << ")";
}
typedef long long ll;
typedef long double ld;
const int MOD = 998244353;
struct Mint {
	int val;
	Mint() { val = 0; }
	Mint(const ll& x) {
		val = (-MOD <= x && x < MOD) ? x : x % MOD;
		if (val < 0) val += MOD;
	}
	template <typename U>
	explicit operator U() const { return (U)val; }
	friend bool operator==(const Mint& a, const Mint& b) { return a.val == b.val; }
	friend bool operator!=(const Mint& a, const Mint& b) { return !(a == b); }
	friend bool operator<(const Mint& a, const Mint& b) { return a.val < b.val; }
	Mint& operator+=(const Mint& m) { if ((val += m.val) >= MOD) val -= MOD; return *this; }
	Mint& operator-=(const Mint& m) { if ((val -= m.val) < 0) val += MOD; return *this; }
	Mint& operator*=(const Mint& m) { val = (ll)val * m.val % MOD; return *this; }
	friend Mint modex(Mint a, ll p) {
		assert(p >= 0);
		Mint ans = 1;
		for (; p; p >>= 1, a *= a) if (p & 1) ans *= a;
		return ans;
	}
	Mint& operator/=(const Mint& m) { return *this *= modex(m, MOD - 2); }
	Mint& operator++() { return *this += 1; }
	Mint& operator--() { return *this -= 1; }
	Mint operator++(int) { Mint result(*this); *this += 1; return result; }
	Mint operator--(int) { Mint result(*this); *this -= 1; return result; }
	Mint operator-() const { return Mint(-val); }
	friend Mint operator+(Mint a, const Mint& b) { return a += b; }
	friend Mint operator-(Mint a, const Mint& b) { return a -= b; }
	friend Mint operator*(Mint a, const Mint& b) { return a *= b; }
	friend Mint operator/(Mint a, const Mint& b) { return a /= b; }
	friend ostream& operator<<(ostream& os, const Mint& x) { return os << x.val; }
};
Mint F[3005][3005];
int main() {
	int A, B, C, D;
	scanf("%d%d%d%d", &A, &B, &C, &D);
	int H = C - A;
	int W = D - B;
	for (int c = 0; c <= W; ++c) F[0][c] = modex(Mint(A), c);
	for (int r = 1; r <= H; ++r) {
		Mint sum = 0;
		Mint v = A + r;
		Mint inv = 1 / v;
		Mint vc = 1;
		Mint invc = inv;
		for (int c = 0; c <= W; ++c) {
			F[r][c] = (c + B) * F[r - 1][c];
			F[r][c] += sum * vc;
			vc *= v;
			sum += F[r - 1][c] * (c + B) * invc;
			invc *= inv;
		}
	}
	printf("%d\n", F[H][W].val);
}


Measured memory_bytes: 39096
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
#define pf push_front
#define fr first
#define sc second
#define r_0 return 0
#define ld long double
using namespace std;

    const ll N = 1e3 + 7;
    const ll mod = 1e9 + 7;



void solve(){
    int n , k;
    cin >> n >> k;
    vector < int > a(n + 1);
    for(int i = 1; i <= n; ++ i)
        cin >> a[i];
    sort(a.begin() , a.end());
    int cnt = 0;
    for(int i = 1; i <= k; ++ i){
        cnt += a[i];
    }
    cout << cnt;
}

int main(){
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int tt = 1;
    //cin >> tt;
    while(tt --){
            solve();
    }
}

/**

**/


Measured memory_bytes: 3620
c=[0,2,5,5,4,5,6,3,7,6];N=gets.split[0].to_i;A=B=gets.split.map &:to_i;d=[0]+Array.new(N);0.upto(N){|i|q=A.map{|x|c[x]<=i&&d[t=i-c[x]]?d[t]*10+x:p}.compact;q.any?&&d[i]=q.max};p d[N]

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

int main(){
  int n,m; cin >> n >> m;
  ll sum=0;
  rep(i,m){
    int k;
    cin >> k;
    sum += k;
  }

  if(sum > n) cout << -1 << endl;
  else if(sum <= n) {
    ll ans = n - sum;
    cout << ans << endl;
  }

  
}



Measured memory_bytes: 3652
import java.math.BigInteger;
import java.util.*;
import java.util.stream.Collectors;

public class Main {
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int H = sc.nextInt();
    int W = sc.nextInt();
    int m = sc.nextInt();
    Map<Integer, Integer> hMap = new HashMap<>();
    Map<Integer, Integer> cMap = new HashMap<>();
    Map<Integer, Set<Integer>> g = new HashMap<>();
    for (int i = 0; i < m; i++) {
      int h = sc.nextInt();
      int w = sc.nextInt();
      Integer integer1 = hMap.computeIfAbsent(h, key -> 0);
      Integer integer2 = cMap.computeIfAbsent(w, key -> 0);
      hMap.put(h, integer1 + 1);
      cMap.put(w, integer2 + 1);
      g.computeIfAbsent(h, key -> new HashSet<>()).add(w);
    }
    Map<Integer, List<Integer>> hMap2 = new HashMap<>();
    Map<Integer, List<Integer>> cMap2 = new HashMap<>();
    int hMax = 0;
    for (Map.Entry<Integer, Integer> integerIntegerEntry : hMap.entrySet()) {
      int integer = integerIntegerEntry.getKey();
      int integer2 = integerIntegerEntry.getValue();
      if (integer2 > hMax) {
        hMax = integer2;
      }
      hMap2.computeIfAbsent(integer2, key -> new ArrayList<>()).add(integer);
    }
    int cMax = 0;
    for (Map.Entry<Integer, Integer> integerIntegerEntry : cMap.entrySet()) {
      int integer = integerIntegerEntry.getKey();
      int integer2 = integerIntegerEntry.getValue();
      if (integer2 > cMax) {
        cMax = integer2;
      }
      cMap2.computeIfAbsent(integer2, key -> new ArrayList<>()).add(integer);
    }
    List<Integer> hList = hMap2.get(hMax);
    List<Integer> cList = cMap2.get(cMax);
    for (int h: hList) {
      Set<Integer> cSet = g.get(h);
      for (int c: cList) {
        if (!cSet.contains(c)) {
          System.out.println(hMax + cMax);
          return;
        }
      }
    }
    System.out.println(hMax + cMax - 1);
  }
}


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

using namespace std;

#define MOD 1000000007

int main(){
  int row, col;
  cin >> row >> col;
  bool grid[row][col];
  for(int i = 0;i < row;i++){
    for(int j = 0;j < col;j++){
      char c;cin >> c;
      grid[i][j] = c == '#';
    }
  }
  
  long long dp[row + 1][col + 1];
  
  for(int i = 0;i <= row;i++){
    for(int j = 0;j <= col;j++){
      dp[i][j] = 0;
    }
  }
  for(int i = 1;i <= row;i++){
    for(int j = 1;j <= col;j++){
      if(i == 1 && j == 1) dp[i][j] = 1;
      else if(!grid[i - 1][j - 1]) dp[i][j] = ((dp[i - 1][j] % MOD) + (dp[i][j - 1] % MOD)) % MOD;
    }
  }
  cout << dp[row][col] % MOD;
}

Measured memory_bytes: 9088
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<utility>
#include<set>
#include<stack>
#include<list>
#include<deque>
#include<bitset>
#include<iomanip>
#include<cstring>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<climits>
#include<cmath>
#include<cctype>


#define pb push_back
#define mp make_pair
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define ren(i,a,b) for(int i=a;i>=b;i--)
#define ff first
#define ss second
#define pll pair<long long int,long long int>
#define pii pair<int,int>
#define vll vector<long long int>
#define vii vector<int>
#define gi(n) scanf("%d",&n)
#define gll(n) scanf("%lld",&n)
#define gstr(n) scanf("%s",n)
#define gl(n) cin >> n
#define oi(n) printf("%d",n)
#define oll(n) printf("%lld",n)
#define ostr(n) printf("%s",n)
#define ol(n) cout << n
#define os cout<<" "
#define on cout<<"\n"
#define o2(a,b) cout<<a<<" "<<b
#define all(n) n.begin(),n.end()
#define present(s,x) (s.find(x) != s.end())
#define cpresent(s,x) (find(all(s),x) != s.end())
#define tr(container, it) for(__typeof(container.begin()) it = container.begin(); it != container.end(); it++)
using namespace std;

typedef unsigned long long int ull;
typedef long long int ll;
typedef long double ld;
typedef vector<vector<ll> > mat;

int main()
{ios_base::sync_with_stdio(false);
int n,k;
cin>>n>>k;

rep(i,1,n)
{
	int x;
	cin>>x;
}
int kk=k,ans=1;
while(1)
{
	if(kk>=n)
	break;
	ans++;
	kk+=k-1;
}
ol(ans);

return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep3(i, s, n, a) for (int i = (s); i < (int)(n); i += a)
#define rep2(i, s, n) rep3(i, s, n, 1)
#define rep(i, n) rep2(i, 0, n)

using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;

int main() {
  int h, w;
  cin >> h >> w;
  vector<string> s;
  rep(i, h) {
    string x;
    cin >> x;
    s.push_back(x);
  }
  vector<int> tmp(1, -1);
  vector<vector<int>> col(h, tmp), row(w, tmp);
  rep(i, h) {
    rep(j, w) {
      if (s[i][j] == '#') {
        col[i].push_back(j);
        row[j].push_back(i);
      }
    }
    col[i].push_back(w);
  }
    rep(i, w) { 
      row[i].push_back(h);
      sort(row[i].begin(), row[i].end());
    }
//   rep(i, h) {
//     int len = col[i].size();
//     rep(j, len) { cout << col[i][j] << " "; }
//     cout << endl;
//   }
  int maxim = 0;
  rep(i, h){
      rep(j, w){
          if(s[i][j]=='.'){
              int tmp = 0;
              auto it = upper_bound(col[i].begin(), col[i].end(), j);
              tmp = *it - *(--it) - 1;
              auto it2 = upper_bound(row[j].begin(), row[j].end(), i);
              tmp += *it2 - *(--it2) - 1;
            //   cout << i << " " << j << endl;
            //   cout << tmp-1 << endl;
              maxim = max(maxim, tmp-1);
          }
      }
  }
  cout << maxim << endl;
  return 0;
}

Measured memory_bytes: 41544
using System;
using System.Linq;

namespace _0104
{
    class Program
    {
        static void Main(string[] args)
        {
            while (true)
            {
                int[] x = Console.ReadLine().Split().Select(int.Parse).ToArray();
                if (x[0] == 0 && x[1] == 0)
                {
                    break;
                }
                string[] meiro = new string[x[0]];
                bool[,] flag = new bool[x[0], x[1]];
                for (int i = 0; i < x[0]; i++)
                {
                    meiro[i] = Console.ReadLine();
                }
                int tate = 0;
                int yoko = 0;
                bool b = true;
                while (!flag[tate, yoko] && b)
                {
                    flag[tate, yoko] = true;
                    switch (meiro[tate][yoko])
                    {
                        case ('>'):
                            {
                                yoko++;
                                break;
                            }
                        case ('<'):
                            {
                                yoko--;
                                break;
                            }
                        case ('v'):
                            {
                                tate++;
                                break;
                            }
                        case ('^'):
                            {
                                tate--;
                                break;
                            }
                        default:
                            {
                                b = false;
                                break;
                            }
                    }
                }
                Console.WriteLine(b ? "LOOP" : yoko + " " + tate);
            }
        }
    }
}

Measured memory_bytes: 9576
#include<bits/stdc++.h>
#define ll long long
#define ld long double
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define REP(i,j) for(int i=0;i<j;i++)
#define FORN(i,j,k) for(int i=j;i<k;i++)
#define vi vector<int>
#define vvi vector<vi >
#define pii pair<int,int>
#define vpii vector<pii >
using namespace std;
int f(int n){
	int ret=0;
	for(int i=1;i*i<=n;i++){
		for(int j=i;j*j<=n;j++){
			for(int k=j;k*k<=n;k++){
				if((i+j)*(i+j)+(i+k)*(i+k)+(j+k)*(j+k)==2*n){
					if(i==j&&j==k)ret++;
					else if(i!=j&&j!=k&&i!=k)ret+=6;
					else ret+=3;
				}
			}
		}
	}
	return ret;
}
int main(void){
	int n;
	cin>>n;
	FORN(i,1,n+1){
		cout<<f(i)<<endl; 
	}
	return 0;
}

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

int main(){
  long long X;
  cin >> X;
  
  long long ans = 360;
  for (long long i = 0; i < 3; i++){
    if (X % 2 == 0){
      X /= 2;
      ans /= 2;
    }
  }
  for (long long i = 0; i < 2; i++){
    if (X % 3 == 0){
      X /= 3;
      ans /= 3;
    } 
  }
  for (long long i = 0; i < 1; i++){
    if (X % 5 == 0){
      X /= 5;
      ans /= 5;
    }
  }
  cout << ans;
}

Measured memory_bytes: 3628
import math
a,b,x=map(int,input().split())
if x>=a**2*b/2:
    rad=math.atan((a*b-x/a)*2/a**2)
    deg=math.degrees(rad)
else:
    rad=math.atan(a*b**2/(2*x))
    deg=math.degrees(rad)
print(deg)

Measured memory_bytes: 3060
#include<stdio.h>
int main()
{
	int i,a,b,n,s,f;
	scanf("%d%d",&a,&b);
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d%d",&s,&f);
		if(a<f&&b>s){
			printf("1\n");
			return 0;
		}
	}
	printf("0\n");
    return 0;
}

Measured memory_bytes: 1716
#define fast ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const ll inf = 1e9+9;
int n;
int a[109];
int b[109];
ll sum = 0;
int main(){
	fast,cin>>n;
	for(int i=0;i<n-1;i++) cin>>a[i];
	b[0] = a[0];
	for(int i=1;i<n-1;i++){
		b[i] = min(a[i],a[i-1]);
	}
	b[n-1] = a[n-2];
	for(int i=0;i<n;i++){
		//cout<<b[i]<<" ";
		sum += b[i];
	}
	//cout<<endl;
	cout<<sum<<endl;
}


Measured memory_bytes: 256
#include <stdio.h>
int main(){
    int p,n,s,d;
    scanf("%d", &p);
    n=p;
    s=0;
    while (n!=0) {
        d = n % 10;
        n = n / 10;
        s = s + d;
    }
    if(p%s==0){
        printf("Yes\n");
    }
    else{
        printf("No\n");
    }
 
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <cstdio>

using namespace std;

string s[101], t[101];
int n, m, num[101];

int main() {
  cin>>n;
  for(int i = 1; i <= n; i++) {
    cin>>s[i];
    for(int j = 1; j <= i; j++) {
      if(s[j] == s[i]) {
        num[j]++;
        break;
      }
    }
  }
  cin>>m;
  for(int i = 1; i <= m; i++) {
    cin>>t[i];
    for(int j = 1; j <= n; j++) {
      if(s[j] == t[i]) {
        if(num[j] > 0)
          num[j]--;
        break;
      }
    }
  }
  int maxn = 0;
  for(int i = 1; i <= n; i++) {
    maxn = max(num[i], maxn);
  }
  cout<<maxn<<endl;
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>
#include <vector>

void error()
{
        printf("No\n");
        exit(0);
}

int main()
{
        int     a, b;
        fscanf(stdin, "%d %d\n", &a, &b);
        if( 1 <= a && b <= 5)
        {
                std::vector<char> s;
                s.resize(a + b + 10);
                fscanf(stdin, "%s", s.data());
                int v;
                for(v = 0;a > 0;v++, a--)
                {
                        if (s[v] < '0' || s[v] > '9')
                                error();
                }
                if (s[v++] != '-')
                        error();
                for(;b > 0;v++, b--)
                {
                        if (s[v] < '0' || s[v] > '9')
                                error();
                }
                printf("Yes\n");
                return 0;
        }
        error();
        return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
using namespace std;
typedef long long ll;
namespace mp = boost::multiprecision;
using Mint = mp::cpp_int;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i,a,b) for(int i = int(a); i < int(b); i++)
#define all(v) v.begin(), v.end()
#define uni(v) v.erase(unique(all(v)), v.end())
#define sort_g(v) sort(all(v), greater<int>())
#define dump(x) cerr << #x << ' ' << '=' << ' ' << x << endl

int main() {
    string a, b;
    cin >> a >> b;
    double N = stoi(a + b);

    N = pow(N, 0.5);
    cout << (N == floor(N) ? "Yes" : "No") << endl;
}

Measured memory_bytes: 384
use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let h = read::<i32>();
    let w = read::<i32>();
    let a = read::<i32>();
    let b = read::<i32>();
    println!("{}", h * w - a * w - b * h + a * b);
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
using namespace std;
using ll =long long;
#define all(v) v.begin(),v.end()

 
int main() {
 
ll A,B,K;
  cin>>A>>B>>K;
  if(2*K>=B-A+1) {
while(A<=B) {
cout<<A<<endl;
  A++;
}
    return 0;
  }
  ll count=0;
  while(count<K) {
cout<<A<<endl;
    count++;
    A++;
  }
  
  count=0;
  B-=(K-1);
  while(count<K) {
    cout<<B<<endl;
    B++;
    count++;
  }
}

  
  
  

  
  


Measured memory_bytes: 3632
#include <bits/stdc++.h>
#define pb push_back
#define cmin(a,b) (a>b?a=b:a)
#define cmax(a,b) (a<b?a=b:a)
#define lop(i,s,t) for(int i=s;i<(t);++i)
#define rep(i,s,t) for(int i=s;i<=(t);++i)
#define dec(i,s,t) for(int i=s;i>=(t);--i)
#define fore(i,v) for(int i=g[v],d=es[i].d;i;i=es[i].nxt,d=es[i].d)
using namespace std;


typedef long long ll;

const int N=4e5+50;

/*
int mul(int a,int b){ return 1ll*a*b%P; }
int add(int a,int b){ a+=b; return a>=P?a-P:a; }
int sub(int a,int b){ a-=b; return a<0?a+P:a; }
*/

int n,m,a[N],c[N],cov[N+N],ans; 

int main(int argc,char *argv[]){
#ifdef CURIOUSCAT
	freopen("dat.in","r",stdin);
	//freopen("my.out","w",stdout);
#endif
	scanf("%d%d",&n,&m);
	rep(i,1,n)scanf("%d",a+i),++c[a[i]];
	rep(i,1,n)rep(j,1,c[i])++cov[n+i-j+1];
	rep(i,1,n)if(!cov[n+i])++ans;
	rep(i,1,m){
		int x,y;
		scanf("%d%d",&x,&y);
		if(a[x]-c[a[x]]+1>=1&&--cov[n+a[x]-c[a[x]]+1]==0)++ans;
		--c[a[x]];
		a[x]=y;
		++c[a[x]];
		if(a[x]-c[a[x]]+1>=1&&++cov[n+a[x]-c[a[x]]+1]==1)--ans;
		printf("%d\n",ans);
	}
	return 0;
}

Measured memory_bytes: 6400
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast,no-stack-protector,unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#define ll          long long
#define pb          push_back
#define mp 			make_pair
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define mod        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;

void solve()
{
    ll i,l;
    string s;
    cin>>s;
    l=s.length();
    ll x=0;
    ll mn=INT_MAX;
    x=(s[0]-'0')*100+(s[1]-'0')*10+(s[2]-'0');
    mn=min(mn,abs(753ll-x));
    for(i=3;i<l;i++)
    {
        x=(x%100)*10+(s[i]-'0');
        mn=min(mn,abs(753ll-x));
    }
    cout<<mn;

}

signed main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int t=1;
	//cin>>t;
	while(t--)
	{
		solve();
	}
	return 0;
}


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

using namespace std;

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

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

  long long ans = 8e18;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < n; j++) {
      for (int ii = i + 1; ii < n; ii++) {
        for (int jj = j + 1; jj < n; jj++) {
          int x1 = std::min(xs[i], xs[ii]);
          int x2 = std::max(xs[i], xs[ii]);
          int y1 = std::min(ys[j], ys[jj]);
          int y2 = std::max(ys[j], ys[jj]);

          int cnt = 0;
          for (int k = 0; k < n; k++) {
            cnt += x1 <= xs[k] && xs[k] <= x2 && y1 <= ys[k] && ys[k] <= y2;
          }
          if (cnt >= K) {
            ans = min(ans, 1LL * (x2 - x1) * (y2 - y1));
          }
        }
      }
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int x;
  cin >> x;
  int t = x, ans = 1;
  while (t % 360) {
    t += x;
    t %= 360;
    ans++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 3624
// In the name of God

#include <bits/stdc++.h>

using namespace std;

const int N = 2e5+5;
const int mod = 998244353;

long long fac[N];

long long fast_pw(long long x, long long y) {
	long long ret = 1;
	for(;y;y>>=1) {
		if(y & 1) ret = (ret * x) % mod;
		x = (x*x) % mod;
	}
	return ret;
}

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	fac[0] = 1;
	for(int i = 1; i < N; i++) {
		fac[i] = (fac[i-1] * i) % mod;
	}
	int n, m, k;	
	cin >> n >> m >> k;
	long long ans = 0;
	for(int x = 0; x < n; x++) {
		// this x elements are different from the element before them
		// n-x elements is same as element before them
		if(n-x-1>k) continue;
		ans += (((m * fast_pw(m-1, x)) % mod) * ( ((fac[n-1] * fast_pw(fac[x], mod-2)%mod)*fast_pw(fac[n-1-x], mod-2))%mod))%mod;
		ans %= mod;
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 5244
fun main(args:Array<String>) {
  val n = readLine()!!.toInt()
  val onehots = (1..n).map {
    readLine()!!.split(" ").map(String::toInt)
  }
  val gains = (1..n).map { 
    readLine()!!.split(" ").map(String::toInt)
  }

  val result = mutableListOf<Int>()
  (0..1).map { a1 -> (0..1).map { a2 -> (0..1).map { a3 -> (0..1).map { a4 -> (0..1).map { a5 -> (0..1).map { a6 -> (0..1).map { a7 -> (0..1).map { a8 -> (0..1).map { a9 -> (0..1).map { a10 -> 
    val b = listOf(a1, a2, a3, a4, a5, a6, a7, a8, a9, a10)
    if( b.sum() != 0 ) {  
      val gain = onehots.mapIndexed { index, onehot ->
        val query = b.zip( onehot ).toList<Pair<Int, Int>>().map { it ->
          val (a, hot) = it
          a*hot 
        }.sum()

        val gain = gains[index][query]

        gain
      }.sum()

      result.add( gain )
      //println(b)
    }
  } } } } } } } } } }

  println( result.sorted().last() )
} 

Measured memory_bytes: 68344
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  int n;
  cin>>n;
  vector<int> as(n);
  for(int i=0;i<n;i++) cin>>as[i];

  vector<ll> sm(n+1,0);
  for(int i=0;i<n;i++) sm[i+1]=sm[i]+as[i];

  const ll MUL = 1e4;
  const ll OFS = 1e14;
  auto P1=[&](ll x,int y){return (x+OFS)*MUL+y;};
  vector< vector<ll> > G(n);
  for(int l=0;l<n;l++){
    for(int r=l+1;r<=n;r++)
      G[l].emplace_back(P1(sm[r]-sm[l],r));
    sort(G[l].begin(),G[l].end());
  }

  using P2 = pair<short, short>;
  vector< vector<P2> > dp(n+1,vector<P2>(n+1,P2(-n,0)));
  for(int l=0;l<n;l++){
    for(auto pp:G[l]){
      int r=pp%MUL;
      if(l==0) chmax(dp[l][r],P2(1,-1));

      int x=lower_bound(G[l].begin(),G[l].end(),P1(sm[r]-sm[l],r))-G[l].begin();
      if(x+1<(int)G[l].size())
        chmax(dp[l][G[l][x+1]%MUL],dp[l][r]);

      if(r==n) continue;
      int k=upper_bound(G[r].begin(),G[r].end(),P1(sm[r]-sm[l],n))-G[r].begin();
      if(k<(int)G[r].size())
        chmax(dp[r][G[r][k]%MUL],P2(dp[l][r].first+1,l));
    }
  }

  P2 ans(0,-1);
  for(int l=0;l<n;l++)
    chmax(ans,dp[l][n]);

  int l=-1,r=n;
  for(int i=0;i<n;i++)
    if(ans==dp[i][n]) l=i;

  cout<<ans.first<<endl;
  vector<int> res;
  while(l!=0){
    res.emplace_back(l);
    int nl=dp[l][r].second;
    int nr=l;
    l=nl;r=nr;
  }
  reverse(res.begin(),res.end());
  for(int i=0;i<(int)res.size();i++){
    if(i) cout<<" ";
    cout<<res[i];
  }
  cout<<endl;
  return 0;
}



Measured memory_bytes: 139908
"use strict";
const App3 = (arg: any) => {
  const Input = arg.trim().split("\n");
  const N:number = parseInt(Input[0].split(" ")[0], 10);
  const result:number = N * N * N;
  console.log(result);
};

App3(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 7372
#define _CRT_SECURE_NO_WARNINGS
#define _SILENCE_ALL_CXX17_DEPRECATION_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include <map>
#include <fstream>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <assert.h>
#include <complex>
using namespace std;
#define eps 0.000000001
#define LONG_INF 10000000000000000
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define seg_size 65536*2
#define REP(i,n) for(long long i = 0;i < n;++i)
unsigned long xor128(void)
{
	static unsigned long x = time(NULL), y = 362436069, z = 521288629, w = 88675123;
	unsigned long t;
	t = (x ^ (x << 11)); x = y; y = z; z = w; return(w = (w ^ (w >> 19)) ^ (t ^ (t >> 8)));
}
long long ans[300000] = {};
int main() {
	int n;
	cin >> n;
	vector<int> input;
	REP(i, n) {
		int a;
		cin >> a;
		a--;
		input.push_back(a);
	}
	ans[input[0]]++;
	for (int i = 0; i < n-1; ++i) {
		if (input[i] != input[i + 1]) {
			ans[input[i + 1]] += ans[input[i]];
			ans[input[i + 1]] %= MAX_MOD;
		}
	}
	cout << ans[input[n - 1]] << endl;
	return 0;
}

Measured memory_bytes: 2676
#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define pb push_back
#define fo(i,n) for(int i=0;i<n;i++)
#define fo1(i,n) for(int i=1;i<n;i++)
#define Fo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define PI 3.1415926535897932384626
#define setbits(x)      __builtin_popcountll(x)
#define zrobits(x)      __builtin_ctzll(x)
#define mod             1000000007
#define inf             1e18
#define ps(x,y)         fixed<<setprecision(y)<<x
#define mk(type,arr,n)  type *arr=new type[n];
#define w(x)            int x; cin>>x; while(x--)
//=======================
typedef pair<int, int>  pii;
typedef vector<int>     vi;
typedef vector<pii>     vpii;
typedef vector<vi>      vvi;
//=======================
const int MOD = 1000000007;
const int N = 300005, M = N;
//=======================
vi g[N],adj[N];
int n, m, s, w, W, S, k, i, l, j, p, q, pr, fi, md;


void abhinay()
{
   
    #ifndef ONLINE_JUDGE   
        freopen("input.txt", "r", stdin);   
        freopen("output.txt", "w", stdout);   
    #endif   
    
}

int main(){
    abhinay();
    cin>>n>>w;
    ll dp[100][100005];
    vi W(n+1),V(n+1); 
    fo(i,n) cin>>W[i]>>V[i];
    dp[0][0]=0;
    dp[0][W[0]]=V[0];
    for (int i = 1; i < n; i++){
        dp[i][0]=0; //always empty bag
        for (int j = 1; j <=w; j++)
    {   dp[i][j] = dp[i-1][j];
        if(j>=W[i]) dp[i][j] = max(dp[i][j],V[i]+dp[i-1][j-W[i]]);
    }
}
    ll ret = 0;
    for (int j = 0; j <= w; j++)
    {
        ret = max(ret,dp[n-1][j]);
    } 
    cout << ret;
    return 0;
}


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

ll modpower(ll a, ll r){ //a^r
    ll x = 1;
    while (r > 0) {
        if (r & 1) x = x * a % mod;
        r >>= 1;
        a = a * a % mod;
    }
    return x;
}

ll modinv(ll a){
    return modpower(a, mod-2);
}

vector<ll> fact;
vector<ll> invfact;

void set_fact(int n){
    fact.resize(n+1, 1);
    invfact.resize(n+1, 1);
    for (int i = 2; i <= n; i++) {
        fact[i] = fact[i-1] * i % mod;
    }
    invfact[n] = modinv(fact[n]);
    for (int i = n-1; i >= 2; i--) {
        invfact[i] = invfact[i+1] * (i+1) % mod;
    }
    return;
}

ll comb(int n, int k) {
    if (k > n || k < 0) return 0;
    if (k == n || k == 0) return 1;
    return fact[n] * invfact[n-k] % mod * invfact[k] % mod;
}
int main(){
    int B, W;
    cin >> B >> W;
    set_fact(B+W+1);
    vector<ll> twoinvpower(B+W+1, 1);
    for (int i = 1; i <= B+W; i++) {
        twoinvpower[i] = twoinvpower[i-1] * invfact[2] % mod;
    }
    vector<ll> ans(B+W+1);
    ll no_w = 0, no_b = 0;
    for (int i = 1; i <= B+W; i++) {
        ans[i] = ((2*mod + 1 - no_w - no_b) * invfact[2] + no_w) % mod;
        if (i >= B) {
            no_b = (no_b + comb(i-1, B-1)*twoinvpower[i]) % mod;
        }
        if (i >= W) {
            no_w = (no_w + comb(i-1, W-1)*twoinvpower[i]) % mod;
        }
    }
    for (int i = 1; i <= B+W; i++) {
        printf("%lld\n", ans[i]);
    }
    return 0;
}

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

#define ll long long
#define Fi first
#define Se second
#define Pb push_back
#define vi vector<int>
#define vp vector<pair<int,int>>
#define vvi vector<vector<int>>
#define vvp vector<vector<pair<int,int>>>

const int INF = 1e9;
const int MOD = 1e9+7;

#define all(v) v.begin(),v.end()
#define output_s(a) printf("%s\n",(a).c_str())

#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define Rep(i,n,m) for(int i=(int)(n);i<(int)(m);i++)
#define RepS(i,n,m) for(int i=(int)(n);i<=(int)(m);i++)
#define RRepS(i,n,m) for(int i=(int)(n);i>=(int)(m);i--)
#define RepA(x) for(auto &item:(x))

void CINT(){}
template <class Head,class... Tail>
void CINT(Head&& head,Tail&&... tail){
    cin>>head;
    CINT(move(tail)...);
}    
#define CIN(...) int __VA_ARGS__;CINT(__VA_ARGS__)
#define LCIN(...) ll __VA_ARGS__;CINT(__VA_ARGS__)
#define SCIN(...) string __VA_ARGS__;CINT(__VA_ARGS__)

template<typename TypeInt> //最大公約数
TypeInt GCD(TypeInt a,TypeInt b){
    if(a%b==0) return b;
    else return GCD(b,a%b);
}
template<typename TypeInt> //最小公倍数
TypeInt LCM(TypeInt a,TypeInt b){
    return a*b/GCD(a,b);
}

int IN_int(){
    int x;
    scanf("%d",&x);
    return x;
}

//library----------------------------------------------

int split_sum(int i){
    string s=to_string(i);
    int sum=0;
    for(auto item:s){
        sum+=item-'0';
    }
    return sum;
}

int main(){
    CIN(N,A,B);
    int ans=0;
    RepS(i,1,N){
        if(A<=split_sum(i)&&split_sum(i)<=B) ans+=i;
    }
    printf("%d\n",ans);    
    return 0;
}

Measured memory_bytes: 256
#!/usr/bin/env python3
#%% for atcoder uniittest use
import sys
input= lambda: sys.stdin.readline().rstrip()
def pin(type=int):return map(type,input().split())
def tupin(t=int):return tuple(pin(t))
#%%code
def resolve():
    N,K=pin()
    h=[int(input()) for i in range(N)]
    h.sort()
    temp=10**9+1
    for i in range(N-K+1):
        temp=min(temp,h[i+K-1]-h[i])
    print(temp)
#%%submit!
resolve()

Measured memory_bytes: 44380
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<long long,long long> pll;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)
constexpr int mod=1000000007;
constexpr int mod1=998244353;
vector<int> dx={0,1,0,-1},dy={-1,0,1,0};
bool inside(int y,int x,int h,int w){
	if(y<h && y>=0 && x<w && x>=0) return true;
	return false;
}





int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int a,b;cin >> a >> b;
	if(a == b) cout << a + b << endl;
	else cout << max(a,b) * 2 - 1 << endl;
}


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

int32_t main() 
{
  #ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
  #endif 
  ios::sync_with_stdio(0); 
  cin.tie(0); cout.tie(0);
  
  int n;
  cin >> n;
  int d[n][2];

  for(int i = 0; i < n; i++){
     cin >> d[i][0] >> d[i][1];
  }
  bool yes = false;
  for(int i = 2; i < n; i++){
     yes |= (d[i][0] == d[i][1] && d[i - 1][0] == d[i - 1][1] && d[i - 2][0] == d[i - 2][1]);
  }

  cout << (yes ? "Yes" :"No");
  return 0;
}

Measured memory_bytes: 3664
A, B, C, D = map(int, input().split())
if A%D == 0:
  if C-B*(A//D) > 0:
    print("No")
  else:
    print("Yes")
else:
  if C-B*(A//D+1) > 0:
    print("No")
  else:
    print("Yes")

Measured memory_bytes: 61760
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please


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


	int N, M;
	cin >> N >> M;
	int X[100000];
	rep(i, M) cin >> X[i];
	sort(X, X + M);

	int sa[100000];
	rep(i, M - 1) {
		sa[i] = X[i + 1] - X[i];
	}
	sort(sa, sa + M - 1);

	int kotae = 0;
	rep(i, M - N) kotae += sa[i];

	co(kotae);

	Would you please return 0;
}

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

int bubbleSort(int A[],int n){
    int count = 0;
    bool flag = 1;

    while(flag){
        flag = 0;
        for(int i = n-1; i > 0; i--){
            int x=A[i];
            if(A[i] < A[i-1]){
                swap(A[i], A[i-1]);
                
                count++;
                flag = 1;
            }
        }
    }

    return count;
}

int main(){
    int A[100], n, count;
    cin >> n;
    
    for(int i = 0; i < n; i++){
        cin >> A[i];
    }
    count = bubbleSort(A, n);

    for(int i = 0; i < n; i++){
        if(i)   cout << " ";
        cout << A[i];
    }

    cout << endl;
    cout << count << endl;

    return 0;
}



Measured memory_bytes: 3104
#include <cstdio>
inline char tc(){
  static char fl[100],*A=fl,*B=fl;
  return A==B&&(B=(A=fl)+fread(fl,1,100,stdin),A==B)?EOF:*A++;  
}
inline int read(){
  int a=0;static char c;
  while((c=tc())<48||c>57);
  while(c>=48&&c<=57)a=a*10+c-48,c=tc();
  return a;
}

int main(){
  int n,i;
  n=read();
  int a,count4=0,odd=0;
  for(i=0;i<n;++i){
    a=read();
    if(a&1){
      odd++;
    }else if(!(a&3)){
      count4++;
    }
  }
  if(odd==0||odd+((n-count4-odd)?1:0)<=count4+1){
    puts("Yes");
    return 0;
  }
  puts("No");
}

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

int main(){
  int N,K;
  cin >> N >> K;
  int res = 1;
  for(int i = 0 ; i < N; i++){
    if(res * 2 < res + K){
      res = res*2;
    }
    else {
      res = res+K;
    }
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 256
while True:
    h, w = map(int, input().split())
    
    if h == 0 and w == 0:
        break
    
    for i in range(0, h):
        for j in range(0, w):
            if (i + j) % 2 == 0:
                print('#', end='')
            else:
                print('.', end='')
            
        print()
    print()


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

int main()
{
    long long x, year, money=100;
    double rate = 1.01;
    cin >> x;
    for(year=1; year<1000000; year++){
      money = money*rate;
      if(money >= x){
          cout << year;
          break;
      }
    }
}

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

int main(){
  int n;
  cin >> n;
  set<int> st;
  int cnt = 0;
  int a;
  for ( int i = 0; i < n; i++){
    cin >> a;
    if ( a/400 >= 8){
      cnt ++;
    } else {
      st.insert(a/400);
    }
  }

  cout << max((int)st.size(), 1) << " " << st.size() + cnt << endl;

  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define MAX 300005
 
using namespace std;
int use[MAX];
vector<int> a;
int main(){
  int n,x;
  cin>>n;
  for(int i=0;i<n;i++){
    cin>>x;
    use[x]++;
  }
  int cnt = 0;
  for(int i=1;i<=n;i++){
    	if(use[i])a.push_back(use[i]);
  }
  sort(a.begin(),a.end());
  int sum = n;
  for(int i=1;i<=n;i++){
    	while(a.back() > sum/i){
        	int len = a.size();
            int dup = 0;
            while(len && a[len-1] > sum/i){
            	--a[--len];
              	  dup++;
            }
            sum -= dup;
        }
    	cout<<sum/i<<endl;
  }
  return 0; 
}

Measured memory_bytes: 3572
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<string>
#include<cstring>
#include<algorithm>
#include<queue>
#include<map>
#include<set>
typedef long long ll;
const ll longinf=1LL<<60;
using namespace std;

char s[3];

int main()
{
    bool flag =0;
    for (int i=0; i<3; ++i)
    {
        cin>>s[i];
        if (s[i]=='7') flag=1;
    }
    if (flag==1) cout<<"Yes"<<endl;else cout<<"No"<<endl;
    return 0;
}



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

string s;
int ans, l, r;

int main() {
    cin >> s;
    r = s.size()-1;
    while (l < r) {
        if (s[l] == s[r]) {
            l++;
            r--;
        } else if (s[l] == 'x') {
            l++;
            ans++;
        } else if (s[r] == 'x') {
            r--;
            ans++;
        } else {
            ans = -1;
            break;
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 512
#include <iostream>

int main()
{
    int N;
    std::cin >> N;
    int A[N];
    for(int i=0; i<N; i++) scanf(" %d", &A[i]);

    int first = 0, second = 0;
    for(int i=0; i<N; i++){
        if(A[i] >= first){
            second = first; first = A[i];
        }
        else if(A[i] > second) second = A[i];
    }
    for(int i=0; i<N; i++){
        if(A[i] == first) printf("%d\n", second);
        else printf("%d\n", first);
    }
}

Measured memory_bytes: 2432
#include <iostream>
#include <vector>
#include <array>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <algorithm>
#include <random>

// MARK: - header
using namespace std;
using ll = long long;
namespace {
template<ll MOD>
struct Mod {
    ll v = 0;
    Mod() {};
    Mod(ll val) : v(val) {}
    ll mod(ll x) {return x % MOD;}
    operator ll() const {return v;}
    ll operator=(ll x) {return v = mod(x);}
    ll operator+=(ll x) {return v = mod(v + x);}
    ll operator*=(ll x) {return v = mod(v * x);}
};
}

// MARK: - answer

ll N, X;
vector<ll> S;

const ll MOD = 1e9+7;

void input() {
    cin >> N >> X;
    S.resize(N);
    for (auto &s : S)
        cin >> s;
}

ll solve() {
    sort(S.rbegin(), S.rend());
    vector<Mod<MOD>> dp(X+1);
    dp[X] = 1;
    for (ll i = 0; i < N; i++) {
        for (ll x = 0; x <= X; x++) {
            if (dp[x] == 0)
                continue;
            ll dpx = dp[x], xn = x % S[i];
            dp[x] = dpx * (N-i-1);
            dp[xn] = dp[xn] + dpx;
        }
    }
    Mod<MOD> ans = 0;
    for (ll x = 0; x <= X; x++) {
        ans += x * dp[x];
    }
    return ans;
}

int main() {
    input();
    cout << solve() << endl;
    
    return 0;
}



Measured memory_bytes: 1024
package main

import (
	"fmt"
)

func main() {
	var N int
	fmt.Scan(&N)
	for n := 1; n <= N; n++ {
		ans := 0
		for x := 1; x <= N; x++ {
			x2 := x * x
			if x2 > n {
				break
			}
			for y := 1; y <= N; y++ {
				y2 := y * y
				xy := x * y
				xy2 := x2 + y2 + xy
				if xy2 > n {
					break
				}
				for z := 1; z <= N; z++ {
					z2 := z * z
					zx := z * x
					yz := y * z
					xyz2 := xy2 + z2 + zx + yz
					if xyz2 > n {
						break
					}
					if xyz2 == n {
						ans++
					}
				}
			}
		}
		fmt.Println(ans)
	}
}


Measured memory_bytes: 1924