akhauriyash/Code-Regression huggingface dataset:
import java.util.Scanner;
public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int c = sc.nextInt();
		int ans = 0;
		for (int i = a; i <= b; i++) {
			
			if (c % i == 0) {
				ans++;
			}
		}
		
		System.out.println(ans);

	}

}



Measured memory_bytes: 26412
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define PI 3.141592653589793238
int main()
{
    // #ifndef ONLINE_JUDGE
    // freopen("F:/cpp/input.txt", "r", stdin);
    // freopen("F:/cpp/output.txt", "w", stdout);
    // #endif
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    string s;
    cin >> s;
    ll i;
    for (i=0;i<s.length();i++)
    {
        if (s[i] == '?')
        {
            if (i == 0 || i == s.length() - 1)
            s[i] = 'D';
            else
            {
                if (s[i-1] == 'P')
                s[i] = 'D';
                else if (s[i+1] == 'D')
                s[i] = 'P';
                else
                s[i] = 'D';
            }
        }
    }
    cout << s << "\n";
    return 0;
}

Measured memory_bytes: 3736
N = int(input())
c = list(str(input()))
count_R = 0
for ci in c:
    if ci == 'R':
        count_R += 1
count_over_R = 0
for ci in c[count_R:]:
    if ci == 'R':
        count_over_R += 1
print(count_over_R)

Measured memory_bytes: 11864
#include<stdio.h>
#include<math.h>
double d,r,s,z[6];
int n,i,j,a[50];
int main(){
	for(scanf("%d",&n);n--;){
		for(i=0;i<6;i++)
			scanf("%lf",z+i);
		r=z[2];
		s=z[5];
		d=hypot(*z-z[3],z[1]-z[4]);
		printf("%d\n",a[j++]=d>r+s?0:r>d+s?2:s>d+r?-2:1);
	}
	
	return
		n==14 ;
		/*
		a[0]==1 &&
		a[1]==1 &&
		a[2]==1 &&
		a[3]==0 &&
		a[4]==2 &&
		a[5]==2 &&
		a[6]==-2 &&
		a[7]== 0&&
		a[8]== 0&&
		a[9]==1 &&
		a[10]==1 &&
		a[11]==-2 &&
		a[12]==1 &&
		a[13]==2;
		*/
}

Measured memory_bytes: 0
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#include <stack>
using namespace std;
 
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define repl(i,s,n) for(int i=s; i<=n; ++i)
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define ktya(x) sort(all(x))
#define maxs(x,y) (x = max(x,y))
#define mins(x,y) (x = min(x,y))
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 1e18
#define INFLL 1000000000000000007LL
#define SIZE 200105
#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define mind(a,b) (a>b?b:a)
#define maxd(a,b) (a>b?a:b)
#define PI (acos(-1))
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
ll MOD = 1000000007;
// ll MOD=998244353;
typedef ll Weight;
struct Edge {
	int src, dst;
	Weight weight;
};
bool operator < (const Edge &e, const Edge &f) {
	return e.weight != f.weight ? e.weight > f.weight : // !!INVERSE!!
	e.src != f.src ? e.src < f.src : e.dst < f.dst;
}
int N;
int datas[1145141]={0};
ll powMod(ll x, ll k, ll m) {//x^k (mod n)
	if (k == 0)     return 1;
	if (k % 2 == 0) return powMod(x*x % m, k/2, m);
	else            return x*powMod(x, k-1, m) % m;
}
vector<ll> A,B;
int anspm[114514]={0};
int main(){
	cin>>N;
	int posi=0,nega=0;
	rep(i,N){
		ll x;
		cin>>x;
		A.pb(x);
		if(x!=0)B.pb(abs(x));
		if(x>0)posi++,anspm[i]=1;
		if(x<0)nega++,anspm[i]=-1;
		if(x==0)anspm[i]=-1;
	}
	sort(all(B));
	
	if(posi==N||nega==N){
		int mi=B[0];
		if(nega==N)mi*=-1;
		int memo=0;
		rep(i,N){
			if(A[i]==mi)memo=i;
		}
		anspm[memo]*=-1;
	}
	bool flag=true;
	rep(i,N)if(anspm[i]>0)flag=false;
	if(flag){
		int memo=0;
		rep(i,N){
			if(A[i]==0)memo=i;
		}
		anspm[memo]=1;
	}
	ll ans=0;
	rep(i,N)ans+=ll(anspm[i])*ll(A[i]);
	cout<<ans<<endl;
	vi plus,minus;
	rep(i,N){
		if(anspm[i]>0)plus.pb(A[i]);
		else minus.pb(A[i]);
	}
	int minus1=minus[0],plus1=plus[0];
	ll val=minus[0];
	for(int i=1;i<plus.size();i++){
		cout<<val<<" "<<plus[i]<<endl;
		val-=plus[i];
	}
	cout<<plus1<<" "<<val<<endl;
	val=plus1-val;
	for(int i=1;i<minus.size();i++){
		cout<<val<<" "<<minus[i]<<endl;
		val-=minus[i];
	}


}





Measured memory_bytes: 4716
s = list(input())
k = int(input())

for i, si in enumerate(s):
    if si != '1':
        ind = i
        res = si
        break
    if i == len(s) - 1:
        res = 'one'

if res == 'one':
    print(1)
elif ind >= k:
    print(1)
else:
    print(res)



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

#define int long long

signed main() {
  int n, d;
  while ( cin >> n >> d, n ) {
    vector<int> m(n), sum(n, 0);
    vector<vector<int> > c(n);    
    for ( int i = 0; i < n; i++ ) {
      cin >> m[i];
      c[i] = vector<int>(m[i]);      
      for ( int j = 0; j < m[i]; j++ ) {
	cin >> c[i][j];
	sum[i] += c[i][j];
      }
      m[i]--;      
    }

    bool flag = true;
    bool flag2 = true;    
    while ( flag && flag2 ) {
      flag = false;
      for ( int i = 0; i < n; i++ ) {
	int ma = 0;
	if ( m[i] == -1 ) continue;	
	for ( int j = 0; j < n; j++ ) {
	  if ( i == j ) continue;	  
	  ma = max(ma, sum[j]);	  
	}
	if ( abs(ma-(sum[i]-c[i][m[i]])) > d ) continue;
	sum[i] -= c[i][m[i]];
	m[i]--;
	if ( m[i] == -1 ) flag2 = false;	
	flag = true;
	break;	
      }      
    }
    if ( !flag2 ) cout << "Yes" << endl;
    else cout << "No" << endl;   
  }
  
  return 0;
}



Measured memory_bytes: 3148
#include <bits/stdc++.h>
#define ALL(a)  (a).begin(),(a).end()
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
typedef pair<int, int> 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; }
const long long INF = 1LL << 60;

//Knapsack2はvが小さく、Wが大きい
//　→ Wに注目してDP

