akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>

#define int long long
#define double long double
#define ff first
#define ss second
#define endl '\n'
#define ii pair<int, int>
#define mp make_pair
#define mt make_tuple
#define DESYNC                      \
  ios_base::sync_with_stdio(false); \
  cin.tie(0);                       \
  cout.tie(0)
#define pb push_back
#define vi vector<int>
#define vii vector<ii>
#define all(x) x.begin(), x.end()
#define EPS 1e-9
#define INF 1e18
#define ROOT 1
#define M 1000000007
#define curtime chrono::steady_clock::now().time_since_epoch().count
#define rep(i, beg, n, s) for (int i = beg; i < n; i += s)
const double PI = acos(-1);

using namespace std;

inline int mod(int n, int m = M) {
  int ret = n % m;
  if (ret < 0) ret += m;
  return ret;
}

int exp(int n, int k) {
  if (k == 0) return 1;
  if (k == 1) return n;
  int ax = exp(n, k / 2);
  ax = mod(ax * ax);
  if (k % 2) ax = mod(ax * n);
  return ax;
}

int gcd(int a, int b) {
  if (a == 0)
    return b;
  else
    return gcd(b % a, a);
}
//#define MULTIPLE_TEST_CASE
void solution() {
  int n, m, k;
  cin >> n >> m >> k;
  char A[n][m];
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      cin >> A[i][j];
    }
  }

  int ans = 0;
  for (int mskr = 0; mskr < (1 << n); mskr++) {
    for (int mskc = 0; mskc < (1 << m); mskc++) {
      char B[n][m];
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
          B[i][j] = A[i][j];
        }
      }
      for (int i = 0; i < n; i++) {
        if (mskr & (1 << i)) {
          for (int j = 0; j < m; j++) B[i][j] = 'r';
        }
      }
      for (int j = 0; j < m; j++) {
        if (mskc & (1 << j)) {
          for (int i = 0; i < n; i++) B[i][j] = 'r';
        }
      }
      int black = 0;
      for (int i = 0; i < n; i++) {
        for (int j = 0; j < m; j++) {
          if (B[i][j] == '#') black++;
        }
      }
      if (black == k) ans++;
    }
  }
  cout << ans << endl;
}

int32_t main() {
  DESYNC;
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  int t = 1;
#ifdef MULTIPLE_TEST_CASE
  cin >> t;
#endif
  while (t--) solution();
}


Measured memory_bytes: 3640
#include <bits/stdc++.h>
using namespace std;
using Graph = vector<vector<int>>;

int main(){
    vector<vector<int>> A(3, vector<int>(3));
    vector<vector<int>> hantei(3, vector<int>(3));
    for (int i = 0; i < 3;i++)
    {
        for (int j = 0; j < 3;j++)
        {
            cin >> A[i][j];
            hantei[i][j] = 0;
        }
    }
    int N = 0;
    cin >> N;
    int b[N];
    for (int i = 0; i < N;i++)
    {
        cin >> b[i];
        for (int j = 0; j < 3;j++)
        {
            for (int k = 0; k < 3;k++)
            {
                if (A[j][k] == b[i])
                {
                    hantei[j][k] = 1;
                }
            }
        }
    }
    //テスト
 /*    for (int i = 0; i < 3; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            cout << hantei[i][j] << " ";
        }
        cout << endl;
    }*/
    //ここまで
    if(hantei[0][0] == hantei[0][1] && hantei[0][1] == hantei[0][2] &&hantei[0][2] == 1){
        cout << "Yes" << endl;
 
    }
    else if (hantei[1][0] == hantei[1][1] && hantei[1][1] == hantei[1][2] && hantei[1][2] == 1)
    {
        cout << "Yes" << endl;

    }
    else if(hantei[2][0] == hantei[2][1] && hantei[2][1] == hantei[2][2] &&hantei[2][2] == 1)
        {
            cout << "Yes" << endl;

    }
    else if (hantei[0][0] == hantei[1][0]  && hantei[1][0]== hantei[2][0] && hantei[2][0]== 1)
    {
        cout << "Yes" << endl;
    }
    else if (hantei[0][1] == hantei[1][1] && hantei[1][1] == hantei[2][1] && hantei[2][1] == 1)
    {
        cout << "Yes" << endl;

    }
    else if (hantei[0][2] == hantei[1][2] && hantei[1][2] == hantei[2][2] && hantei[2][2] == 1)
    {
        cout << "Yes" << endl;

    }
    else if (hantei[0][0] == hantei[1][1] && hantei[1][1] == hantei[2][2] && hantei[2][2] == 1)
    {
        cout << "Yes" << endl;

    }
    else if (hantei[0][2] == hantei[1][1] && hantei[1][1] == hantei[2][0] && hantei[2][0] == 1)
    {
        cout << "Yes" << endl;

    }
    else{
        cout << "No" << endl;

    }
}

Measured memory_bytes: 256
/*|In The Name Of Allah|*/
//This Month Will Be Expert ISA
#include <bits/stdc++.h>

using namespace std;

const int N = 2e5+5;

const int mod = 1e9+7;



int main(){
    int a[3];
    cin >> a[0] >> a[1] >> a[2];
    sort(a , a + 3);
    if(a[0] == a[1] && a[0] != a[2]){
        cout << "Yes";
    } else if(a[1] == a[2] && a[0] != a[1]){
        cout << "Yes";
    } else {
        cout << "No";
    }
}


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

int N, K;
long long res;

void solve()
{
	int i=K+1, j;
	if(K==0){
		res = 1ll*N*N;
		printf("%lld\n", res);
		return ;
	}
	if(i==0)
		i = 1;
	for(; i<=N; i++){
		j = N/i;
		/*if(i*j+K > N)
			j --;
		res += j*(i-K);
		res += N-i*j-K+1;*/
		res += 1ll*(j+1)*(i-K);
		res -= 1ll*i*j+(i-1) - max(N, i*j+K-1);
		//res -= (i*j+K-N);
	}
	printf("%lld\n", res);
}

