akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
    #include<stdio.h>
    //#include <bits/stdc++.h>
    #include<vector>
    #include<float.h>
    #include<iomanip>
    #include<algorithm>
    #include<string>
    #include<cstring>
    #include<math.h>
    #include<cmath>
    #include<sstream>
    #include<set>
    #include<map>
    #include<queue>
    #include<cassert>
    #include<cmath>
    #include<cstdint>
     
    #define INF 1e9
    #define rep(i,n)for(int i=0;(i)<(int)(n);i++)
    #define REP(i,a,b)for(int i=(int)(a);(i)<=(int)(b);i++)
    #define VEC(type, c, n) std::vector<type> c(n);for(auto& i:c)std::cin>>i;
    #define vec(type,n) vector<type>(n)
    #define vvec(m,n) vector<vector<int>> (int(m),vector<int>(n))
    #define ALL(a)  (a).begin(),(a).end()
    #define chmin(a, b) a = min(a, b)
    #define chmax(a, b) a = max(a, b)
     
    using namespace std;
    using ll = long long;
    using Graph = vector<vector<int>>;
    using P = pair<ll, ll>;
     
const int MOD = 1e9 + 7;


int main(){
   int x;
   cin >> x;
   rep(i, 8){
      if(400 + 200 * i <= x && x < 400 + 200 * (i + 1)){
         cout << 8 - i << endl;
      }
   }
}


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


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

using namespace std;
using llong = long long;
using ldbl = long double;
using lpair = pair<llong, llong>;

#define ALL(x) x.begin(), x.end()

constexpr llong mod = 1e9+7;
constexpr llong inf = mod * mod;

int main() {
  llong L, R, d;
  cin >> L >> R >> d;

  llong ans = 0;
  for (llong i = L; i <= R; i++) {
    ans += i % d == 0;
  }

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 3636
n = gets.chomp.to_i
s = gets.chomp.split("")

middle = s.size / 2
oddd = s.size % 2
if(oddd == 1)
    puts "No"
    exit 0
end

for i in 0..(middle - 1) do
    mae = s[i]
    back = s[i + middle]
    if(mae != back)
        puts "No"
        exit 0
    end
end

puts "Yes"



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

using namespace std;

using ll = long long;
using ld = long double;
using P = pair<ll, ll>;
constexpr ld EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max() / 2;
constexpr int MOD = 1e9 + 7;

template <typename T>
void printv(const vector<T> &v)
{
    int sz = v.size();
    for (int i = 0; i < sz; i++)
    {
        cout << v[i] << " \n"[i == sz - 1];
    }
}

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

    int X, Y, Z;
    cin >> X >> Y >> Z;
    int N = X + Y + Z;
    // 金, 銀, 銅
    vector<ll> A(N), B(N), C(N);
    vector<P> ps;
    for (int i = 0; i < N; i++)
    {
        cin >> A[i] >> B[i] >> C[i];
        ps.push_back(P(A[i] - B[i], i));
    }
    sort(ps.begin(), ps.end());
    vector<ll> tmp(N, 0);
    ll sum1 = 0, sum2 = 0;
    priority_queue<ll, vector<ll>, greater<ll>> que;
    for (int i = N - 1; i >= 0; i--)
    {
        int idx = ps[i].second;
        sum1 += C[idx];
        sum2 += A[idx] - C[idx];
        que.push(A[idx] - C[idx]);
        while (int(que.size()) > X)
        {
            sum2 -= que.top();
            que.pop();
        }
        if (int(que.size()) != X || i < Y)
            continue;
        tmp[i] += sum1 + sum2;
    }
    while (!que.empty())
        que.pop();
    sum1 = 0;
    sum2 = 0;
    for (int i = 0; i < N - 1; i++)
    {
        int idx = ps[i].second;
        sum1 += C[idx];
        sum2 += B[idx] - C[idx];
        que.push(B[idx] - C[idx]);
        while (int(que.size()) > Y)
        {
            sum2 -= que.top();
            que.pop();
        }
        if (int(que.size()) != Y || N - 1 - i < X)
            continue;
        tmp[i + 1] += sum1 + sum2;
    }
    ll ret = 0;
    for (int i = 0; i < N - 1; i++)
        ret = max(ret, tmp[i + 1]);
    cout << ret << endl;
}


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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> P;
typedef pair<int, int> Pi;
typedef vector<ll> Vec;
typedef vector<int> Vi;
typedef vector<string> Vs;
typedef vector<vector<ll>> VV;
typedef vector<vector<int>> VVi;

#define REP(i, a, b) for(ll i=(a); i<(b); i++)
#define PER(i, a, b) for(ll i=(a); i>=(b); i--)
#define rep(i, n) REP(i, 0, n)
#define per(i, n) PER(i, n, 0)
const ll INF=1e16+18;
const ll MAX=100005;
const ll MOD=1000000007;
#define Yes(n) cout << ((n) ? "Yes" : "No") << endl;
#define YES(n) cout << ((n) ? "YES" : "NO") << endl;
#define ALL(v) v.begin(), v.end()
#define pb(x) push_back(x)
#define mp(a, b) make_pair(a,b)
#define Each(a,b) for(auto &a :b)
#define REPM(i, mp) for (auto i = mp.begin(); i != mp.end(); ++i)
#define dbg(x_) cerr << #x_ << ":" << x_ << endl;
#define dbgmap(mp) cerr << #mp << ":"<<endl; for (auto i = mp.begin(); i != mp.end(); ++i) { cerr << i->first <<":"<<i->second << endl;}
#define dbgarr(n,m,arr) rep(i,n){rep(j,m){cerr<<arr[i][j]<<" ";}cerr<<endl;}
#define dbgdp(n,arr) rep(i,n){cerr<<arr[i]<<" ";}cerr<<endl;
#define sum(v) accumulate(ALL(v),0)
#define fi first
#define se second

template<typename T1, typename T2>
ostream &operator<<(ostream &s, const pair<T1, T2> &p) { return s<<"("<<p.first<<", "<<p.second<<")"; }