//dp.at(i).at(j)は、i番目までの品物かつ価値j以上で、最も軽い重さ
vector<vector<ll>> dp(110, vector<ll>(110000, INF));


int main(){
  ll N, W;
  cin >> N >> W;
  vector<ll> w(N), v(N);
  for(int i = 0; i < N; i++){
    cin >> w.at(i) >> v.at(i);
  }
  
  for(int i = 0; i < 110; i++){
    dp.at(i).at(0) = 0;
  }
  for(int i = 1; i < 110000; i++){
    if(i <= v.at(0)) dp.at(0).at(i) = w.at(0);
  }

  for(int i = 1; i < N; i++){
    for(int j = 0; j < 110000; j++){
      chmin(dp.at(i).at(j), dp.at(i-1).at(j));
      if(j-v.at(i) >= 0) chmin(dp.at(i).at(j), dp.at(i-1).at(j-v.at(i)) + w.at(i));
    }
  }

  int res;
  for(int i = 0; i < 110000; i++){
    if(dp.at(N-1).at(i) <= W){
      res = i;
    }
  }
  cout << res << endl;
}

Measured memory_bytes: 95744
<?php
$str = trim(fgets(STDIN));
$strln = strlen($str);
$ans = 0;
for($i = 0; $i < ($strln-1)/2; $i++){
    if($str[$i] !== $str[$strln-$i-1]){
      $ans += 1;
      
    }
  }
echo $ans;

 

Measured memory_bytes: 4856
#include <iostream>
#include <iomanip>
#include <string>
#include <cstdlib>

using namespace std;  //このネームスペースを使う

int main(){
  int a,b;
  int i,sum;
  cin >> a >> b ;
  
  sum=0;
  for(i=0;i<2;i++){
    if(a > b){
      sum += a;
      a--;
    }
    else{
      sum += b;
      b--;
    }
  }
  cout << sum << endl;

  return 0;
}



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

//typedef
//------------------------------------------
typedef long long LL;
typedef vector<LL> VL;
typedef vector<VL> VVL;
typedef vector<string> VS;
typedef pair<LL, LL> PLL;

//container util
//------------------------------------------
#define ALL(a)  (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
#define PB push_back
#define MP make_pair
#define SZ(a) int((a).size())
#define EACH(i,c) for(typeof((c).begin()) i=(c).begin(); i!=(c).end(); ++i)
#define EXIST(s,e) ((s).find(e)!=(s).end())
#define SORT(c) sort((c).begin(),(c).end())

//constant
//--------------------------------------------
const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int MOD = 1000000007;

// grid
//--------------------------------------------
VL dx = {0, 1, 0, -1};
VL dy = {1, 0, -1, 0};
VL dx2 = {-1, 0, 1, -1, 1, -1, 0, 1};
VL dy2 = {-1, -1, -1, 0, 0, 1, 1, 1};

//debug
//--------------------------------------------
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

//IO accelerate
//--------------------------------------------
struct InitIO {
    InitIO() {
        cin.tie(nullptr);
        ios_base::sync_with_stdio(false);
        cout << fixed << setprecision(30);
    }
} init_io;

//template
//--------------------------------------------
template<typename T>
istream& operator >>(istream& is, vector<T>& vec) {
  for(T& x: vec) is >> x;
  return is;
}
template<typename T>
ostream& operator <<(ostream& os, const vector<T>& vec) {
  for(int i=0; i<vec.size(); i++){
    os << vec[i] << ( i+1 == vec.size() ? "" : "\t" );
  }
  return os;
}
template<typename T>
ostream& operator <<(ostream& s, const vector<vector<T>>& vv) {
	for (int i = 0; i < vv.size(); ++i) {
		s << vv[i] << endl;
	}
	return s;
}

//main code

int main(int argc, char const* argv[])
{
	LL a,b;
	cin >> a >> b;
	if (((a + b) % 2) == 1) {
		cout << "IMPOSSIBLE" << endl;
	}
	else {
		cout << (a+b)/2 << endl;
	}
	return 0;
}


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

typedef long long int ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vi> vvi;
typedef vector<vl> vvl;
typedef vector<string>vst;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<pii> vii;
typedef vector<pll> vll;

#define fastio ios_base::sync_with_stdio(false);cin.tie(0)
#define all(ct) ct.begin() , ct.end()
#define endl "\n"
#define fr(i,a) for(auto i:a)
#define f(i,a,b) for(int i=a;i<b;++i)
#define fd(i,a,b) for(int i=a;i>=b;--i)
#define pb push_back
#define in(d,v) d.find(v)!=d.end()
#define mp make_pair
#define size(a) int(a.size())

const int mod = 1e9 + 7;
const ll inf = ll(1e18);
const double PI = acos(-1);

ll modexp(ll x,ll n,int md){
    if(n==0)return 1;
    if(n%2==0)return modexp((x*x)%md,n/2,md);
    return (x*modexp((x*x)%md,n/2,md))%md;
}

int main(){
    fastio;
    //clock_t tm = clock();
    ll n,m,s=0;
    cin>>n>>m;
    vl a(m);
    f(i,0,m){
        cin>>a[i];s+=a[i];
    }
    if(s>n)cout<<-1<<endl;
    else cout<<n-s<<endl;
    //cout<<((clock()-tm)*1.0)/CLOCKS_PER_SEC<<endl;
}


Measured memory_bytes: 3740
#define _USE_MATH_DEFINES
#include <iomanip>
#include <iostream>
#include <vector>
#include <string>
#include <stack>
#include <queue>
#include <map>
#include <tuple>
#include <climits>
#include <algorithm>
#include <cmath>
using namespace std;

typedef long long LL;
typedef vector<int> VI;
typedef vector<double> VD;
typedef vector<LL> VLL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef vector<vector<long long>> VVLL;
typedef vector<vector<bool>> VVB;
typedef vector<vector<double>> VVD;

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define all(a) (a).begin(),(a).end()

const int MOD = 1000000007;

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

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

void debug(VI &arr){
	int n=arr.size();
	rep(i,n){
		cout<<arr.at(i)<<endl;
	}
}

void debug(VVI &board){
	int h = board.size();
	int w = board.at(0).size();
	rep(i,h){
		rep(j,w){
			cout << board.at(i).at(j) << " ";
		}
		cout<<endl;
	}
}

void debug(VVLL &board){
	int h = board.size();
	int w = board.at(0).size();
	rep(i,h){
		rep(j,w){
			cout<<board.at(i).at(j)<<" ";
		}
		cout<<endl;
	}
}

void debug(VS &board){
	int h = board.size();
	rep(i,h){
		cout<<board.at(i)<<endl;
	}
	return;
}

LL gcd(LL a,LL b){
	return b==0?a:gcd(b,a%b);
}

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