int main()
{
	scanf("%d%d", &N, &K);
	solve();
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
// iostream is too mainstream
#include <cstdio>
// bitch please
#include <iostream>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <cmath>
#include <iomanip>
#include <time.h>
#define dibs reserve
#define OVER9000 1234567890
#define ALL_THE(CAKE,LIE) for(auto LIE =CAKE.begin(); LIE != CAKE.end(); LIE++)
#define tisic 47
#define soclose 1e-8
#define chocolate win
// so much chocolate
#define patkan 9
#define ff first
#define ss second
#define abs(x) ((x < 0)?-(x):x)
#define uint unsigned int
#define dbl long double
#define pi 3.14159265358979323846
using namespace std;
// mylittledoge

#ifdef DONLINE_JUDGE
	// palindromic tree is better than splay tree!
	#define lld I64d
#endif

int main() {
	cin.sync_with_stdio(0);
	cin.tie(0);
	cout << fixed << setprecision(10);
	int N,M;
	cin >> N >> M;
	vector<int> A(M);
	int odd =0;
	for(int i =0; i < M; i++) {
		cin >> A[i];
		if(A[i]%2 != 0) odd++;}
	if(odd > 2) {cout << "Impossible\n"; return 0;}
	for(int i =0; i < M; i++) if(A[0]%2 == 0 && A[i]%2 != 0) swap(A[0],A[i]);
	for(int i =1; i < M; i++) if(A[M-1]%2 == 0 && A[i]%2 != 0) swap(A[M-1],A[i]);
	for(int i =0; i < M; i++) cout << A[i] << ((i == M-1)?"\n":" ");
	vector<int> B;
	if(A[0] > 1) B.push_back(A[0]-1);
	if(M > 1) B.push_back(2);
	else B.push_back(1);
	for(int i =1; i < M-1; i++) B.push_back(A[i]);
	if(M > 1 && A[M-1] > 1) B.push_back(A[M-1]-1);
	M =B.size();
	cout << M << "\n";
	for(int i =0; i < M; i++) cout << B[i] << ((i == M-1)?"\n":" ");
	return 0;}

// look at my code
// my code is amazing


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

int main() {
  long long int result=0, temp=0;
  int n;
  cin >> n;
  for (int i=0; i<n; i++) {
    cin >> temp;
    result+=temp-1;
  }
  cout << result;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{

int x,a,b;
cin>>x>>a>>b;
if(x>a&&x>b){
       if(x-a<x-b)
              cout<<"A";
              else
                     cout<<"B";
}
if(x>a&&x<b){
       if(x-a<b-x)
              cout<<"A";
              else
                     cout<<"B";
}
if(x<a&&x>b)
{
       if(a-x<x-b)
              cout<<"A";
       else
              cout<<"B";
}
if(x<a&&x<b)
{
       if(a-x<b-x)
              cout<<"A";
       else
              cout<<"B";
}



    return 0;
}

Measured memory_bytes: 3108
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

//改造
typedef long long int ll;
using ll = long long int;
using ull = long long unsigned int;
using Int = long long int;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0 //デバッグする時1にしてね
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//ここから編集する
class Solve {
public:
    void solve() {
        vector<Int> x(3), y(3);
        for (int i = 0; i < 3; ++i) {
            cin >> x[i] >> y[i];
        }
        Int a = x[1] - x[0];
        Int b = y[1] - y[0];
        Int c = x[2] - x[0];
        Int d = y[2] - y[0];

        auto len = [&](int i, int j) {
            Int xx = x[j] - x[i];
            Int yy = y[j] - y[i];
            return sqrt(xx * xx + yy * yy);
        };


        Int S2 = abs(a * d - b * c);
        double max_len = 0.0;
        double len_sum = 0.0;
        for (int i = 0; i < 3; ++i) {
            len_sum += len(i, (i + 1) % 3);
            chmax(max_len, len(i, (i + 1) % 3));
        }
        double r = S2 / len_sum;
        double X = max_len * r / (2. * r + max_len);
        cout << X << endl;


    }
};


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

    Solve().solve();


    return 0;
}


Measured memory_bytes: 632
#include <bits/stdc++.h>
#define _GLIBCXX_DEBUG
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()
using namespace std;
using ll = long long;
using P = pair<int, int>;
using vi = vector<int>;
using vc = vector<char>;
using vb = vector<bool>;
using vs = vector<string>;
using vll = vector<long long>;
using vp = vector<pair<int, int>>;
using vvi = vector<vector<int>>;
using vvc = vector<vector<char>>;
using vvll = vector<vector<long long>>;
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 (b<a) {a=b; return 1;} return 0;}

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    
    int n;
    cin >> n;
    vi a(n);
    rep(i, n) cin >> a[i];
    int cnt = 0;
    int mx = 0;
    rep(i, n-1) {
        if (a[i] >= a[i+1]) chmax(mx, ++cnt);
        else cnt = 0;
    }
    cout << mx << endl;
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define lp(i, n) for (int i = 0; i < (int)n; ++i)
#define read(n) scanf("%d", &n)
using namespace std;

int main()
{
    int n;
    read(n);
    if(n <= 999)puts("ABC");
    else puts("ABD");
    return 0;
}


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

int main() {
  int N, X, T;
  cin >> N >> X >> T;

  cout << T * (N / X + min(N % X, 1)) << endl;

  return 0;
}


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

using namespace std;

const int maxn = 1e5+10;

int n,a[maxn],res;

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin>>n;
    for (int i=1;i<=n;i++) cin>>a[i];
    for (int i=1;i<=n;) {
        int type=-2;
        int j=i+1;
        while (true) {
            if (j>n) break;
            int now;
            if (a[j] > a[j-1]) now=1;
            else if (a[j] < a[j-1]) now=-1;
            else now=0;
            if (type==-2 && now!=0) type = now;
            else if (now!=0 && type!=now) break;
            j++;
           // cout<<type<< " "<<now<<endl;
        }
        res ++;
        i = j;
    }
    cout<<res<<endl;
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
using namespace std;
int main(void){
    int a,b,c,d;
    cin >> a >> b >> c >> d;
    if((abs(a-b)<=d && abs(b-c)<=d) || abs(a-c)<=d){
        cout << "Yes" << endl;
    }else {
        cout << "No" << endl;
    }
}


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

ll inf=9223372036854775806;

int main()
{
	//freopen("input.txt","r",stdin);freopen("output.txt","w",stdout);
	ios_base::sync_with_stdio(false); cin.tie(0);
	ll a,b;
	cin>>a>>b;
	cout<<abs((a-2)*(b-2));
	return 0;
}

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