// vector
template<typename T>
ostream &operator<<(ostream &s, const vector<T> &v) {
    int len=v.size();
    for(int i=0; i<len; ++i) {
        s<<v[i];
        if(i<len-1) s<<"	";
    }
    return s;
}

// 2 dimentional vector
template<typename T>
ostream &operator<<(ostream &s, const vector<vector<T> > &vv) {
    int len=vv.size();
    for(int i=0; i<len; ++i) {
        s<<vv[i]<<endl;
    }
    return s;
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout<<std::setprecision(10);

    ll n;
    cin>>n;
    Vec x(n);
    Vec y(n);
    rep(i,n){
        cin>>x[i]>>y[i];
    }
    double ans = 0.0;
    Vec v(n);
    rep(i,n){
        v[i] = i;
    }
    auto calc = [&](ll i,ll j)->double{
        return sqrt(pow((x[i]-x[j]),2)+pow((y[i]-y[j]),2));
    };

    do{
        REP(i,1,n){
            ans += calc(v[i],v[i-1]);
        }
    }while (next_permutation(ALL(v)));

    ll waru = 1;
    rep(i,n){
        waru *= (i+1);
    }
    cout<<ans/waru<<endl;
    return  0;
}


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


int main(){
	int H, W;
	char c;
	cin >> H >> W;
	vector<vector<char>> mat(H);
	vector<int> h_cnt(H), w_cnt(W);
	for(int j=0; j<H; j++){
		for(int i=0; i<W; i++){
			cin >> c;
			mat[j].push_back(c);
			if(c=='#'){
				h_cnt[j]++;
				w_cnt[i]++;
			}
		}
	}
	for(int j=0; j<H; j++){
		if(h_cnt[j]!=0){
			for(int i=0; i<W; i++){
				if(w_cnt[i]!=0){
					cout << mat[j][i];
				}
			}
			cout << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define rep1(i, n) for(ll i = 1; i < n+1; i++)
#define all(A) A.begin(),A.end()
typedef long long ll;

struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

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

int main(){
  int n,m;
  cin >> n >> m;
  UnionFind uf(n);
  rep(i,m){
    int a,b;
    cin >> a >> b;
    uf.unite(a,b);
  }
  map<int,int> mp;
  rep(i,n) mp[uf.root(i)]++;
  vector<int> vec(0);
  for(auto p : mp) vec.push_back(p.second);
  sort(all(vec));
  cout << vec.back() << endl;
}

Measured memory_bytes: 14352
#include <iostream>
#include <vector>
#include <string>
using namespace std;
 
static const int all = 52;
 
int main(void) {
    bool cards[all];
    char inputSute;
    int N, inputCard;
    cin >> N;
 
    for(int i=0; i<all; i++) {
        cards[i] = true;
    }
 
    while(N-- > 0) {
        cin >> inputSute >> inputCard;
        switch(inputSute) {
            case 'S': inputCard += 0; break;
            case 'H': inputCard += 13; break;
            case 'C': inputCard += 26; break;
            case 'D': inputCard += 39; break;
        }
        cards[inputCard-1] = false;
    }
 
    for(int i=0; i < all; i++) {
        if(cards[i]) {
            switch(i / 13) {
                case 0: cout << "S "; break;
                case 1: cout << "H "; break;
                case 2: cout << "C "; break;
                case 3: cout << "D "; break;
            }
            cout << (i % 13) + 1 << endl;
        }
    }
 
    return 0;
}


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

int main(){
	long long a,b;
	cin>>a>>b;
	if(a%b==0) goto here;
	
	for(int i=2;i<=1000000000;i++){
		if(a*i%b){
			cout<<a*i<<endl;
			return 0;
		}
	}
	
	here:
	cout<<"-1"<<endl;
	return 0;
}

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

public class Main {

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

  public void run() {

    try(BufferedReader br = new BufferedReader(new InputStreamReader(System.in))) {

      int n = Integer.parseInt(br.readLine());
      int[][] graph = new int[n][n];
      String[] vInfo;
      int degree;

      for(int i=0; i<n; i++) {
        vInfo = br.readLine().split(" ");
        degree = Integer.parseInt(vInfo[1]);
        for(int j=0,k=2,v=0; j<degree; j++) {
          v = Integer.parseInt(vInfo[k++]);
          graph[i][v-1] = 1;
        }
      }

      StringBuilder buf = new StringBuilder(n*n*2);
      for (int[] vertex : graph) {
        for (int v : vertex) {
          buf.append(v).append(" ");
        }
        buf.setLength(buf.length()-1);
        buf.append("\n");
      }

      System.out.print(buf);
    }
    catch (IOException e) {
      System.out.println("IOException!");
    }
  }
}


Measured memory_bytes: 25000
using System;
using System.Diagnostics;
using System.Collections.Generic;
using System.Linq;

class Program
{
    static void Main()
    {
        string[] cin = Console.ReadLine().Split();
        int a = int.Parse(cin[0]);
        int b = int.Parse(cin[1]);
        int c = int.Parse(cin[2]);
        int x = int.Parse(cin[3]);
        int y = int.Parse(cin[4]);
        int z = 0;

        if (c * 2 < a + b)
        {
            z += Math.Min(x, y) * 2;
            x -= z / 2;
            y -= z / 2;
        }

        if (c * 2 < a)
        {
            z += x * 2;
            y -= x;
            x = 0;
        }

        if (c * 2 < b && y > 0)
        {
            z += y * 2;
            y = 0;
        }

        Console.WriteLine(a * x + b * y + c * z);
    }
}

Measured memory_bytes: 13140
while True:
    H, W = map(int, raw_input().split())
    if H == 0 and W == 0:
        break
    for i in xrange(H):
        if i == 0 or i == H-1:
            print '#'*W
        elif W > 1:
            print '#' + '.'*(W-2) + '#'
        else:
            print '#'
    print 

Measured memory_bytes: 6312
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		Scanner scan = new Scanner(System.in);
		int[] v = new int[52365];
		for(int i = 0;i < 52365;i++){
			v[i] = 1;
		}
		int p = 3;
		while(true){
			if(p*p > 104730){
				break;
			}else{
				if(v[(p-1)/2] == 0){
					p += 2;
				}else{
					int t = p*p;
					while(t < 104730){
						v[(t-1)/2] = 0;
						t += 2*p;
					}
					p += 2;
				}
			}
		}
		while(scan.hasNext()){
			int n = scan.nextInt();
			if(n == 0){
				break;
			}
			long sum = 2;
			for(int i = 1;i < 52365;i++){
				if(v[i] == 0){
					continue;
				}
				if(n < 2){
					break;
				}
				sum += (2*i+1);
				n--;
			}
			System.out.println(sum);
		}
	}
}

Measured memory_bytes: 20416
#include<bits/stdc++.h>
using namespace std;
#define all(x) (x).begin(), (x).end()
#define bg(x) (x).begin()
#define ed(x) (x).end()
#define ar array
#define ll long long int

const ll mod = 1e9 + 7;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int t = 1;
    // cin >> t;
    while (t--) {
      ll n;
      cin >> n;
      vector<ll> a(n);
      for (ll &x : a)
        cin >> x;
      ll ans = 0;
      ll suffix = 0;

      for (int j = n - 1; j >= 0; --j) {
          ll f  = (a[j] * suffix) % mod;
          ans = (ans + f) % mod;
          suffix = (suffix + a[j]) % mod;
      }
      cout << ans;
    }

    return 0;
}

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

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

    vector<string> S(N);
    int AC = 0;
    int WA = 0;
    int TLE = 0;
    int RE = 0;
    for(int i = 0; i < N; i++){
        cin >> S[i];
        if(S[i] == "AC"){
            AC++;
        }
        else if(S[i] == "WA"){
            WA++;
        }
        else if(S[i] == "TLE"){
            TLE++;
        }
        else{
            RE++;
        }
    }
    cout << "AC x " << AC << endl
    << "WA x " << WA << endl
    << "TLE x " << TLE << endl
    << "RE x " << RE << endl;
    return 0;
}

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