int main(){
	//cout<<fixed;
	//cout<<setprecision(9)<<...
	int x, y;
	cin>>x>>y;
	if((y - 2 * x) % 2){
		cout<<"No"<<endl;
	}else{
		int a,b;
		b = (y - 2 * x) / 2;
		a = x - b;
		if(a * b >= 0){
			cout<<"Yes"<<endl;
		}else{
			cout<<"No"<<endl;
		}
	}
	return 0;
}


Measured memory_bytes: 3640
h, w = map(int,input().split())
m = h * w
  
def d(a,b,c):
  return max(abs(a - b), abs(b - c), abs(a - c))

def c(h,w):
  a = m
  for i in range(1, h):
    l = i * w
    y = (h - i) // 2 * w
    t = (h - i) * (w // 2)
    a = min(a, d(l, y , m - l - y), d(l, t, m - l - t))
  return a

print(min(c(h, w), c(w, h)))


Measured memory_bytes: 3064
#include <bits/stdc++.h>
#include <math.h>
#define REP(i, n) for(int i = 0; i < (n); i++)
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const int INF = 1001001001;
const int mINF = -1001001001;


int main() {
  int n,a;
  cin >> n;
  ll sum = 0;
  int num_max = mINF;
  int num_min = INF;
  REP(i,n) {
    cin >> a;
    sum += a;
    num_max = max(a,num_max);
    num_min = min(a,num_min);
  }
  cout << num_min << " " << num_max << " " << sum << endl;
  return 0;
}



Measured memory_bytes: 3116
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

long double dp[310][310][310];
Int N;

long double solve(Int i, Int j, Int k) {
	if (i==0&&j==0&&k==0) {//終端条件
		return dp[i][j][k] = 0.0;
	}
	if (dp[i][j][k]>=0) {//既に探索済みならreturn
		return dp[i][j][k];
	}

	long double res = 0.0;
	if (i > 0) {
		res += solve(i - 1, j, k) * i;
	}
	if (j>0) {
		res += solve(i + 1, j - 1, k) * j;
	}
	if (k>0) {
		res += solve(i, j + 1, k - 1) * k;
	}
	res += N;
	res *= 1.0 / (i + j + k);

	return 	dp[i][j][k] = res;
}

int main() {

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

	cin >> N;

	Int a;
	Int cnt1 = 0;
	Int cnt2 = 0;
	Int cnt3 = 0;
	for (Int i = 0; i < N; i++) {
		cin >> a;
		if (a==1) {
			cnt1++;
		}
		else if (a==2) {
			cnt2++;
		}
		else {
			cnt3++;
		}
	}

	for (Int i = 0; i < 310; i++) {
		for (Int j = 0; j < 310; j++) {
			for (Int k = 0; k < 310; k++) {
				dp[i][j][k] = -1.0;
			}
		}
	}

	long double ans = solve(cnt1, cnt2, cnt3);
	cout << fixed << setprecision(10) << ans << "\n";
}


Measured memory_bytes: 465792
i,f,d[5];main(n){for(;i>4||scanf("%d",d+i)**d;i=++i%10,f*=!!i)n=(f>14|f==9|f==4|f==2?2:!(f&d[i%5]*2))+49,i<5?f|=(d[i]=d[i]-1?1<<d[i]-1:9):puts(&n);}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define ll long long 
 
 
ll  n;
int main() {
    cin>>n;
    vector <ll> l(n);
    for (ll i=0; i<n; i++){
        cin>>l[i];
    }
    
    if (n<3) {
        cout<<0;
        return 0;
    }
    
    set <string> sol;
    ll res=0;
    for (ll i=0; i<n; i++){
        for (ll j=i+1; j<n; j++){
            for (ll k=j+1; k<n; k++){
                if (l[i]+l[j]>l[k] && l[i]!=l[j] && l[i]!=l[k] && l[j]!=l[k] && l[i]+l[k]>l[j] &&l[j]+l[k]>l[i]){
                    res++;
                }
            }
        }
    }
 
    cout<<res;
    
    
    
    return 0;
}

Measured memory_bytes: 3628
#include<bits/stdc++.h>
using namespace std;
#define pb push_back
#define ll long long int
#define mp make_pair
#define S second
#define F first
ll mod=1e9+7;
#define input_from_file  freopen("input.txt", "r", stdin);

int main()
{
  // input_from_file;
  ll n,k,sum=0;;
  cin>>n>>k;
  vector<ll> wt(n+1,0),cost(n+1,0),dp(1e5+1,1e9);ll ans=0;
  for(ll i=1;i<=n;i++)  {cin>>wt[i]>>cost[i];sum+=cost[i];}
  dp[0]=0;
  for(ll i=1;i<=n;i++){
    for(ll j=sum;j>=cost[i];j--){
      dp[j]=min(dp[j],dp[j-cost[i]]+wt[i]);
    }
  }
  for(ll i=1;i<=sum;i++){
    if(k-dp[i]>=0) ans=max(ans,i);
  }
  cout<<ans;
  return 0;
}

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

int main(){
  string a,b,c;
  cin >> a >> b >> c;
  int n,m;
  n = a.size();
  m = b.size();
  if(a[n-1] == b[0] && b[m-1] == c[0]){
    puts("YES");
    return 0;
  }
  puts("NO");
  return 0;
}


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

using namespace std;

typedef long long ll;
typedef pair<int, int> P;
const int INF = numeric_limits<int>::max() / 2;

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

	vector<ll> dist(100001, INF);
	vector<ll> tree[100001];
	ll n, m; cin >> n >> m;
	for (int i = 0; i < m; i++) {
		int a, b; cin >> a >> b;
		a--; b--;
		tree[a].push_back(b);
		tree[b].push_back(a);
	}
	dist[0] = 0;
	queue<P> q;
	q.push(P(0, 0));//点、距離
	while (!q.empty()) {
		P nex = q.front(); q.pop();
		int d = nex.second, v = nex.first;
		for (int i = 0; i < (int)tree[v].size(); i++) {
			int next = tree[v][i];
			if (dist[next] == INF) {
				dist[next] = d + 1;
				q.push(P(next, d + 1));
			}
		}
	}
	ll odd = 0, even = 0;
	for (int i = 0; i < n; i++) {
		if (dist[i] % 2 == 0) even++;
		else odd++;
	}
	if (n - 1 == m) {
		//cout << n*(n - 1) / 2 - m - even*(even - 1) / 2 - odd*(odd - 1) / 2 << endl;
		cout << odd*even - m << endl;
	}
	else {
		int cnt = 0;
		for (int i = 0; i < n; i++) {
			for (int j = 0; j < (int)tree[i].size(); j++) {
				int a = i, b = tree[i][j];
				if (dist[a] % 2 == dist[b] % 2) cnt++;
			}
		}
		if (cnt != 0) cout << odd*(odd - 1) / 2 + odd*even + even*(even - 1) / 2 - m << endl;
		else cout << odd*even - m << endl;
		//else cout << n*(n - 1) / 2 - m - even*(even - 1) / 2 - odd*(odd - 1) / 2 << endl;
	}
	return 0;
}

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