Measured memory_bytes: 4420
<?php
list($n) = ints();
echo '0' . PHP_EOL;
list($s) = strs();
$l = 0;
$r = $n;
$start = $s;
while ($s !== 'Vacant') {
    $mid = intdiv($r + $l, 2);
    echo $mid . PHP_EOL;
    list($s) = strs();
    if ($s === 'Vacant') exit;
    if ($mid % 2) {
        if ($start === 'Male') {
            if ($s === 'Male') $r = $mid;
            else $l = $mid;
        } else {
            if ($s === 'Male') $l = $mid;
            else $r = $mid;
        }
    } else {
        if ($start === 'Male') {
            if ($s === 'Male') $l = $mid;
            else $r = $mid;
        } else {
            if ($s === 'Male') $r = $mid;
            else $l = $mid;
        }
    }
}
function strs()
{
    return explode(' ', trim(fgets(STDIN)));
}
function ints()
{
    return array_map('intval', explode(' ', trim(fgets(STDIN))));
}


Measured memory_bytes: 16236
#include<bits/stdc++.h>
//#include<tr1/unordered_map>
#pragma GCC optimize ("Ofast")
#define ll long long
#define pll pair<long long,long long>
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define F first
#define S second
#define forn(i, n) for(int i=0; i<int(n); i++)
#define Forn(i, n) for(int i=1; i<=int(n); i++)

using namespace std;

/*#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> rbtree;*/

int n;
set<string> m;

int main()
{
    cin.tie(0);ios_base::sync_with_stdio(false);
    cin >> n;
    forn(i, n)
    {
        string s;
        cin >> s;
        m.insert(s);
    }
    cout << m.size() << endl;
}


Measured memory_bytes: 19272
/*
─────────────────────
───────────████████──
──────────███▄███████
──────────███████████
──────────███████████
──────────██████─────
──────────█████████──
█───────███████──────
██────████████████───
███──██████████──█───
███████████████──────
███████████████──────
─█████████████───────
──███████████────────
────████████─────────
─────███──██─────────
─────██────█─────────
─────█─────█─────────
─────██────██────────
─────────────────────
*/
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>
 
#define int long long
#define read(a) int a; cin >> a;
#define readarr(a, n) int a[(n) + 1] = {}; fori(i, 1, (n)) {cin >> a[i];}
#define readmat(a, n, m) int a[n + 1][m + 1] = {}; fori(i, 1, n) {fori(j, 1, m) cin >> a[i][j];}
#define pb push_back
#define fi first
#define se second
#define rz resize
#define sz(s) (int)(s.size())
#define fori(i, a, b) for (int i = (a); i <= (b); i++)
#define ford(i, a, b) for (int i = (a); i >= (b); i--)
#define sort1(v) sort(v.begin(), v.end()) 
#define endl '\n'
 
using namespace std;
using namespace __gnu_pbds; 
 
typedef tree<long long,null_type,less<long long>,rb_tree_tag,tree_order_statistics_node_update> ordered_set;
typedef long long ll;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int, int> pii;
typedef vector<pair <int, int>> vpi;
typedef vector < vector <int> > vvi;
 
const int INF = 4e18;
const int mod = 1e9+7; 
     
signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);



    //start from here

    double l; cin >> l;
    double a = l/3;
    a = a*a*a;
    cout << fixed << showpoint;
    cout << setprecision(10) << a;

    return 0;
}


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

typedef long long int int64;

#define MAX(a,b) ((a)>(b)?(a):(b))
#define MIN(a,b) ((a)<(b)?(a):(b))
#define ABS(a) ((a)>(0)?(a):-(a))

#define POS(i,j) ((i)*n+(j))

void run(void){
  int n;
  scanf("%d",&n);
  int *a=(int *)malloc(sizeof(int)*n*n);
  int *dp=(int *)malloc(sizeof(int)*n*n);
  int64 cost=0;
  int i,j;
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      scanf("%d",a+POS(i,j));
      dp[POS(i,j)]=a[POS(i,j)];
      if(i<j) cost+=a[POS(i,j)];
    }
  }

  int k;
  for(i=0;i<n;i++){
    for(j=0;j<n;j++){
      for(k=0;k<n;k++){
	if(a[POS(i,j)]>a[POS(i,k)]+a[POS(k,j)]){
	  printf("-1\n");
	  return;
	} else if(i!=j && j!=k && k!=i && dp[POS(i,j)]==a[POS(i,j)] && a[POS(i,j)]==a[POS(i,k)]+a[POS(k,j)]){
	  cost-=dp[POS(i,j)];
	  dp[POS(i,j)]=dp[POS(j,i)]=0;
	}
      }
    }
  }
  printf("%lld\n",cost);
}

int main(void){
  run();
  return 0;
}


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

vector<vector<int> > G(101010);
int P[101010],L[101010],R[101010];
const int INF=1e7;

void bad(){
  cout<<"No\n";
  exit(0);
}

void dfs(int v,int p,int d){
  if(P[v]!=INF){
    if(P[v]%2!=d%2) bad();
  }
  for(auto u:G[v]) if(u!=p) dfs(u,v,d+1);
  return;
}

void dfs2(int v, int p){
  if(P[v]==INF) L[v]=-INF,R[v]=INF;
  else L[v]=R[v]=P[v];
  for(auto u:G[v]) if(u!=p){
    dfs2(u, v);
    if(P[v]==INF){
      L[v]=max(L[v],L[u]-1);
      R[v]=min(R[v],R[u]+1);
    }
  }
}

void dfs3(int v, int p){
  if(p!=-1){
    int ne[2]={P[p]+1,P[p]-1};
    bool flag=1;
    rep(i,2){
      if(L[v]<=ne[i]&&ne[i]<=R[v]){
        P[v]=ne[i];
        flag=0;
      }
    }
    if(flag) bad();
  }
  if(p!=-1){
    if(abs(P[p]-P[v])>1) bad();
  }
  for(auto u:G[v]) if(u!=p) dfs3(u,v);
}

int main(){
  int N; cin>>N;
  rep(i,N-1){
    int a,b; cin>>a>>b; a--,b--;
    G[a].push_back(b);
    G[b].push_back(a);
  }
  rep(i,N) P[i]=INF;
  int K; cin>>K;
  int r=-1;
  rep(i,K){
    int v,p; cin>>v>>p; v--;
    P[v]=p;
    r=v;
  }
  dfs(r,-1,P[r]);
  dfs2(r,-1);
  dfs3(r,-1);
  cout<<"Yes\n";
  rep(i,N) cout<<P[i]<<endl;
  return 0;
}