int main(){
  int n; cin >> n;
  string s; cin >> s;
  int w = 0, b;
  rep(i, n){
    if(s[i] == '.') w++;
  }
  b = n - w;
  int ans = w, sum = 0, tmp;
  rep(i, n){
    if(s[i] == '.'){
      w--;
      tmp = sum + w;
    }
    else{
      sum++;
      tmp = sum + w;
    }
    ans = min(ans, tmp);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3728
#include<iostream>
#include<queue>
#include<map>
#include<unordered_map>
#include<stack>
using namespace std;

int main(){
    long long int n;
    cin >> n;
    
    stack<char> a;
    
    
    while(n>0){
        n--;
        a.push('a'+(n%26));
        n/=26;
    }
    while(!a.empty()){
        cout << a.top();
        a.pop();
    }
    cout << endl;
    return 0;

}

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

int N;
vector<int> h;

int main() {
    cin >> N;
    h.resize(N);
    for (int i = 0; i < N; ++i) cin >> h[i];

    int ans = 0;
    for (int l = 0; l < N; ++l) {
        while (h[l] > 0){
            int r;
            // 区間 [l, r) に水をやる
            for (r = l + 1; r < N; ++r) {
                if (h[r] <= 0) break;
            }
            for (int i = l; i < r; ++i) --h[i];
            ++ans;
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(void){
	int h,a,b;
	cin>>h>>a>>b;
	int cnt=0;
	for(int i=a;i<=b;i++){
		if(h%i==0){
			cnt++;
		}
	}
	cout<<cnt<<endl;
	return 0;
}



Measured memory_bytes: 3088
#include <iostream>
using namespace std;
int main(){
  long long n,a,b;
  cin >> n >> a >> b;
  long long ans;
  if(a==0){
    cout << 0 << endl;
    return 0;
  }else if(b==0){
    cout << n << endl;
    return 0;
  }
  if(n%(a+b)>=a){
    ans=(n/(a+b))*a+a;
  }else{
    ans=(n/(a+b))*a+n%(a+b);
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define pll pair<ll,ll>
#define pint pll
using ll = long long;
const int inf=1e9+7;
const ll longinf=1LL<<60 ;
const ll mod=1e9+7 ;

ll dp[200020];

int main(){
  ll h,n;
  cin >> h >> n;
  rep(i,200020)dp[i]=longinf;
  dp[0]=0;
  ll w[n],v[n];
  rep(i,n){
    cin >> w[i] >> v[i];
    dp[w[i]]=min(dp[w[i]],v[i]);
  }
  rep(i,n)REP(j,w[i],20000)dp[j]=min(dp[j],dp[j-w[i]]+v[i]);
  ll ans=longinf;
//  rep(i,100)cout << i << ' ' <<dp[i] << endl;
  REP(i,h,100020){
    if(dp[i]<longinf/2)ans=min(ans,dp[i]);
//    cout << ans << endl;
  }
  cout << ans << endl;
return 0;}

Measured memory_bytes: 1792
#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<unordered_map>
#include<array>
#include<map>
#include<bitset>
#include<iomanip>
#include<list>
using namespace std;
typedef unsigned long long int ulint;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
#define RE return 0
//ios::sync_with_stdio(false);
//std::cin.tie(0);
//<< setprecision(20)
const int mod=1e9+7;
const llint big=1e15+100;
const long double pai=3.141592653589793238462643383279502884197;
const long double ena=2.71828182845904523536;
const long double eps=1e-7;
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
template <class T> void soun(T& ar)
{sort(ar.begin(),ar.end());ar.erase(unique(ar.begin(),ar.end()),ar.end());}
llint gcd(llint a,llint b){if(a%b==0){return b;}else{return gcd(b,a%b);}}
llint lcm(llint a,llint b){return a/gcd(a,b) *b;}
template<class T,class U> auto LB(T& ve,U in){return lower_bound(ve.begin(),ve.end(),in);}
template<class T,class U> auto UB(T& ve,U in){return upper_bound(ve.begin(),ve.end(),in);}
template<class T,class U> auto LBI(T& ve,U in){return LB(ve,in)-ve.begin();}
template<class T,class U> auto UBI(T& ve,U in){return UB(ve,in)-ve.begin();}
template<class T> void SO(T& ve){sort(ve.begin(),ve.end());}
int main(void){
	int a,b,c;cin>>a>>b>>c;cout<<(a^b^c)<<endl;RE;
}


Measured memory_bytes: 256
import std.algorithm;
import std.array;
import std.ascii;
import std.bigint;
import std.complex;
import std.container;
import std.conv;
import std.functional;
import std.math;
import std.range;
import std.stdio;
import std.string;
import std.typecons;

auto readInts() {
	return array(map!(to!int)(readln().strip().split()));
}
auto readInt() {
	return readInts()[0];
}
auto readLongs() {
	return array(map!(to!long)(readln().strip().split()));
}
auto readLong() {
	return readLongs()[0];
}

void readlnTo(T...)(ref T t) {
    auto s = readln().split();
    assert(s.length == t.length);
    foreach(ref ti; t) {
        ti = s[0].to!(typeof(ti));
        s = s[1..$];
    }
}

const real eps = 1e-10;

const long p = 1_000_000_000 + 7;

void main(){
    auto n = readLong();
    auto s1 = readln.chomp();
    auto s2 = readln.chomp();

    if(n == 1) {
        writeln(3);
        return;
    }

    long ans = s1[0] == s1[1] ? 6: 3;
    // aa    ac    ab    ab    ab
    // bb    bc    ac    cd    ab
    foreach(i; iota(n-1)) {

        if(s1[i] != s2[i]) {
            if(s1[i] == s1[i+1]) {
                // aa
                // bb
                continue;
            }
            if(s1[i+1] == s2[i+1]) {
                // ac
                // bc
                continue;
            }
            if(s1[i+1] != s2[i+1]) {
                // ab
                // cd
                ans *= 3;
                ans %= p;
                continue;
            }
        } else {
            if(s1[i+1] != s2[i+1]) {
                // ab
                // ac
                ans *= 2;
                ans %= p;
                continue;
            } else {
                // ab
                // ab
                ans *= 2;
                ans %= p;
                continue;
            }
        }
    }
    writeln(ans);
}



Measured memory_bytes: 256
from collections import deque

n,m = map(int, input().split())

graph = [[] for _ in range(n+1)]
dist = [0] * (n+1)
visited = [0] * (n+1)


for _ in range(m):
    a,b = map(int, input().split())
    graph[a].append(b)
    graph[b].append(a)

root = 1
visited[root] = 1
d  = deque([root])

while d:
    v = d.popleft()
    for i in graph[v]:
        if visited[i]:
            continue
        visited[i] = 1
        dist[i] = v
        d.append(i)

print('Yes')
ans = dist[2:]
print(*ans, sep="\n")

Measured memory_bytes: 37176
num_bars = int(input())
length_list = list(map(int,input().split()))
length_list.sort()
#print(length_list)

count = 0

for i in range(num_bars):
  a = length_list[i]
  for j in range(i + 1,num_bars):
    b = length_list[j]
    if a == b:
      continue
    else :
      for k in range(j + 1,num_bars):
        c = length_list[k]
        if b == c:
          continue
        if a + b <= c:
          continue
        count += 1

        
print(count)
        
#  for j in 


Measured memory_bytes: 9208
#include <iostream>
#include <string>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <float.h>
#include <stdlib.h>
#include <functional>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define in cin >>
#define out cout <<
#define sort(v) sort(v.begin(),v.end())
#define reverse(v) reverse(v.begin(),v.end())
#define all(v) v.begin(),v.end()
 
int main(){
    int n;
    cin >> n;
    int a1=n/10;
    int n1=n-a1*10;
    int n2=n/100;
    int n3=a1-n2*10;
    if(n1==7 || n2==7 ||n3==7){
        cout << "Yes";
    }else
    {
        cout << "No";
    }
    
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, a, b) for (int i = a; i < b; i++)
//'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

int main() {
    int n;
    cin >> n;
    set<int> st;
    rep(i, 0, n) {
        int a;
        cin >> a;
        if (!(st.count(a))) st.insert(a);
        else st.erase(a);
    }
    cout << st.size() << endl;
    return 0;
}


Measured memory_bytes: 4864
import java.util.Scanner;

public class Main{
	public static void main(String[] args){
		int a, b,time;
		Scanner sc = new Scanner(System.in);
		a = sc.nextInt();
		b = sc.nextInt();

		time = (a+b) % 24;
		System.out.println(time);
	}
}

	


Measured memory_bytes: 21844
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
#define USE_LLONG_AS_INT
#ifdef USE_LLONG_AS_INT
#define int long long
#define inf (1ll<<60)
#else
#define inf (1<<30)
#endif
#define rep(i,n) for(int i=0;i<(n);i++)
#define Rep(i,a,b) for(int i=(a);i<(b);i++)
#define REP(i,a,b) for(int i=(a);i<=(b);i++)
#define rev(i,n) for(int i=(n)-1;i>=0;i--)
#define vi vector<int>
#define vvi vector<vi>
#define vs vector<string>
#define pb push_back
#define eb emplace_back
#define pi pair<int,int>
#define vp vector<pair<int,int>>
#define mp make_pair
#define all(v) (v).begin(),(v).end()
#define fi first
#define se second
#define MEMSET(a) memset(a,0,sizeof(a))
#define Yes(f) cout<<(f?"Yes":"No")<<endl
#define yes(f) cout<<(f?"yes":"no")<<endl
#define YES(f) cout<<(f?"YES":"NO")<<endl
#define SORT(v) sort(all(v))
#define RSORT(v) sort(all(v), greater<int>())

using namespace std;

const int mod=1e9+7;
// const int mod=998244353;
const string sp=" ";

void run();

void init() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout<<fixed<<setprecision(12);
}

signed main(){
    init();
    run();
    return 0;
}

void run(){
    int x,y;
    cin>>x>>y;
    rep(i,x+1){
        if(i*2+(x-i)*4==y){
            cout<<"Yes"<<endl;
            return;
        }
    }
    cout<<"No"<<endl;
}

Measured memory_bytes: 3652
#include<iostream>
#define LEN 10001
using namespace std;

bool search(int A[], int n, int key){
	int i = 0;
	A[n] = key; //关键
	while(A[i] != key) i++;
	return i!=n;
}

int main(){
	int n;
	int A[LEN];
	cin>>n;
	for(int i=0; i<n; i++){
		cin>>A[i];
	}

	int q;
	int sum = 0;
	cin>>q;
	for(int i=0; i<q; i++){
		int tem;
		cin>>tem;
		if(search(A, n, tem)) sum++;
	}
	cout<<sum<<endl;
	return 0;
}


Measured memory_bytes: 3108
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <iostream>
using namespace std;

int main() {
  string S;
  cin >> S;
  if (S.at(2)==S.at(3)&&S.at(4)==S.at(5)) {
    cout << "Yes" << endl;
  }
  else {
    cout << "No" << endl;
  }
}


Measured memory_bytes: 3600
#include <vector>
#include <stack>
#include <queue>
#include <list>
#include <bitset>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <numeric>
#include <iostream>
#include <iomanip>
#include <string>
#include <chrono>
#include <random>
#include <cmath>
#include <cassert>
#include <climits>
#include <cstring>
#include <cstdlib>
#include <functional>
#include <sstream>

using namespace std;


int main(int argc, char** argv) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << fixed << setprecision(12);

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

    int bal = 0;
    int mx = 0;
    for (int i = 0; i < n; ++i) {
        if (s[i] == '(') {
            ++bal;
        } else {
            --bal;
        }
        if (bal < 0) {
            mx +=  -bal;
            bal = 0;
        }
    }

    string res;
    res += string(mx, '(');
    res += s;
    if (bal > 0) {
        res += string(bal, ')');
    }

    cout << res << '\n';


    return 0;
}

Measured memory_bytes: 3664
<?php
/*
    Problem URL : http://arc059.contest.atcoder.jp/tasks/arc059_a

    Score  :
    Result :
    Time   : ms
    Memory : KB
 */

fscanf(STDIN, "%d", $N);
$ans = 0;

for ($i = 1; $i <= $N; $i++) {
    $ans += $i;
}
echo $ans . PHP_EOL;


Measured memory_bytes: 3452
#include <iostream>
#include <algorithm>
#include <cstring>

using namespace std;

int main()
{
    int n, k;
    int h[100001];
    int sa[1000010] = {0};
    int ans[100010] = {0};
    int cnt = 0;

    cin >> n >> k;

    for (int i = 0; i < n; i++) {
        cin >> h[i];
    }

    sort(h, h+n);

    for (int i = 1; i < n; i++) {
        sa[i-1] = h[i] - h[i-1];
    }

    for (int i = 0; i < n-(k-1); i++) {
        for (int j = i; j < i+(k-1); j++) {
            if (j == i) {
                ans[i] += sa[j];
            }
            else {
                ans[i] += sa[j];
            }
        }
    }

    sort(ans, ans + n-(k-1));

    cout << ans[0] << endl;
}

Measured memory_bytes: 4992
#include <iostream>
#include <map>

int n;
std::map<int, int> res;

void prime_factor(int n) {
    for (int i=2; i*i<=n; i++) {
        while (n%i == 0) {
            ++res[i];
            n /= i;
        }
        if (res.find(i) != res.end()) {
            int j=res[i];
            while (j > 0) {
                std::cout << ' ' << i;
                --j;
            }
        }
    }
    if (n != 1) {
        res[n] = 1;
        std::cout << ' ' << n;
    }
    std::cout << std::endl;
}

void solve(int n) {
    std::cout << n << ':';
    prime_factor( n );
}

int main() {
    std::cin >> n;
    solve( n );
    return 0;
}



Measured memory_bytes: 3140
import java.util.*;
public class Main{
	public static void main(String[] args){

		Scanner sr = new Scanner(System.in);
		String s = sr.next();
		int sum = 0;
		for(int i = 0; i < s.length(); i++){
			sum = sum + Integer.parseInt(s.substring(i, i + 1));
		}
		if(Integer.parseInt(s) % sum == 0){
			System.out.println("Yes");
		}else{
			System.out.println("No");
		}
	}
}

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

int main(void){
    int n;
    cin >> n;
    vector<ll> x(n), t(n);
    for (int i=0; i<n; i++) cin >> x[i];
    
    t = x;
    sort(t.begin(), t.end());
    int mid = (n-2) / 2;
    for (int i=0; i<n; i++) {
        if (x[i] <= t[mid]) cout << t[mid+1] << endl;
        else cout << t[mid] << endl;
    }
    
    return 0;
}

Measured memory_bytes: 6424
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<map>
#include<set>
#include<queue>
#include<deque>
#include<stack>
#include<cmath>
using namespace std;
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define All(v) (v).begin(),(v).end()
using ll = long long;
const ll mod = 1000000007;
const ll INF = 100000000000000000LL;
int main(){
    double a,b;
    cin >> a >> b;
    if (a == b)
        cout << "EQUAL" << endl;
    else if(a>b)
        cout << "GREATER" << endl;
    else
        cout << "LESS" << endl;
}

Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<stack>
#include<cstdlib> 
using namespace std;
int t[100005],a[100005];
int main(){
	int n,ans=0;
	cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i];
		t[a[i]]++;
		t[a[i]+1]++;
		t[a[i]+2]++;
	} 
	for(int i=0;i<=100002;i++){
		if(t[i]>ans){
			ans=t[i];
		}
	}
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1024
#include <iostream>
using namespace std;
int main(){
    
    int N ;
    cin >> N ;
    
    if((N >= 65)&&(N <= 90)){
        cout << 1 << endl;
    } else {
        if((N >= 97)&&(N <= 122)){
            cout << 2 << endl;
        } else {
            cout << 0 << endl;
        }
    }
    
    
    
}


Measured memory_bytes: 3112
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <sstream>
#include <string>
#define _repargs(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _repargs(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)
#define all(x) (x).begin(),(x).end()
#define mod 1000000007
#define inf 2000000007
#define mp make_pair
#define pb push_back
typedef long long ll;
using namespace std;
template <typename T>
inline void output(T a, int p = 0) {
    if(p) cout << fixed << setprecision(p)  << a << "\n";
    else cout << a << "\n";
}
// end of template

int main() {
    cin.tie(0);
    ios::sync_with_stdio(0);
    // source code
    string s;
    cin >> s;
    int N = (int)s.size();
    int cnt;
    if(N % 2 == 0){
        
        char c = s[N / 2 - 1];
        cnt = N / 2;
        for(int i = N / 2 - 1; i >= 0; i--){
            if(c == s[i] && c == s[N - 1 - i]) cnt++;
            else break;
        }
    }
    else{
        char c = s[N / 2];
        cnt = (N + 1) / 2;
        for(int i = N / 2 - 1; i >= 0; i--){
            if(c == s[i] && c == s[N - 1 - i]) cnt++;
            else break;
        }
    }
    output(cnt);
    
    
    return 0;
}


Measured memory_bytes: 512
#include <iostream>

using namespace std;

using ll = long long;
const int MAX_A = 100000;

int main() {
    int N;
    ll K;
    ll cnt[MAX_A + 1];
    for (int i = 0; i < MAX_A + 1; ++i) {
        cnt[i] = 0;
    }
    cin >> N >> K;

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

    ll total = 0;
    for (int ans = 1; ans <= MAX_A; ++ans) {
        if (K <= total + cnt[ans]) {
            cout << ans << endl;
            break;
        }
        total += cnt[ans];
    }
    return 0;
}

Measured memory_bytes: 1024
x1, y1, x2, y2 = map(int, input().split())
dx = x2 - x1
dy = y2 - y1
if (dx < 0 and dy >= 0) or (dx >= 0 and dy < 0):
  x3, y3 = x2 - dy, y2 + dx
  x4, y4 = x1 - dy, y1 + dx
else:
  x3, y3 = x2 - dy, y2 + dx
  x4, y4 = x1 - dy, y1 + dx
  
print(x3, y3, x4, y4)

Measured memory_bytes: 3064
import sys

def cal():
    N = int(input())

    for i in range(1, 3501):
        for j in range(1, 3501):
            num0 = 4*i*j-N*(i+j) 
            if num0 != 0:
                num = N*i*j/num0
                if num.is_integer() and 0 < num <= 3500:
                    print(i, int(num), j)
                    sys.exit()

cal()


Measured memory_bytes: 66280
#include <iostream>
#include <vector>
int main(){
  long long N;
  std::cin >> N;
  std::vector<long long> A(N);
  for (auto& x: A) std::cin >> x;
  std::vector<long long> C(N);
  for (const auto& a: A) ++C.at(a - 1);
  long long num = 0;
  for (const auto& c: C) num += c * (c - 1) / 2;
  for (const auto& a: A) {
    std::cout << (num - (C.at(a - 1) - 1)) << "\n";
  }
}
  

Measured memory_bytes: 5760
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.StringTokenizer;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

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

    static class D {
        public void solve(int testNumber, MyScanner in, PrintWriter out) {
            int N = in.Int();
            int[] A = new int[N + 1];
            for (int i = 0; i < N; i++) {
                A[i] = in.Int();
            }

            int idx = 0;
            long ans = 1000;
            for (int i = 0; i < N; i++) {
                if (A[i + 1] < A[i]) {
                    ans += (ans / A[idx]) * (A[i] - A[idx]);
                    idx = i + 1;
                }
            }
            out.println(ans);
        }

    }

    static class MyScanner {
        private BufferedReader in;
        private StringTokenizer st;

        public MyScanner(InputStream stream) {
            in = new BufferedReader(new InputStreamReader(stream));
        }

        public String next() {
            while (st == null || !st.hasMoreTokens()) {
                try {
                    String rl = in.readLine();
                    if (rl == null) {
                        return null;
                    }
                    st = new StringTokenizer(rl);
                } catch (IOException e) {
                    return null;
                }
            }
            return st.nextToken();
        }

        public int Int() {
            return Integer.parseInt(next());
        }

    }
}



Measured memory_bytes: 32840
#include <iostream>
  #include <complex>
  #include <vector>
  #include <string>
  #include <algorithm>
  #include <cstdio>
  #include <numeric>
  #include <cstring>
  #include <ctime>
  #include <cstdlib>
  #include <set>
  #include <map>
  #include <unordered_map>
  #include <unordered_set>
  #include <list>
  #include <cmath>
  #include <bitset>
  #include <cassert>
  #include <queue>
  #include <stack>
  #include <deque>
 #include <iomanip>
 
  using namespace std;
   

//abcdefghijklmnopqrstuvwxyz
//ABCDEFGHIJKLMNOPQRSTUVWXYZ
  typedef long long ll;
  typedef long double lld;
//   typedef string str;
//   typedef unsigned long long ull;
  ll INF = INT_MAX;
  ll mod = 1000000007;
  // lld PI = 3.141592653;

// const int N = 2e5 + 5;

// int a[N];
// int n,k;
  
 
ll power(ll a, ll b){
  if (a==0) return 0;
 ll result = 1;
 while (b>0){
   if (b%2==1) result = (result*a)%mod;
   a = (a*a)%mod;
   b/=2;
 }
 return result;
}

  int main()
  {
      ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
      int n,k;
      cin>>n>>k;
      ll cnt[k+1];
      cnt[k] = 1;
      ll ans = k;
      for (int a = k-1;a>=1; a--){
        ll zn = k/a;
        cnt[a] = power(zn, n);
        for (ll j = a*2; j<=k;j+=a){
          cnt[a] = (cnt[a]-cnt[j]+mod)%mod;
        }
        ans = (ans+cnt[a]*a)%mod;
      }
      cout<<ans<<"\n";
}
  

Measured memory_bytes: 3912
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii =  pair<int, int>;
using pll =  pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1000000009LL;
constexpr long long LINF = 1000100010001000100LL;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define fo(i, j, n) for(int i=(j); i<(n); i++)
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() { 
    int n, c; cin >> n >> c;
    vector<int> S(n), T(n), C(n);
    vector<vector<int>> counter(c, vector<int>(200010));
    rep(i, n){
        cin >> S[i] >> T[i] >> C[i]; C[i]--;
        int a = (S[i]-0.5)*2, b = T[i]*2;
        counter[C[i]][a]++;
        counter[C[i]][b]--;
    }

    int mx = 0, cnt = 0;
    rep(i, 200000){
        rep(j, c){
            if(counter[j][i]==1 && counter[j][i+1]==-1){
                counter[j][i] = counter[j][i+1] = 0;
            }
            cnt += counter[j][i];
            chmax(mx, cnt);
        }
    }
    cout << mx << ln;
}

Measured memory_bytes: 25856
n, m = [int(i) for i in input().split()]
am = sorted([int(i) for i in input().split()],reverse=True)
c = [2, 5, 5, 4, 5, 6, 3, 7, 6]

dp = [-1 for i in range(n+1)]
dp[0]=0
for i in range(n+1):
    #max_tmp = -float("inf")
    for j in am:
        if i+c[j-1]<=n:
            dp[i+c[j-1]] = max(dp[i+c[j-1]], dp[i]+1)
#print(dp)
tmp_n = n
ans =""
for i in range(dp[n]):
    for j in range(m):
        if i==dp[n]-1 and tmp_n- c[am[j]-1] != 0:
            continue
        if tmp_n - c[am[j]-1] >= 0 and dp[tmp_n - c[am[j]-1]] == dp[tmp_n] -1:
            ans+=(str(am[j]))
            tmp_n -= c[am[j]-1]
            break


print(ans)

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

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
constexpr double EPS = 1e-12;
constexpr int INF = numeric_limits<int>::max()/2;
constexpr int MOD = 1e9+7;

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

    int n,a,b;cin>>n>>a>>b;
    ll res=0;
    for(int i=1;i<=n;i++){
        int sum=0,num=i;
        while(num){
            sum += num%10;
            num /= 10;
        }
        if(a<=sum && sum<=b) res += i;
    }
    cout<<res<<endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<string>

using namespace std;

int main(){
  int i,a,b,j=0;
  string s;
  
  cin>>a>>b;
  cin>>s;
  for(i=0;i<a+b+1;i++){
    if(s[i]>='0'&&s[i]<='9')
      j++;
  }
  if(j==a+b&&s[a]=='-')
    cout<<"Yes"<<endl;
  else
    cout<<"No"<<endl;
  return 0;
  
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> P;
typedef pair<int,int> Pi;
#define rep(i,n) for(ll i=0;i<n;i++)
#define FOR(i,a,b) for(ll i=a;i<b;i++)
#define fi first
#define se second

template<typename T> inline bool chmax(T &a, T b){if(a<b){a=b;return true;}return false;}
template<typename T> inline bool chmin(T &a, T b){if(a>b){a=b;return true;}return false;}
template<typename T> ostream& operator<<(ostream& s,const complex<T>& d) {return s<<"("<<d.real()<<", "<<d.imag()<< ")";}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const pair<T1,T2>& d) {return s<<"("<<d.first<<", "<<d.second<<")";}
template<typename T> ostream& operator<<(ostream& s, const vector<T>& d){int len=d.size();rep(i,len){s<<d[i];if(i<len-1) s<<" ";}return s;}
template<typename T> ostream& operator<<(ostream& s,const vector<vector<T>>& d){int len=d.size();rep(i,len){s<<d[i]<<endl;}return s;}
template<typename T> ostream& operator<<(ostream& s,const set<T>& v){s<<"{ ";for(auto itr=v.begin();itr!=v.end();++itr) {if (itr!=v.begin()) {s<< ", ";}s<<(*itr);}s<<" }";return s;}
template<typename T1, typename T2> ostream& operator<<(ostream& s,const map<T1,T2>& m){s<<"{"<<endl;for(auto itr=m.begin();itr!=m.end();++itr){s<<" "<<(*itr).first<<" : "<<(*itr).second<<endl;}s<<"}"<<endl;return s;}

const ll mod=1e9+7;
const ll inf=1e17;
const int INF=1e9;
const double PI=acos(-1);
const double EPS=1e-10;

int main(){
	cin.tie(0);ios::sync_with_stdio(false);
	int h,w,k;
	cin>>h>>w>>k;
	vector<string> s(h);
	vector<vector<int>> g(h,vector<int>(w));
	rep(i,h){
		cin>>s[i];
		rep(j,w){
			g[i][j]=s[i][j]-'0';
		}
	}
	vector<vector<int>> sum(h,vector<int>(w+1,0));
	rep(i,h){
		rep(j,w){
			sum[i][j+1]=sum[i][j]+g[i][j];
		}
	}
	int ans=INF;
	rep(S,1<<(h-1)){
		int m=__builtin_popcount(S);
		vector<vector<int>> mp;
		int st=0;
		int T=S+(1<<(h-1));
		rep(i,h){
			if(1<<i & T){
				vector<int> now;
				FOR(j,st,i+1){
					now.push_back(j);
				}
				mp.push_back(now);
				st=i+1;
				//cout<<now<<endl;
			}
		}
		st=0;
		int now=m;
		rep(j,w){
			bool flag=false;
			for(auto itr:mp){
				int cnt=0;
				for(auto x:itr){
					cnt+=sum[x][j+1]-sum[x][st];
				}
				if(cnt>k){
					flag=true;
				}
			}
			if(flag){
				for(auto itr:mp){
					int cnt=0;
					for(auto x:itr){
						cnt+=sum[x][j+1]-sum[x][j];
					}
					if(cnt>k){
						now=INF;
						break;
					}
				}
				if(now==INF) break;
				now++;
				st=j;
			}
		}
		chmin(ans,now);
	}
	cout<<ans<<endl;
}

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

using namespace std;
string repeat(string s, int n) {
    string s1 = "";
    for (int i=0; i<n;i++)
        s1+=s;
    return s1;
}
string getString(char x) {
    string s(1, x);
    return s;
}

void optimizeIO(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
}
int gcd(int a, int b){
    if (a == 0)  return b;
    return gcd(b % a, a);
}
void  solve(){
  int x;
  cin>>x;
  if(x==7 || x==5 || x==3) cout<<"YES\n";
  else cout<<"NO\n";
}
int main(){
    optimizeIO();
    // tc
    { solve();
    }
}


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

#define int long long
#define double long double
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
#define uniq(x) (x).erase(unique(all(x)), (x).end())
#define bit(n) (1LL << (n))
#define dump(x) cerr << #x " = " << (x) << endl
using vint=vector<int>;
using vvint=vector<vint>;
using pint=pair<int, int>;
using vpint=vector<pint>;
template<typename T> using priority_queue_rev=priority_queue<T, vector<T>, greater<T>>;
constexpr double pi = 3.1415926535897932384626433832795028L;
constexpr int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int gcd(int a, int b) {
    while (b) { swap(a %= b, b); }
    return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
template<typename T> void fin(T mes) {
    cout << mes << endl;
    exit(0);
}
template<typename T1, typename T2> bool chmax(T1 &a, const T2 &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> bool chmin(T1 &a, const T2 &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &rhs) {
    os << "(" << rhs.first << ", " << rhs.second << ")";
    return os;
}
template<typename T> ostream &operator<<(ostream &os, const vector<T> &rhs) {
    os << "{";
    for (auto itr = rhs.begin(); itr != rhs.end(); itr++) {
        os << *itr << (next(itr) != rhs.end() ? ", " : "");
    }
    os << "}";
    return os;
}
struct setup {
    static constexpr int PREC = 20;
    setup() {
        cout << fixed << setprecision(PREC);
        cerr << fixed << setprecision(PREC);
    };
} setup;

int A, B, C, D;
void solve() {
    cin >> A >> B >> C >> D;
    // A<Bなら初手で死ぬ、B>Dなら減る一方
    if (A < B || B > D) {
        cout << "No" << endl;
        return;
    }

    if ((A - C - 1) % gcd(B, D) <= B - C - 2) { cout << "No" << endl; }
    else { cout << "Yes" << endl; }

}

int T;
signed main() {
    cin >> T;
    while (T--) { solve(); }
}


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

int main(){
	int N,K;
	long long count=0;
	cin >> N >> K;
	
	for(int b=1;b<=N;b++){
		count += max(0,b-K) * (N/b);
		count += max(0,N-b*(N/b)-K+1);
		if(K == 0){
			count--;
		}
	}
	
	cout << count << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
#pragma GCC optimize("O3")
#define REP(i,n) for(int i=0;i<n;i++)
#define REPP(i,n) for(int i=1;i<=n;i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define EPS (1e-9)
#define INF (1e17)
#define PI (acos(-1))
//const double PI = acos(-1);
//const double EPS = 1e-15;
//long long INF=(long long)1E17;
#define i_7 (long long)(1e9+7)
//#define i_7 998'244'353
long mod(long a){
    long long c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
long long po(long a, long b){
    if(b==0){
        return 1;
    }
    
    long long z = po(a,b/2);
    z = mod(z*z);
    if(b%2!=0){
        z = mod(a*z);
    }
    return z;
}
 
bool prime_(int n){
  if(n==1){
    return false;
  }else if(n==2){
    return true;
  }else{
    for(int i=2;i<=std::sqrt(n);i++){
      if(n%i==0){
        return false;
      }
    }
    return true;
  }
}
 
long long gcd_(long long a, long long b){
  if(a<b){
    std::swap(a,b);
  }
  if(a%b==0){
    return b;
  }else{
    return gcd_(b,a%b);
  }
}
 
long long lcm_(long long x, long long y){
  return (x/gcd_(x,y))*y;
}
 
//using namespace std;
using namespace boost::multiprecision;
//using namespace __gnu_pbds;

int main(){
  using namespace std;
  long long n;
  long long k;
  cin>>n>>k;
  int a[n];
  REP(i, n) cin>>a[i];
  
  vector<int> prev(20'0010, -1);
  long long g[n][61];
  REP(i, 2 * n){
    int ni = i % n;
    if(prev[a[ni]] < 0){
      prev[a[ni]] = i;
      continue;
    }
    
    int start = prev[a[ni]];
    if(start >= n) continue;
    g[start][0] = i - start + 1;
    prev[a[ni]] = i;
  }
  
  //REP(i, n) cout << g[i][0] << ' '; cout << endl;
  
  
  REPP(j, 60){
    REP(i, n){
      g[i][j] = g[i][j - 1];
      long long mid = i + g[i][j - 1];
      if(mid >= n * k){
        g[i][j] = n * k;
        continue;
      }
      long temp = g[(int)(mid % n)][j - 1];
      if(temp >= n * k){
        g[i][j] = n * k;
        continue;
      }
      g[i][j] += temp;
      g[i][j] = min(g[i][j], n * k);
    }
  }
  
  //REP(i, n) cout << g[i][60] << ' '; cout << endl;
  
  
  //ここでプログラムが止まらなっているっぽい
  //型をcpp_intにして解決...と思いきやメモリ確保に失敗
  //g[i][j] の取る値を制限する
  long long now = 0;
  while(now < n * k){
    long long i = now % n;
    int nj = -1;
    for(int j = 0; j <= 60; j++){
      if(now + g[i][j] < n * k){
        nj = j;
      }
    }
    if(nj < 0) break;
    now = now + g[i][nj];
  }
  
  //cout << now << endl;
  
  
  vector<bool> exist(200'010, false);
  stack<int> st;
  for(int i = (int)(now % n); i < n; i++){
    if(!exist[a[i]]){
      st.push(a[i]);
      exist[a[i]] = true;
      continue;
    }
    while(!st.empty()){
      if(st.top() == a[i]){
        st.pop();
        exist[a[i]] = false;
        break;
      }else{
        exist[st.top()] = false;
        st.pop();
      }
    }
  }
  vector<int> ans;
  while(!st.empty()){
    ans.push_back(st.top());
    st.pop();
  }
  reverse(ALL(ans));
  for(int& x: ans) cout << x << ' ';
  cout << endl; 
  
  return 0;
}

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

int N, T, E, a[400];

int main(){
    scanf("%d%d%d", &N, &T, &E);
    for(int x = 0; x < N; x++){
        scanf("%d", a+x);
    }
    int x;
    for(x = 0; x < N; x++){
        if(min(T%a[x], a[x]-T%a[x]) <= E){ break; }
    }
    if(x == N) puts("-1");
    else printf("%d\n", x+1);
    return 0;
}

Measured memory_bytes: 1188