int main() {
	int a[5];
	for(int i=0;i<5;i++){
		cin >> a[i] ;
	}
	for(int i=0;i<5;i++){
		if(a[i]<40){
			a[i]=40;
		}
	}
	cout << (a[0]+a[1]+a[2]+a[3]+a[4])/5 << endl;
	// your code goes here
	return 0;
}

Measured memory_bytes: 1160
#include <ctime>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>
#include <algorithm>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <map>
using namespace std;

typedef long long ll;
typedef double lf;
typedef long double Lf;
typedef pair <int,int> pii;
typedef pair <ll, ll> pll;

#define TRACE(x) cerr << #x << "  " << x << endl
#define FOR(i, a, b) for (int i = (a); i < int(b); i++)
#define REP(i, n) FOR(i, 0, n)
#define all(x) (x).begin(), (x).end()
#define _ << " " <<

#define fi first
#define sec second
#define mp make_pair

ll n, a, b, c, d;

int main() {
  cin >> n >> a >> b >> c >> d;
  b -= a;
  REP(i, n + 1) {
    if (c * (n - 1 - i) - d * i <= b && b <= -c*i + (n - 1 - i)*d) {
      puts("YES");
      return 0;
    }
  }

  puts("NO");
  return 0;
}


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

int main() {
	int n;
	int tot = 0;
	char c;
	string s;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> c;
		s += c;
		if (c == 'R') tot++;
	}
	int sum = tot;
	for (int i = 0; i < tot; i++) {
		//cout << s[i];
		if (s[i] == 'R') sum--;
	}
	cout << sum << endl;
	return 0;
}


Measured memory_bytes: 3756
N = int(input())
a = list(map(int,input().split()))

ans = 0
numcnt = {i:0 for i in range(100001)}

for i in a:
    numcnt[i]+=1
    
for x in range(1,100000):
    subans = numcnt[x-1]+numcnt[x]+numcnt[x+1]
        
    ans = max(ans,subans)
    
print(ans)

Measured memory_bytes: 24148
import           Control.Monad
import qualified Data.ByteString.Char8       as BS
import           Data.Maybe
import qualified Data.Vector.Unboxed         as V
import qualified Data.Vector.Unboxed.Mutable as VM

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

main = do
  [n, x, y] <- getIntList

  h <- VM.new n
  VM.set h (0::Int)

  d <- VM.new (n+1)

  let inf = 10^9 :: Int
      dfs i dist = do
        d_old <- VM.read d i
        if dist > d_old
          then return ()
          else do VM.write d i (min d_old dist)
                  when (i < n) $ dfs (i+1) (dist+1)
                  when (i > 0) $ dfs (i-1) (dist+1)
                  when (i == x) $ dfs y (dist+1)
                  when (i == y) $ dfs x (dist+1)

  forM_ [1..n] $ \i -> do
    VM.set d inf
    dfs i 0
    forM_ [1..n] $ \j -> do
      dist <- VM.read d j
      hh <- VM.read h dist
      VM.write h dist (hh+1)

  forM_ [1..(n-1)] $ \i -> do hh <- VM.read h i
                              print $ hh `div` 2

Measured memory_bytes: 1660
#include <iostream>
#include <cstdio>
int main(){
  char c;
  while(1){
    scanf("%c",&c);
    if(c=='\n')break;
    if('a' <= c && c <= 'z'){
      c = c - ('a' - 'A');
    }
    else if('A' <= c && c <= 'Z'){
      c = c + ('a' - 'A');
    }
    printf("%c",c);
  }
  printf("\n");
}

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

using namespace std;
vector<int> p;

bool prime[100001];
int main() {
  prime[0] = prime[1] = true;
  for(int i = 2; i < 100001; i++) {
    if(prime[i])continue;
    for(int j = i + i; j < 100001; j += i) {
      prime[j] = true;
    }
  }

  int k = 0;
  for(int i = 3; i < 100001; i++) {
    if(!prime[i] && !prime[(i + 1) / 2]) p.push_back(i);
  }

 
  
  int q;
  cin >> q;
  for(int i = 0; i < q; i++) {
    int l,r;
    cin >> l >> r;
    int ans = 0;
    for(int j = 0; j < p.size(); j++) {
      if(p[j] >= l && p[j] <= r) ans++;
    }
    cout << ans << endl;
  }
}
  


Measured memory_bytes: 768
odd = ['R', 'U', 'D']
even = ['L', 'U', 'D']

s = list(input())
ans = 'Yes'

for i in range(len(s)) :
    if i % 2 == 1 and not s[i] in even :
        ans = 'No'
    if i % 2 == 0 and not s[i] in odd :
        ans = 'No'


print(ans)

Measured memory_bytes: 3060
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<utility>
#include<cmath>
#include<climits>
#include<queue>
#include<stack>
#include<numeric>
#include<set>
#include<iomanip>
#include<map>
using namespace std;


typedef long long ll;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)