Measured memory_bytes: 13824
#include<stdio.h>
#include<stdlib.h>
#define $ qsort
#define l long
#define f scanf
#define z($) sizeof($)
#define v($) for(i=0;i<$;i++)
int lc(const void *a,const void *b){
    if(*(l*)a == *(l*)b)return 0;
    return *(l*)a < *(l*)b?1:-1;
}
int main(void){
    int x,y,a,b,c,i;
    f("%d %d %d %d %d",&x,&y,&a,&b,&c);
    l p[a],q[b],r[c];
    v(a)f("%ld",&p[i]);
    v(b)f("%ld",&q[i]);
    v(c)f("%ld",&r[i]);
    $(p,a,z(l),lc);
    $(q,b,z(l),lc);
    $(r,c,z(l),lc);
    l m[x+y+c];
    v(x)m[i]=p[i];
    v(y)m[i+x]=q[i];
    v(c)m[i+x+y]=r[i];
    $(m,x+y+c,z(l),lc);
    l l ans = 0;
    v(x+y)ans+=m[i];
    printf("%lld",ans);
    return 0;
}

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

using namespace std;

typedef double db;
typedef long long ll;
typedef long double ld;
typedef unsigned int ui;
typedef unsigned long long ull;

typedef pair < db, db > pdd;
typedef pair < db, ld > pdl;
typedef pair < ld, db > pld;
typedef pair < ld, ld > ldp;

typedef pair < ll, ll > pll;
typedef pair < int, ll > pil;
typedef pair < ll, int > pli;
typedef pair < int, int > pii;

#define F first
#define S second

#define en end()
#define bg begin()

#define rev reverse
#define mp make_pair
#define pb push_back

#define y1 y1234567890
#define um unordered_map

#define all(x) x.bg, x.en
#define sz(x) (int)x.size()
#define len(x) (int)strlen(x)

#define sqr(x) ((x + 0ll) * (x))
#define sqrd(x) ((x + 0.0) * (x))

#define forn(i, n) for (int i = 1; i <= n; i++)

const ll inf = (ll)1e18;
const ll mod = (ll)1e9 + 7;

const db eps = (db)1e-9;
const db pi = acos(-1.0);

const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};

const int N = 10;

int n, m, tot;
char c[N][N];

int main() {
	//freopen(".in", "r", stdin);
	//freopen(".out", "w", stdout);
	//freopen(".err", "w", stderr);

	//srand(time(NULL));

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

	//cout << setprecision(10) << fixed;
	
	cin >> n >> m;

	for (int i = 1; i <= n; i++) {
		for (int j = 1; j <= m; j++) {
			cin >> c[i][j];
			tot += c[i][j] == '#';
		}
	}

	if (tot != n + m - 1) {
		cout << "Impossible";
		return 0;
	}

	int x = 1, y = 1;

	while (x < n || y < m) {
		int cnt = 0;
		if (x < n)
			cnt += c[x + 1][y] == '#';
		if (y < m)
			cnt += c[x][y + 1] == '#';
		if (cnt != 1) {
			cout << "Impossible";
			return 0;
		}
		if (x < n && c[x + 1][y] == '#')
			x++;
		else
			y++;
	}

	cout << "Possible";
	
	//cerr << (clock() + 0.0) / CLOCKS_PER_SEC;

	return 0;
}


Measured memory_bytes: 256
#define _USE_MATH_DEFINES

#include <iostream>
#include <iomanip>
#include <string>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
//#include <atcoder/all>
using namespace std;
//using namespace atcoder;

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

//typedef modint998244353 mint;

const int BIG_NUM = 1e9;
const ll INF = 1000000000000000000;
const ll MOD = 1e9 + 7;
//const ll MOD = 998244353;

const ll MAX = 1e9 + 5;

int main() {
	int n;
	cin >> n;
	map<int, int> m;
	for (int i = 0; i < n; i++) {
		int a;
		cin >> a;
		m[a]++;
	}

	int cnt = 0;
	for (auto it = m.rbegin(); it != m.rend(); it++) {
		ll p2 = 1;
		ll num = it->first;
		while (p2 <= num) {
			p2 *= 2;
		}

		//cout << num << endl;
		
		auto it1 = m.find(p2 - num);
		if (it1 != m.end()) {
			
			if (it1->first == num) {
				cnt += it->second / 2;
			}
			else {
				int c = min(it1->second, it->second);
				it1->second -= c;
				cnt += c;

				if (it1->second == 0) {
					m.erase(it1);
				}

			}
			
			
		}
	}
	cout << cnt << endl;
}

Measured memory_bytes: 12996
[n,m,q] = list(map(int,input().split(" ")))
lst = []
for i in range (q):
    lst.append(list(map(int,input().split(" "))))

y = [1 for i in range(n)]

def f(index,li):
    if index == n:
        return eva(li)
    else:
        ret = 0
        t = 1
        if index>=1:
            t = li[index-1]
        for i in range (t,m+1):
            li[index]=i
            x = f(index+1,li)
            if ret < x:
                ret = x
        return ret
    
def eva(li):
    tmp = 0
    for k in range(q):
        a = lst[k][0]
        b = lst[k][1]
        c = lst[k][2]
        d = lst[k][3]
        if li[b-1]-li[a-1]==c:
            tmp = tmp + d
    return tmp
    
print(f(0,y))

Measured memory_bytes: 9256
N,K = gets.split.map(&:to_i)
cnt = [0]*N
K.times do
  onum = gets.to_i
  snum = gets.split.map(&:to_i)
  snum.each do |sn|
    cnt[sn-1] += 1
  end
end

p cnt.select{|cn| cn==0}.size
  

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

using namespace std;

int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0); 
	int n,temp,sum=0;
	cin>>n;
    
    for(int i=1;i<n;i++)
    {
        
        temp=n/i;
        if(n%i==0)
        sum=sum+temp-1;
        else
        sum=sum+temp;
    }
    cout<<sum;
	return 0;
}

Measured memory_bytes: 3644
# -*- coding: utf-8 -*-

from collections import deque

queue = deque()
input_list = [int(i) for i in input().split()]
for i in range(input_list[0]):
    proc = input().split()
    queue.append([proc[0],int(proc[1])])

count = 0
while len(queue) != 0:
    proc = queue.popleft()
    if input_list[1] < proc[1]:
        queue.append([proc[0],proc[1]-input_list[1]])
        count += input_list[1]
    else:
        count += proc[1]
        print(proc[0] + ' ' + str(count))