int main(){
  int a, b, c, x;
  cin >> a >> b >> c >> x;
  int ans = 0;
  for(int i = 0; i <= a; ++i){
    for(int j = 0; j <= b; ++j){
      for(int k = 0; k <= c; ++k){
        int value = i * 500 + j * 100 + k * 50;
        if(value == x)  ++ans;
      }
    }
  }

  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <set>
#include <map>
#include <iostream>
#include <utility>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <unordered_set>
#include <unordered_map>
#include <limits.h>
#include <cstring>
#include <tuple>
#include <cassert>
#include <numeric>
using namespace std;
// type alias
typedef long long LL;
typedef vector < int > VI;
typedef unordered_map < int, int > MAPII;
typedef unordered_set < int > SETI;
typedef pair< int , int > II;
typedef tuple< int, int, int > III;
// repetition
#define FORE(i,a,b) for(int i=(a);i<=(b);++i)
#define REPE(i,n)  for(int i=0;i<=(n);++i)
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  for(int i=0;i<(n);++i)
#define FORR(x,arr) for(auto& x:arr)
#define SZ(a) int((a).size())
// DP
#define MINUS(dp) memset(dp, -1, sizeof(dp))
#define ZERO(dp) memset(dp, 0, sizeof(dp))
// minmax
#define SMAX(a,b) a = max(a,b)
#define SMIN(a,b) a = min(a,b)
// debug cerr
#define TRACE true
#define dump(x) if(TRACE) { cerr << #x << " = " << (x) << endl; }
#define dump2(x,y) if(TRACE) { cerr << #x << " = " << (x) << ", " << #y << " = " << (y) << endl; }
#define dump3(x,y,z) if(TRACE) { cerr << #x << " = " << (x) << ", " << #y << " = " << (y) << ", " << #z << " = " << (z) << endl; }
#define dump4(x,y,z,a) if(TRACE) { cerr << #x << " = " << (x) << ", " << #y << " = " << (y) << ", " << #z << " = " << (z) << ", " << #a << " = " << (a) << endl; }
#define dumpAR(ar) if(TRACE) { FORR(x,(ar)) { cerr << x << ','; } cerr << endl; }

/*
 
 8/4/2018
 
 18:15-18:25, 22:45-22:55 1WA
 
 */

// $ g++ -std=c++14 -Wall -O2 -D_GLIBCXX_DEBUG x.cpp && ./a.out
//const int MAX_N=1e5+1;
string S;
void solve() {
  int N=SZ(S);
  REP(i,N-1) if(S[i]==S[i+1]) {
    cout<<i+1<<' '<<i+2<<endl;
    return;
  }
  REP(i,N) if(i+2<N&&S[i]==S[i+2]) {
    cout<<i+1<<' '<<i+3<<endl;
    return;
  }
  cout<<-1<<' '<<-1<<endl;
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  
  cin>>S;
  solve();
  return 0;
}


Measured memory_bytes: 512
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<string>

using namespace std;

#define INF 1000000007

int main(){
  int n;
  cin >> n;
  vector<int> a(n);
  vector<int> b(n);
  vector<int> c(n-1);
  for(int i = 0; i < n; i++){
    cin >> a[i];
    a[i]--;
  }
  for(int i = 0; i < n; i++){
    cin >> b[i];
  }
  for(int i = 0; i < n-1; i++){
    cin >> c[i];
  }
  int ans = 0;
  for(int i = 0; i < n-1; i++){
    if(a[i+1] == a[i]+1) ans += c[a[i]];
    ans += b[a[i]];
  }
  ans += b[a[n-1]];
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
const int INF=1e9,MOD=1e9+7;
const long long LINF=1e18;
using namespace std;
#define int long long
//template
bool f[1234][1234];
//main
signed main(){
  int N;cin>>N;
  std::vector<int> e[N];
  for(int i=0;i<N-1;i++){
    int a,b;cin>>a>>b;a--;b--;
    e[a].push_back(b);
    e[b].push_back(a);
  }
  std::vector<int> d(N,INF);
  d[0]=0;
  queue<int> que;
  que.push(0);
  while(que.size()){
    int p=que.front();que.pop();
    for(int m:e[p]){
      if(d[m]>d[p]+1){
        d[m]=d[p]+1;
        que.push(m);
      }
    }
  }
  int a=0;int b=0;
  for(int i=0;i<N;i++){
    if(a<d[i]){
      a=d[i];
      b=i;
    }
  }

  for(int i=0;i<N;i++)d[i]=INF;
  d[b]=0;
  que.push(b);
  while(que.size()){
    int p=que.front();que.pop();
    for(int m:e[p]){
      if(d[m]>d[p]+1){
        d[m]=d[p]+1;
        que.push(m);
      }
    }
  }
  a=0;
  for(int i=0;i<N;i++)a=max(a,d[i]);
  if(a%3==1)cout<<"Second"<<endl;
  else cout<<"First"<<endl;
}


Measured memory_bytes: 15984
/**
 * code generated by JHelper
 * More info: https://github.com/AlexeyDmitriev/JHelper
 * @author Apolloliu
 */

#include <iostream>
#include <fstream>

#include <bits/stdc++.h>

using namespace std;

#define MEM(a,b)    memset(a, b, sizeof(a))
#define UN(a)       sort(all(a)), a.erase(unique(all(a)), a.end())
#define REV(a)      reverse(all(a))
#define MP(a, b)    make_pair(a, b)
#define PAIR(a, b)  pair<int, int>(a, b)

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

const int MOD = 1e9 + 7;
const int maxn = 1;
const double EPS = 1e-8;

class CStones {
public:
    void solve(std::istream& in, std::ostream& out) {
        int n;
        string s;
        in>>n>>s;
        int res = n;
        std::vector<int> sumw(n, 0), sumb(n, 0);
        for(int i = 0; i < n; ++i){
            if(s[i] == '.'){
                sumw[i] = 1;
            }
            else {
                sumb[i] = 1;
            }
            if(i){
                sumw[i] += sumw[i-1];
                sumb[i] += sumb[i-1];
            }
        }
        if(n >= 2) {
            for (int i = 1; i < n; ++i) {
//                if (s[i] != s[i - 1]) {
//                    res = min(res, sumb[i] + sumw[n-1] - sumw[i]);
                    res = min(res, (i-sumw[i-1]) + (n-i-(sumb[n-1] - sumb[i-1])));
//                }
            }
        }
//        cerr << sumb[n-1] << ' ' << sumw[n-1] << endl;
        res = min(res, min(n-sumb[n-1], n-sumw[n-1]));
//        if(sumb[n-1] == n || sumw[n-1] == n)res = 0;
        out<<res<<endl;
    }
};


int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
	CStones solver;
	std::istream& in(std::cin);
	std::ostream& out(std::cout);
	solver.solve(in, out);
	return 0;
}

Measured memory_bytes: 2196
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int a,b,c,d;
    string ch;
    while(cin>>ch)
    {
        c=0;
        b=0;
       for(a=0;a<ch.size();a++)
       {
           if(ch[a]=='A'||ch[a]=='T'||ch[a]=='G'||ch[a]=='C')
           {
               b++;
               if(b>=c)
               {
                   c=b;
               }
             //  cout<<"dkfj"<<endl;
           }
           else
           {
               b=0;
           }
       }
       cout<<c<<endl;
    }



    return 0;
}


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

int main(){
    long long int q, h, s, d, n;
    cin >> q >> h >> s >> d >> n;

    long long int ans = n/2 * min({8*q, 4*h, 2*s, d});
    if(n % 2 == 1){
        ans += min({4*q, 2*h, s});
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3628
#include <stdio.h>
#define gc getchar_unlocked
#define pc putchar_unlocked

int ini() {
  int v = 0;
  for (char c = gc(); '0' <= c && c <= '9'; c = gc())
    v = v * 10 + (c - '0');
  return v;
}

void puti(int v) {
  char b[10]; int n = 0;
  while (v)b[n++] = '0' + v % 10, v /= 10;
  if (!n)b[n++] = '0';
  while (n--)pc(b[n]);
}

int Gcd(int n, int m) {
  return m ? Gcd(m, n % m) : n;
}

int main() {
  int x = ini();
  puti(360 / Gcd(360, x));
}

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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(int i=(s);i<=(n);i++)
#define repr(i,n) for(int i=n-1;i>=0;i--)
#define REPR(i,s,n) for(int i=(s);i>=(n);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
#define Eunique(v) v.erase(unique(all(v)),v.end())
#define Eback(s) s.erase(s.end()-1,s.end())
#define rev(v) reverse(all(v))
#define minvec(v) *min_element(all(v))
#define maxvec(v) *max_element(all(v))
#define pb push_back
#define pf push_front
#define mod 1000000007
#define m_p make_pair
#define DOUBLE fixed << setprecision(15)
#define OK puts("OK")
#define OK1 puts("OK1")
#define OK2 puts("OK2")
#define SIZE(s) (int)s.size()
#define INF ((1LL<<62)-(1LL<<31))
#define zero(x,n) setw(x) << setfill('0') << n

typedef long long ll;

typedef vector<int> vi;
typedef vector<long long> vll;
typedef vector<double> vd;
typedef vector<char> vc;
typedef vector<string> vs;

typedef vector<vi> vvi;
typedef vector<vll> vvll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<pair<int,int>> vpii;
typedef vector<pair<ll,ll>> vpll;

const double pi = acos(-1.0);

template<class A, class B>
ostream& operator<<(ostream& ost, const pair<A, B>&p) {
	ost << "{" << p.first << ", " << p.second << "} ";
	return ost;
}

template<class T>
ostream& operator<<(ostream& ost, const vector<T>&v) {
	ost << "{";
	for (int i = 0; i<(int)v.size(); i++) {
		if (i)ost << " ";
		ost << v[i];
	}
	ost << "} \n";
	return ost;
}

template<class A, class B>
ostream& operator<<(ostream& ost, const map<A, B>&v) {
	ost << "{";
	for (auto p:v) {
		ost << "{" << p.first << ", " << p.second << "} ";
	}
	ost << "} ";
	return ost;
}

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

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

ll gcd(ll x, ll y) {return __gcd(x,y);}
ll lcm(ll x, ll y) {return x/__gcd(x,y)*y;}

int main()
{
	ll n,q,b,e,k;
	cin >> n;
	vll a(n),v;
	rep(i,n) cin >> a[i];
	cin >> q;
	rep(i,q){
		cin >> b >> e >> k;
		v.pb(count(a.begin()+b,a.begin()+e,k));
	}
	for(auto& x:v) cout << x << endl;
	return 0;
}


Measured memory_bytes: 3152
import java.util.Scanner;
public class Main{
  public static void main(String[] args){
    Scanner inp = new Scanner(System.in);
    String s = inp.next();
    char c = s.charAt(0);
    int f=0;
    for(int i=1;i<s.length();i++){
      if(c!=s.charAt(i)){
        f = 1;
      }
    }

    if(f==1){
      System.out.println("Yes");
    } else {
      System.out.println("No");
    }

  }
}

Measured memory_bytes: 22996
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef pair<ll,ll> pll;
const ll mod=1e9+7;
//const ll mod=998244353;
const ll inf=1LL<<61;

int main() {
  ll k,a,b;
  cin >> k >> a >> b;
  ll ans=1;
  if(k-1>=a&&a+1<b) {
    ans+=a-1;
    k-=a-1;
    ans+=k/2*(b-a);
    ans+=k%2;
  }
  else {
    ans+=k;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define ll long long
using namespace std;
int mod=1e9+7;
int main(){
  //freopen("inputt.txt","r",stdin);
  int N,M;
  cin>>N>>M;
  int states=pow(2,N);
  int dp[states];
  int A[M];
  int B[M]={};
  rep(i,M){
  int a,b;
  cin>>a>>b;
  A[i]=a;
  rep(j,b){
   int c;
   cin>>c;
   B[i]+=pow(2,c-1);
}
}
  rep(i,states) dp[i]=mod;
  dp[0]=0;
  rep(s,states){
   rep(j,M){
  int t=s|B[j];
  dp[t]=min(dp[t],dp[s]+A[j]);
}
}
 if(dp[states-1]!=mod) cout<<dp[states-1]<<endl;
  else cout<<-1;
  return 0;
}

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

struct Fast {Fast(){cin.tie(0);ios::sync_with_stdio(0);}} fast;
using intpair = pair<int, int>;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define reps(i, n, m) for (int i = (int)(n); i <= (int)(m); i++)
#define ALL(obj) (obj).begin(), (obj).end()
#define rALL(obj) (obj).rbegin(), (obj).rend()
#define ceiv(a, b) ((int)((a) + (b) - 1)/(int)(b))
//#define int long long

signed main(){
    int x, t;
    cin >> x >> t;
    cout << max(0, x - t) << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
using namespace std;
#define int ll 
#define FOR(i,s,e) for(ll i = s; i <= (ll)e; ++i)
#define DEC(i,s,e) for(ll i = s; i >= (ll)e; --i)
#define IAMSPEED ios_base::sync_with_stdio(false); cin.tie(0);
#define db(x) cerr << #x << "=" << x << "\n"
#define db2(x, y) cerr << #x << "=" << x << " , " << #y << "=" << y << "\n"
#define db3(a,b,c) cerr<<#a<<"="<<a<<","<<#b<<"="<<b<<","<<#c<<"="<<c<<"\n"
#define dbv(v) cerr << #v << ":"; for (auto ite : v) cerr << ite << ' '; cerr <<"\n"
#define dbvp(v) cerr << #v << ":"; for (auto ite : v) cerr << "{"  << ite.f << ',' << ite.s << "} "; cerr << "\n"
#define dba(a,ss,ee) cerr << #a << ":"; FOR(ite,ss,ee) cerr << a[ite] << ' '; cerr << "\n"
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define ll long long 
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define f first
#define s second
#define reach cerr << "LINE: " << __LINE__ << "\n";
typedef pair <ll, ll> pi;
typedef tuple<ll,ll,ll> ti3;
string cts(char x) {string t(1,x); return t;}
ll rand(ll a, ll b) { return a + rng() % (b-a+1); }
const int MOD = 1e9 + 7;
const int inf = (int)1e9 + 500;
const long long oo = (ll)1e18 + 500;
template <typename T> void chmax(T& a, T b) { a = max(a, b); }
template <typename T> void chmin(T& a, T b) { a = min(a, b); }
const int MAXN = -1;
#ifndef LOCAL
#define cerr if(0)cout
#endif
int A[105];
int dp[105][100005]; //ways to get to idx with j cookies eaten
int sum[100005];

ll rsq(int x, int y) { return ((MOD+sum[y] - sum[x-1])%MOD+MOD)%MOD; }

int32_t main() 
{
	IAMSPEED
	int n, k; cin >> n >> k;
	FOR(i,1,n)cin>>A[i];
	dp[0][0] = 1;
	FOR(i,1,n) {
		memset(sum,0,sizeof sum);
		sum[0]=1;
		FOR(j,1,k) {
			sum[j]=sum[j-1]+dp[i-1][j];
			sum[j]%=MOD;
		}
		dp[i][0]=1;
		FOR(j,1,k) {
			if(j-A[i]<=0)dp[i][j]=sum[j];
			else dp[i][j]=rsq(j-A[i],j);
			dp[i][j]%=MOD;	
		}
	}
	cout << dp[n][k];
			
}



Measured memory_bytes: 82464
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
#include <iomanip>
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; }
const int INF=1001001001;
vector<pair<int64_t,int64_t>>pppp(int64_t x){
  vector<pair<int64_t,int64_t>>p;
  for(int64_t i=2;i*i<=x;i++){
    int cnt=0;
    if(x%i==0){
    while(x%i==0){cnt++;x/=i;}
    p.push_back(make_pair(i,cnt));
    }
  }
  if(x!=1){p.push_back(make_pair(x,1));}
  return p; 
}
 
int main() {
  int A,B;
  cin>>A>>B;
  if(A==1){A=14;}
  if(B==1){B=14;}
  if(A>B){cout<<"Alice"<<endl;}
  else if(A<B){cout<<"Bob"<<endl;}
  else{cout<<"Draw"<<endl;}
  return 0;
}

Measured memory_bytes: 3612
#include<bits/stdc++.h>
#define lson (o<<1)
#define rson (o<<1|1)
#define fi first
#define sc second
#define dbg(x) cout<<#x<<" = "<<(x)<<endl;
typedef long long ll;
typedef unsigned int uint;
typedef unsigned long long ull;
using namespace std;
const double pi=acos(-1);
const double eps=1e-6;
inline int lowbit(int x){return x&(-x);}
inline int read(){
	int f=1,x=0;char ch;
	do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');
	do{x=x*10+ch-'0';ch=getchar();}while(ch>='0'&&ch<='9');
	return f*x;
}
template<typename T> inline T max(T x,T y,T z){return max(max(x,y),z);}
template<typename T> inline T min(T x,T y,T z){return min(min(x,y),z);}
template<typename T> inline T sqr(T x){return x*x;}
template<typename T> inline void checkmax(T &x,T y){x=max(x,y);}
template<typename T> inline void checkmin(T &x,T y){x=min(x,y);}
template<typename T> inline void read(T &x){
x=0;T f=1;char ch;do{ch=getchar();if(ch=='-')f=-1;}while(ch<'0'||ch>'9');
do x=x*10+ch-'0',ch=getchar();while(ch<='9'&&ch>='0');x*=f;
}
template<typename A,typename B,typename C> inline A fpow(A x,B p,C yql){
	A ans=1;
	for(;p;p>>=1,x=1LL*x*x%yql)if(p&1)ans=1LL*x*ans%yql;
	return ans;
}
struct FastIO{
	static const int S=1310720;
	int wpos;char wbuf[S];
	FastIO():wpos(0){}
	inline int xchar(){
		static char buf[S];
		static int len=0,pos=0;
		if(pos==len)pos=0,len=fread(buf,1,S,stdin);
		if(pos==len)return -1;
		return buf[pos++];
	}
	inline int read(){
		int c=xchar(),x=0;
		while(c<=32&&~c)c=xchar();
		if(c==-1)return -1;
		for(;'0'<=c&&c<='9';c=xchar())x=x*10+c-'0';
		return x;
	}
}io;
//#define read io.read
int main()
{
//	freopen("","r",stdin);
//	freopen("","w",stdout);
	double a,s,d,f;
	cin >> a >> s >> d >> f;
	double sss=a*s/2;
	cout << fixed << setprecision(6) << sss;
	if(d==a/2&&f==s/2) cout << ' ' << 1;
	else cout << ' ' << 0;
	return 0;
}


Measured memory_bytes: 256
/*author: hyperion_1724
  date: 
*/
#include <bits/stdc++.h>
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);

	string S;
	cin>>S;
	int a1=0,a2=0;
	int N=S.length();
	for (int i = 0; i < N; ++i)
	{
		if(i%2==0)
		{
			if(S[i]!='0')
			{
				a1++;
			}
			else
			{
				a2++;
			}
		}
		else
		{
			if(S[i]!='1')
			{
				a1++;
			}
			else
			{
				a2++;
			}
		}
	}
	cout<<min(a1,a2)<<endl;

	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <cstring>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <bitset>
#include <stack>
#include <cmath>
#include <time.h>
#include <unordered_set>
#include <unordered_map>
#define ll long long
#define LINF 0x3f3f3f3f3f3f3f3f
#define INF 0x3f3f3f3f
#define PI 3.14159265
#define RAND (rand()*rand())
#define MAX(x, y) ((x) > (y) ? (x):(y)) 
#define MIN(x, y) ((x) > (y) ? (y):(x))
#define ABS(x) ((x) > 0 ? (x) : -(x))
#define CEIL(x, y) (((x) + (y) - 1)/(y))
using namespace std;
const int MAXN = 1e5 + 5;
const ll MOD = 1e9 + 7;
int N, M, K, Q, T;

int main()
{
	int i, j;
	scanf("%d%d", &N, &M);
	printf("%d", N*(N -1 )/ 2 + M*(M - 1) / 2);
}

Measured memory_bytes: 256
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <numeric>
#include <iomanip>
#define M_PI acos(-1)
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1000000007;
const int MAX_V = 201;
int now = 0;

const int MAX = 200000;
const int MOD = 1000000007;

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

// テーブルを作る前処理
void COMinit() {
	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 COM(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;
}
struct edge {
	int t;
	ll cost;
	edge(int _t, ll _cost) : t(_t)
		, cost(_cost) {
	}
};
bool isPrime(int n) {

	if (n == 1) return false;
	for (ll i = 2; i * i <= n; i++)
	{
		if (n % i == 0) return false;
	}
	return true;
}

ll gcd(int a, int b) {
	if (b == 0) return a;
	return gcd(b, a % b);
}
void Solve() {
	
	int n;
	ll k;
	cin >> n >> k;
	ll a[100010];
	ll ma = 0;
	bool find = false;
	ll gc = 0;
	for (size_t i = 0; i < n; i++)
	{
		cin >> a[i];
		
		if (k == a[i]) {
			cout << "POSSIBLE" << endl;
			return;
		}
		ma = max(a[i], ma);
		if (i == 0) gc = a[i];
		else gc = gcd(gc, a[i]);
	}
	if (k > ma) {
		cout << "IMPOSSIBLE" << endl;
		return;
	}

	if (k % gc == 0) {
		cout << "POSSIBLE" << endl;
	}else 
		cout << "IMPOSSIBLE" << endl;

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



Measured memory_bytes: 1024
N = int(input())
H = list(map(int, input().split()))

max_h = max(H)
AH = []
for i in H:
  AH.append([1 if j < i else 0 for j in range(max_h)])
  
AH = list(zip(*AH))

count= 0
for i in AH:
  prev = 0
  for j in i:
    if j != prev and j == 1:
      count += 1
    prev = j

print(count)
  

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
int main(){
  string e = "CODEFESTIVAL2016", s; cin >> s;
  int ans = 0;
  for(int i = 0; i < e.size(); i++) ans += e[i] != s[i];
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main (){
  int A,B,C,D;
  cin >> A >> B >> C >> D;
  for (int i = 0;i < 100;i++){
  C -= B;
    if (C <= 0){
    cout << "Yes" << endl;
      break;
    }
    A -= D;
    if (A <= 0){
    cout << "No" << endl;
      break;
    }
  }
}


Measured memory_bytes: 3624
#include <algorithm>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <sstream>
#include <functional>
#include <map>
#include <string>
#include <cstring>
#include <vector>
#include <queue>
#include <stack>
#include <deque>
#include <set>
#include <list>
#include <numeric>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll,ll> P;
const double PI = 3.14159265358979323846;
const double EPS = 1e-12;
const ll INF = 1LL<<29;
const ll mod = 1e9+7;
#define rep(i,n) for(int (i)=0;(i)<(ll)(n);++(i))
#define repd(i,n,d) for(ll (i)=0;(i)<(ll)(n);(i)+=(d))
#define all(v) (v).begin(), (v).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset((m),(v),sizeof(m))
#define chmin(X,Y) ((X)>(Y)?X=(Y),true:false)
#define chmax(X,Y) ((X)<(Y)?X=(Y),true:false)
#define fst first
#define snd second
#define UNIQUE(x) (x).erase(unique(all(x)),(x).end())
template<class T> ostream &operator<<(ostream &os, const vector<T> &v){int n=v.size();rep(i,n)os<<v[i]<<(i==n-1?"":" ");return os;}
#define N 200100
vector<int> g[N];
int g2[N];
int f[N], f2[N];

int grundy(int i, bool safe = false){
	vector<int> s;
	s.reserve(g[i].size());
	for(auto j: g[i]){
		if(safe && f[j]<0) return -1;
		s.push_back(f[j]);
	}
	sort(all(s)); UNIQUE(s);
	//cerr<<"grundy "<<i<<endl;
	//cerr<<s<<endl;
	rep(k, s.size()+1){
		if(k==s.size()||k!=s[k]) return k;
	}
}

void dfs(int u){
	f[u] = grundy(u, true);
	if(f[u]>=0) dfs(g2[u]);
}

bool dfs2(int u){
	int x = grundy(u);
	cerr<<u<<" "<<f[u]<<" "<<x<<endl;
	if(f[u]>=0) return x==f[u];
	f[u] = x;
	return dfs2(g2[u]);
}

int main(){
	int n;
	cin>>n;
	rep(i, n){
		int j;
		cin>>j;
		j--;
		g[j].push_back(i);
		g2[i] = j;
	}
	mset(f, -1);
	rep(i, n){
		if(g[i].empty()){
			f[i] = 0;
			dfs(g2[i]);
		}
	}
	//rep(k, 3) cerr<<f[k]<<" "; cerr<<endl;
	rep(i, n){
		if(f[i]>=0) continue;
		vector<int> s;
		s.reserve(g[i].size());
		for(auto j: g[i]){
			if(f[j]>=0) s.push_back(f[j]);
		}
		sort(all(s)); UNIQUE(s);
		bool ok = false;
		memcpy(f2, f, sizeof(f));
		rep(k, s.size()+1){
			if(k==s.size()||k!=s[k]){
				f[i] = k;
				ok |= dfs2(g2[i]);
				//if(ok) break;
				for(int l = k+1; ; l++,k++){
					if(k<s.size()&&l==s[k]) continue;
					memcpy(f, f2, sizeof(f));
					f[i] = l;
					ok |= dfs2(g2[i]);
					break;
				}
				break;
			}
		}
		cout<<(ok?"POSSIBLE":"IMPOSSIBLE")<<endl;
		//rep(k, n) cerr<<f[k]<<" "; cerr<<endl;
		break;
	}
	return 0;
}


Measured memory_bytes: 12544
open Scanf
open Printf
open String

(* Scanf.sscanf (read_line ()) "%d %d" 
             (fun x y -> Printf.printf "%d" ((x-1)*(y-1)));; *)

let abb s = (sub s 0 1) 
            ^ (string_of_int (length s - 2))
            ^ (sub s (length s - 1) 1);;

sscanf (read_line ()) "%s"
          (fun s -> printf "%s" (abb s));;


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

int main() {
	int N, K;
	cin >> N >> K;
	if (N % 2 == 0) {
		if (N / 2 >= K) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
	else {
		if ((N + 1) / 2 >= K) {
			cout << "YES" << endl;
		}
		else {
			cout << "NO" << endl;
		}
	}
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n;
	int b[110]={};
	int  ans=0;
	cin>>n;
	for(int i=1;i<n;i++)	cin>>b[i];
	ans+=b[1]+b[n-1];
	for(int i=1;i<=n;i++)	ans+=min(b[i+1],b[i]);		
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <set>
#include <stack>
#include <queue>
#include <vector>
#include <string>
#include <iostream>
#include <algorithm>
using namespace std;
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
typedef long long LL;
#define NN 120
#define INF 1LL << 60

LL vis[NN];
LL wet[NN];
LL combine[NN];
LL map[NN][NN];
LL S, T, minCut, N;
void Search(){
     LL i, j, Max, tmp;
     memset(vis, 0, sizeof(vis));
     memset(wet, 0, sizeof(wet));
     S = T = -1;
     for (i = 0; i < N; i++){
         Max = -INF;
         for (j = 0; j < N; j++){
             if (!combine[j] && !vis[j] && wet[j] > Max){
                tmp = j;
                Max = wet[j];
             }
         }
         if (T == tmp) return;
         S = T; T = tmp;
         minCut = Max;
         vis[tmp] = 1;
         for (j = 0; j < N; j++){
             if (!combine[j] && !vis[j]){
                wet[j] += map[tmp][j];
             }
         }
     }
}
LL Stoer_Wagner(){
    LL i, j;
    memset(combine, 0, sizeof(combine));
    LL ans = INF;
    for (i = 0; i < N - 1; i++){
        Search();
        if (minCut < ans) ans = minCut;
        if (ans == 0) return 0;
        combine[T] = 1;
        for (j = 0; j < N; j++){
            if (!combine[j]){
               map[S][j] += map[T][j];
               map[j][S] += map[j][T];
            }
        }
    }
    return ans;
}
int main(){
	LL u, v, m, c;
	while( scanf("%lld%lld", &N, &m) && (N+m) ){
		memset( map, 0, sizeof( map ) );
		LL ans = 0;
		for(LL i=0 ; i < m ; ++i){
			scanf("%lld%lld%lld", &u, &v, &c);
			if( c < 0 ) ans += c;
			else if( u != v ){
				map[u][v] += c;
				map[v][u] += c;
			}
		}
		ans += Stoer_Wagner();
		printf("%lld\n", ans);
	}
	return 0;
}

Measured memory_bytes: 1312