Measured memory_bytes: 15820
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
struct state {
	vector<int> v; int t;
};
bool operator<(const state& s1, const state& s2) {
	return s1.t != s2.t ? s1.t < s2.t : s1.v < s2.v;
}
int n, m;
int main() {
	cin >> n >> m;
	vector<vector<int> > x(m, vector<int>(n));
	for (int i = 0; i < n; i++) {
		for (int j = 0; j < m; j++) cin >> x[j][i];
	}
	int sum = 0; vector<vector<int> > e(m);
	for (int i = 0; i < m; i++) {
		int z = *min_element(x[i].begin(), x[i].end());
		sum += z;
		for (int j = 0; j < n; j++) {
			if (x[i][j] == z) e[i].push_back(j);
		}
	}
	vector<vector<state> > dp(m, vector<state>(n, state{ vector<int>(), 999999999 }));
	for (int i : e[0]) dp[0][i] = state{ vector<int>({ i }), 0 };
	for (int i = 1; i < m; i++) {
		for (int j : e[i]) {
			for (int k : e[i - 1]) {
				state f = dp[i - 1][k];
				f.v.push_back(j);
				if (j != k) f.t++;
				dp[i][j] = min(dp[i][j], f);
			}
		}
	}
	state ret = *min_element(dp[m - 1].begin(), dp[m - 1].end());
	cout << sum << ' ' << ret.t << endl;
	for (int i = 0; i < m; i++) cout << ret.v[i] + 1 << endl;
	return 0;
}

Measured memory_bytes: 3392
#include <algorithm>
#include <iostream>
#include <vector>
#include <string>
#include <utility>

using namespace std;

struct Node {
  long cnt;
  char ch;
  vector<Node*> ans;
};

int main() {
  string s, t;
  cin >> s >> t;

  vector<vector<Node>> dp(t.size() + 1);
  for (vector<Node>& vec : dp) vec.resize(s.size() + 1, Node{0, ' ', vector<Node*>()});
  
  for (size_t i = 1, size_i = t.size(); i <= size_i; ++i) {
    for (size_t j = 1, size_j = s.size(); j <= size_j; ++j) {
      char ch = t[i-1];
      if (ch == s[j-1]) {
        if (dp[i-1][j-1].cnt == 0) {
          dp[i][j].cnt = 1;
          dp[i][j].ch = ch;
        } else {
          dp[i][j].cnt = dp[i-1][j-1].cnt + 1;
          dp[i][j].ch = ch;
          dp[i][j].ans.push_back(&dp[i-1][j-1]);
        }
      } else {
        if (!(dp[i-1][j].cnt < dp[i][j-1].cnt)) {
          dp[i][j].cnt = dp[i-1][j].cnt;
          dp[i][j].ans.push_back(&dp[i-1][j]);
        } 
        if (!(dp[i][j-1].cnt < dp[i-1][j].cnt)){
          dp[i][j].cnt = dp[i][j-1].cnt;
          dp[i][j].ans.push_back(&dp[i][j-1]);
        }
      }
    }
  }
  string str = "";
  Node* res = &dp[t.size()][s.size()];
  while (res != nullptr) {
    if (res->ch != ' ')
      str += res->ch;
    res = res->ans.empty() ? nullptr : res->ans[0];
  }
  if (str.size()) reverse(str.begin(), str.end());
  else str = " ";
  cout << str << endl;
  return 0;
}


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

namespace CSharp
{
    class Program
    {
        public static void Main()
        {
            var input = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var r = input[0];
            var D = input[1];
            var x = input[2];

            var result = x;
            for (int i = 0; i < 10; i++)
            {
                result = r * result - D;
                Console.WriteLine(result);
            }
        }
    }
}

Measured memory_bytes: 13268
import math

N = int(input())
xy = [list(map(int, input().split())) for _ in range(N)]
distance = 0
for i in range(N):
    for j in range(N):
        distance += math.sqrt((xy[i][0] - xy[j][0]) ** 2 + (xy[i][1] - xy[j][1]) ** 2)
print(distance / N)


Measured memory_bytes: 3188
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define double long double
const int maxn =2e5+10;
const int mod=1e9+7;

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll a;
	double b;
	cin>>a>>b;
	cout<<(ll)(b*a)<<'\n';







}


Measured memory_bytes: 3748
import java.util.Scanner;

public class Main {

    static int mod = 1_000_000_000 + 7;

    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        int n = Integer.parseInt(scan.next());
        long[] a = new long[n + 1];
        long[] s = new long[n + 1];
        for (int i = 1; i <= n; i++) {
            int b = Integer.parseInt(scan.next());
            a[i] = b;
            s[i] = b;
        }
        scan.close();

        for (int i = 1; i <= n; i++) {
            s[i] += s[i - 1];
            s[i] %= mod;
        }

        long ans = 0;
        for (int i = 1; i < n; i++) {
            long cumsum = s[n] - s[i];
            if (cumsum < 0) {
                cumsum += mod;
            }
            long add = cumsum * a[i];
            add %= mod;
            ans += add;
            ans %= mod;
        }

        System.out.println(ans);
    }
}


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

using namespace std;
typedef long long ll;
#define REP(i,n) for(int i=0; i<int(n); i++)
#define FOR(i,m,n) for(int i=int(m); i<int(n); i++)
#define ALL(obj) (obj).begin(),(obj).end()
#define VI vector<int>
#define VLL vector<long long>
#define VVI vector<vector<int>>
#define VVLL vector<vector<long long>>
#define VC vector<char>
#define VS vector<string>
#define VVC vector<vector<char>>
#define fore(i,a) for(auto &i:a)

typedef pair <int, int> P;
template<class T> bool chmax(T &a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, T b) { if (a > b) { a = b; return true; } return false; }
const int  INF = 2147483647;
const ll INFL = 9223372036854775807;
const ll mod = 1000000007;







int main() {

	int n, k;
	cin >> n >> k;

	if ((n + 1) / 2 >= k) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}

	return 0;
	
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define pb push_back
#define mod int(1e9+7)
#define N int(2e5+100)
#define ll long long int
#define pii pair<int,int>
#define pll pair<ll,ll>
#define fi first
#define si second
using namespace std;
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
   int n;
   string s;
   map<string,int>m;
   cin>>n;
   for(int i=0;i<n;i++){
      cin>>s;
      m[s]++;
   }
   cout<<int(m.size())<<'\n';
   return 0;
}


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

#define mod      1e9+7;
#define INF      1e9+9;
#define ps(x,y)  fixed<<setprecision(y)<<x
# define PI 3.14159265358979323846264338327950 L
typedef long long ll;
typedef unsigned long long ull;
int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	ll a;
	double b;
	cin>>a>>b;
	ll c=round(b*100);
	c=c*a;
	c=c/100;
	cout<<c<<endl;
	return 0;
}


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

#define REP(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define REPS(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define RREP(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define RREPS(i, n) for (int i = ((int)(n)); i > 0; i--)
#define IREP(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define IREPS(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define VSORT(v) sort(v.begin(), v.end());
#define RVISORT(v) sort(v.begin(), v.end(), greater<int>());
#define ALL(v) v.begin(), v.end()

using VI = vector<int>;
using VVI = vector<VI>;
using PII = pair<int, int>;
using ll = long long;

typedef long long ll;

template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }

const ll mod=1e9+7;

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

	int n,m;cin >> n >> m;
	VI oks(n+1,true);
	REP(i,m){
		int a;cin>>a;
		oks[a]=false;
	}
	
	vector<long long int>dp(n+1);
	dp[0]=1;
	REP(now,n){
		for(int next=now+1;next<=min(n,now+2);next++){
			if(oks[next]){
				dp[next]+=dp[now];
				dp[next]%=mod;
			}
		}
	}

    cout << dp[n] << endl;

    return 0;
}

Measured memory_bytes: 1408
import java.util.Scanner;

public class Main {

	public static void main(String[ ] args) {
		Scanner sc = new Scanner(System.in);
		int i=1;

			while(sc.hasNext()) {
				int a = sc.nextInt();
				if(a==0)
					break;
				else
					System.out.printf("Case %d: %d\n", i, a);
				i++;
			}
	}
}


Measured memory_bytes: 69068
#include<bits/stdc++.h>
using namespace std;string s;int main(){cin>>s;bool flag=true;int len=s.length();for(int i=0,t=len/2-1;i<len/2;i++,t--) if(s[i]!=s[t]) {flag=false;break;}for(int i=len/2+1,t=len-1;i<len;i++,t--) if(s[i]!=s[t]) {flag=false;break;} for(int i=0,t=len-1;i<len;i++,t--) if(s[i]!=s[t]) {flag=false;break;} if(flag) cout<<"Yes\n";else cout<<"No\n"; return 0;}

Measured memory_bytes: 256
import java.util.Scanner;

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

    for(int i = 0; i < N; i++){
      d[i] = sc.nextInt();
    }

    int sum = 0;
    for(int i = 0; i < N - 1; i++){
      for(int j = i + 1; j < N; j++){
        sum += (d[i] * d[j]);
      }
    }

    System.out.println(sum);
  }
}

Measured memory_bytes: 22612
import sys
sys.setrecursionlimit(5 * 10**5)
input = sys.stdin.readline

N = int(input())

ans = [0]

for i in range(N - 1):
    c, s, f = map(int, input().split())

    for i in range(len(ans)):
        if s > ans[i]:
            ans[i] = s + c
        else:
            ans[i] = -(-ans[i] // f) * f + c

    ans.append(0)

print("\n".join(map(str, ans)))


Measured memory_bytes: 3064
#include<iostream>
#include<vector>
#include<algorithm>
#include<set>
#include<map>
#include<queue>
#include<cmath>
#include<iomanip>
#include<cstring>
#define initdp(a,b) for(int i=0;i<=a;i++)for(int j=0;j<=b;j++)dp[i][j]=-1;
#define fi first
#define se second
#define pb push_back
#define pii pair<int,int>
#define ppi pair<pii,int>
#define pip pair<int,pii>
#define ll long long
#define pll pair<ll,ll>
#define rep(i,n) for(int i=0;i<n;i++)
#define repd(i,n) for(int i=n-1;i>=0;i--)
#define inf 1000000001
#define inf1 1000000000000000001
#define mod 1000000007
#define pie 3.14159265358979323846
#define N 1000005
#define mid(l,r) l+(r-l)/2
using namespace std;
int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
void mad(ll &a,ll b){a=(a+b)%mod;if(a<0)a+=mod;}
ll gcd(ll a,ll b){ if(!a)return b;return gcd(b%a,a);}

void solve(){
	int n,k;
	cin>>n>>k;
	vector<int>z,o;
	string s;
	cin>>s;
	int a[n];
	int cur=0;
	if(n==1){cout<<0;return;}
	rep(i,n)a[i]=(s[i]=='L');
	//if(a[0])o.pb(0);
	//else z.pb(0);
	for(int i=1;i<n;i++){
		if(a[i]!=a[i-1]){
			if(a[i])o.pb(i);
			else z.pb(i);
		}
		else cur++;
		//cout<<cur;
	}
	int ans1=cur,ans2=cur;
	//cout<<ans1<<ans2;
	if(k>=o.size()){
		//ans1+=2*(o.size()-1)+1;
		if(a[0]==0)ans1=n-1;
		else ans1=n-2;
	}
	else ans1+=2*k;
	if(k>=z.size()){
		//ans2+=2*(z.size()-1)+1;
		if(a[0]==1)ans2=n-1;
		else ans2=n-2;
	}
	else ans2+=2*k;

	int ans=max(ans1,ans2);
	cout<<ans;
}
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	int t;
	//cin>>t;
	t=1;
	while(t--){
		solve();
	}
}

Measured memory_bytes: 1356
# coding: utf-8

N = int(input())
S = [None] * N
for i in range(N):
    S[i] = input()

cnt = {}

for s in S:
    if s in cnt.keys():
        cnt[s] += 1
    else:
        cnt[s] = 1

max_appeared = max(cnt.values())

max_list = [k for k, v in cnt.items() if v == max_appeared]
for k in sorted(max_list):
    print(k)


Measured memory_bytes: 35176
def main():
    N = int(input())
    i = 2
    ans = N + 1
    while i ** 2 <= N:
        if N % i == 0:
            ans = min(i + N / i, ans)
        i += 1
    print(int(ans - 2))


if __name__ == '__main__':
    main()

Measured memory_bytes: 2940
#include<bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define intput(i) cout << i << endl
#define ll long long
#define stringput(s) cout << (string)(s) << endl

int main(){
  int N;
  cin >> N;
  vector<int> P(N), Q(N);
  rep(i,N) cin >> P[i];
  rep(i,N) cin >> Q[i];
  vector<int> a(N);
  rep(i,N) a[i] = i + 1;
  map<vector<int>,int> mp;
  do{
    mp[a] = mp.size();
  }while(next_permutation(a.begin(),a.end()));
    int ans = abs(mp[P] - mp[Q]);
  cout << ans << endl;
} 


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

public class Main {
    public static void main(String[] args) throws IOException {
        BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
        String input = reader.readLine();
        int length = input.length();
        int latter = (length + 3) / 2  - 1;
        int i = 0;
        for (i = 0; i < length / 2; i++) {
            if (input.charAt(i) != input.charAt(input.length() - 1 - i)) {
                break;

            }
            if (i < (length) / 2) {
                if (input.charAt(i) != input.charAt((length) / 2 -1- i)) {

                    break;
                }
            }
            if (i < (length - latter) / 2) {
                if (input.charAt(length - i - 1) != input.charAt(latter + i)) {
                    break;
                }
            }
        }
        if (i == length / 2) {
            System.out.println("Yes");
        } else {
            System.out.println("No");
        }
    }
}

Measured memory_bytes: 22740
#include <cstdio>
#include <iostream>
#include <vector>
#include <string>
#include <utility>
using namespace std;

int main(){
	int num=0,taste=0;
	cin>>num>>taste;
	if(taste>=0){
		cout<<(num-1)*taste+((num-1)*num/2);
	}else{
		if((num-1)<=taste*(-1)){
			cout<<(taste*2+num-2)*(num-1)/2;
		}else{
			cout<<num*taste+num*(num-1)/2;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <iomanip>
using namespace std;
typedef long long ll;
template<typename T> using min_priority_queue = priority_queue<T, vector<T>, greater<T>>;

#define EPS (1e-7)
#define INF (1e15)
#define PI (acos(-1))
#define MOD 1000000007

#define REP(i,n) for(int i=0;i<n;i++)
#define REPS(i,f,n) for(int i=(f);i<(n);i++)
#define EACH(it,v) for(__typeof((v).begin()) it=(v).begin();it!=(v).end();it++)

#define dump(x)  cout << #x << " = " << (x) << endl;
#define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;
#define arrdump(n,a) for(int i=0;i<n;i++) {cout<<((i>0)? " ":"")<<a[i];}cout<<"\n";


typedef pair<int, int> P;
typedef pair<ll, ll> LP;
typedef pair<int, P> PP;
typedef pair<ll, LP> LPP;

int dy4[]={0, 0, 1, -1};
int dx4[]={1, -1, 0, 0};
int dx8[]={0, 0, 1, -1, 1, 1, -1, -1};
int dy8[]={1, -1, 0, 0, 1, -1, -1, 1};

//https://atcoder.jp/contests/abc076/tasks/abc076_c

int main() {
    string S, T; cin >> S >> T;

    if (S.length() < T.length()) {
        cout << "UNRESTORABLE" << "\n";
        return 0;
    }

    string ans = "~";
    REP(i, S.length() - T.length() + 1) {
        string sub = S.substr(i, T.length());

        bool can = true;
        REP(j, T.length()) {
            if (sub[j] != T[j] && sub[j] != '?') can = false;
        }

        if (can) {
            string P = S;
            REP(j, T.length()) {
                P[i+j] = T[j];
            }
            REP(j, S.length()) {
                if (P[j] == '?') P[j] = 'a';
            }
            ans = min(ans, P);
        }
    }

    if (ans != "~") {
        cout << ans << "\n";
    } else {
        cout << "UNRESTORABLE" << "\n";
    }

    return 0;
}

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

using namespace std;

int main() {
    int a, b;
    cin >> a >> b;
    if(a <= 0 && 0 <= b) cout << "Zero" << endl;
    else if(a > 0) cout << "Positive" << endl;
    else if((b - a + 1) % 2 == 0) cout << "Positive" << endl;
    else cout << "Negative" << endl;
    return 0;
}

//08:29:45

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <string>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <map>
using namespace std;
#define LL long long
#define N 10000
#define Inf 0x7fffffff

int main()
{
    ios::sync_with_stdio(false);
    LL k;
    int i=0;
    string s;
    while(cin>>s>>k)
    {
    	i=0;
    	while(s[i]=='1')
    	{
    		i++;
    		
		}
    	if(s[i-1]=='1'&&k<=i)
    	cout<<1<<endl;
    	else
    	cout<<s[i]<<endl;
	}
    return 0;
}


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

using namespace std;

#define MOD 1000000007

int main(){
  long long a,b,x; cin >> a >> b >> x;
  long long tmp=max(0LL,(x-b)/(a-b))%MOD;
  b%=MOD; x%=MOD;
  cout << (x+tmp*b)%MOD << endl;
  
  return 0;
}


Measured memory_bytes: 3080
#include<iostream>
#define debug(x) std::cout<<x<<std::endl;
int main(){
  int N=0,A=0,B=0;
  std::cin>>N;
  if (N==1) debug("Hello World");
  if (N==2) {
    std::cin>>A>>B;
    if(A<1||9<A) return 0;
    if(B<1||9<B) return 0;
    
    debug(A+B);
  }
  else return 0;
  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=int(a);i<int(b);++i)
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
int INF = (1LL << 30) - 1;
int MOD = 1e9+7;
main(){
    int H,W;
    cin >> H >> W;
    vector<string> S(H);
    rep(i,0,H)cin >> S[i];

    queue<P> que;
    que.push(P(0,0));
    int dist[H][W];
    rep(i,0,H)rep(j,0,W)dist[i][j] = INF;
    dist[0][0] = 0;
    while(!que.empty()){
        auto p = que.front();
        que.pop();
        int dx[] = {0,0,1,-1};
        int dy[] = {1,-1,0,0};
        int y = p.first, x = p.second;
        rep(i,0,4){
            int nx = x + dx[i], ny = y + dy[i];
            if(ny < 0 || ny >= H || nx < 0 || nx >= W)continue;
            if(S[ny][nx] == '#')continue;
            if(dist[ny][nx] != INF)continue;
            dist[ny][nx] = dist[y][x] + 1;
            if(ny == H-1 && nx == W-1)break;
            que.push(P(ny,nx));
        }
    }
    if(dist[H-1][W-1] == INF){
        cout << -1 << endl;
        return 0;
    }
    int cnt = 0;
    rep(i,0,H)rep(j,0,W)if(S[i][j] == '.')cnt++;
    cout << cnt - dist[H-1][W-1] - 1 << endl;
}

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

int main(int argc, char const *argv[])
{
	int n; cin >> n;
	int k; cin >> k;
	string s; cin >> s;
	s[k - 1] += ('a' - 'A');
	cout << s << endl;
	return 0;
}


Measured memory_bytes: 256
s = list(input())
index = len(s) // 2
before = list(''.join(s[0:index]))
af = s[index:]
af.reverse()
after = list(''.join(af))
c = 0
for x in range(len(before)):
  if before[x] == after[x]:
    continue
  else:
    c += 1

print(c)

Measured memory_bytes: 3064
import itertools
n = int(input())
data = []
for x in range(n):
    for y in range(int(input())):
        k, l = map(int, input().split())
        data.append((x, k - 1, l))
ans = 0
for i in itertools.product([1,0], repeat=n):
    s = True
    for g in data:
        if i[g[0]] == 1 and i[g[1]] != g[2]:
            s = False
            break
    if s:
        ans = max(ans, sum(i))
print(ans)

Measured memory_bytes: 3064
T = int(input())
K = []
for i in range(T):
    a = list(map(int,input().split()))
    K.append(a)

def pay(N):
    if N == 0:
        return 0
    if N == 1:
        return D
    if N in memo:
        return memo[N]

    m = float("inf")
    if N % 2 == 0:
        m = min(m, A + pay(N // 2))
    else:
        m = min(m, A + pay(N // 2) + D)
        m = min(m, A + pay(N // 2 + 1) + D)

    if N % 3 == 0:
        m = min(m, B + pay(N // 3))
    else:
        m = min(m, B + pay(N // 3) + D*(N%3))
        m = min(m, B + pay(N // 3 + 1) + D*(3 - N%3))

    if N % 5 == 0:
        m = min(m, C + pay(N // 5))
    else:
        m = min(m, C + pay(N // 5) + D*(N%5))
        m = min(m, C + pay(N // 5 + 1) + D*(5 - N%5))
        
    m = min(m, D*N)
    memo[N] = m
    return m

for i in range(T):
    memo = {}
    N, A, B, C, D = K[i]
    print(pay(N))


Measured memory_bytes: 89128
S = input()

flag = False

for i in range(len(S)):
    if i % 2 == 0: # 奇数番目
        if S[i] == 'L':
            flag = True
            break
    else: # 偶数番目
        if S[i] == 'R':
            flag = True
            break

if flag:
    print('No')
else:
    print('Yes')


Measured memory_bytes: 2940
#include <bits/stdc++.h>
#define be(v) (v).begin(),(v).end()
#define pb(q) push_back(q)
#define doublecout(a) cout<<fixed<<setprecision(10)<<a<<endl;
typedef long long ll;
using namespace std;
const ll mod=998244353;
template <class T>inline T lcm(T a,T b){return (a*b/__gcd(a,b));}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll a,b;
    cin>>a>>b;
    ll g=__gcd(a,b);
    ll ans=1;
    for(ll i=2;i*i<=g;i++){
        if(g%i==0){
            ans++;
            while(g%i==0){
                g/=i;
            }
        }
    }
    if(g!=1){
        ans++;
    }
    cout <<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
int main()
{
    ll t,n,k,i,j;
    char s;
    cin >> s;
    if(isupper(s)){
        cout << "A\n";
    }else{
        cout << "a\n";
    }
    return 0;
}


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

int n;

void dfs(string s, int mx){
    if(s.size()==n){
        cout<<s<<'\n';
        return;
    }
    for(int i=0;i<=mx+1;++i){
        dfs(s+char('a'+i), max(mx, i));
    }
}

int main(){
    cin>>n;
    dfs("a", 0);
}

Measured memory_bytes: 3572
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define ff first
#define ss second
#define rep(i,a,n) for(int i=a;i<n;i++)
#define M 1000000007
ll power(ll x, ll y, ll p)
{
    int res = 1;
    x = x % p;
    while (y > 0)
    {   if (y & 1)
        res = (res*x) % p;
        y = y>>1;
        x = (x*x) % p;
    }
    return res;
}
int main()
{
	IOS;
	string s;
	cin>>s;
	int l=s.size();
	vector<char>s1(l);
	vector<char>s2(l);
	for(int i=0;i<l;i+=2)
	s1[i]='1';
	for(int i=1;i<l;i+=2)
	s1[i]='0';
	for(int i=0;i<l;i+=2)
	s2[i]='0';
	for(int i=1;i<l;i+=2)
	s2[i]='1';
	int min1=INT_MAX;
	int ans=0;
	for(int i=0;i<l;i++)
	{
		if(s[i]!=s1[i])
		ans++;
	}
	min1=ans;ans=0;
	for(int i=0;i<l;i++)
	{
		if(s[i]!=s2[i])
		ans++;
	}
	min1=min(min1,ans);
	cout<<min1;
	

}


Measured memory_bytes: 592
#include <iostream>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <map>
#include <numeric>
#include <set>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
using namespace std;
typedef long long ll;
const int INF = 1<<15;
const ll MOD = 1e9+7;
const double EPS = 1e-9;


int main(int argc, const char * argv[]) {
  int A, B, T;
  cin >> A >> B >> T;
  cout << (T/A)*B << endl;
  return 0;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-
n, a, b = map(int,input().split())

if b < a:
    print(0)
elif n == 1 and a != b:
    print(0)
else:
    ans = ((n - 1) * b + a) - ((n - 1) * a + b) + 1 
    print(ans)


Measured memory_bytes: 2940
#pragma GCC optimize(3, "Ofast", "inline")

#include <bits/stdc++.h>

#define start ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define ll long long
#define int ll
#define ls st<<1
#define rs st<<1|1
#define pii pair<int,int>
#define rep(z, x, y) for(int z=x;z<=y;++z)
#define com bool operator<(const node &b)
using namespace std;
mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());
const int maxn = (ll) 3e5 + 5;
const int mod = 998244353;
const int inf = 0x3f3f3f3f;
int T = 1;

void solve() {
    int n;
    cin >> n;
    int ans = 0;
    rep(i, 1, n) {
        int x;
        cin >> x;
        if (i & 1) {
            if (x & 1)
                ++ans;
        }
    }
    cout << ans;
}

signed main() {
    start;
    while (T--)
        solve();
    return 0;
}

Measured memory_bytes: 3652