output
stringlengths
52
181k
instruction
stringlengths
296
182k
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while(t--) { long long a,b; cin >> a >> b; if(a==b) cout << 0 << " " << 0 << '\n'; else { long long g = ab...
### Prompt Please create a solution in Cpp to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given b...
#include<bits/stdc++.h> using namespace std; #define ll long long #define FAST1 ios_base::sync_with_stdio(false); #define FAST2 cin.tie(NULL); void solve() { ll a,b; cin>>a>>b; ll ans=abs(a-b); if(ans==0) { cout<<"0 0"; } else cout<<ans<<" "<<min(a%ans,ans-a%ans); } int main(){ FAST1; FAST2; int t; ...
### Prompt Create a solution in cpp for the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd(...
#include<bits/stdc++.h> #define ll long long using namespace std; int main(){ ios::sync_with_stdio(false);cout.tie(0);cin.tie(0); int te; cin>>te; while(te--){ ll a,b; cin>>a>>b; if(a<b) swap(a,b); if(a==b){ cout<<"0 0\n"; }else{ ll t=a-b; cout<<t<<' '<<min(b%t,t-b%t)<<'\n'; } } return 0; ...
### Prompt Your task is to create a Cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is g...
#include <stdio.h> int main() { int t; scanf("%d", &t); while(t--) { long long int a, b; scanf("%lld", &a); scanf("%lld", &b); if(a == 0) { printf("%lld 0\n", b); }else if(b==0) { printf("%lld 0\n", a); }e...
### Prompt Your challenge is to write a CPP solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans ...
#include <bits/stdc++.h> using namespace std; int main() { long long t; cin >> t; long long otv[t][2]; for (long long i=0; i<t; i++) { long long a,b; cin >> a >> b; if (a==b) { otv[i][0]=0; otv[i][1]=0; } else { if (a>b) { long long v=a; a=b; b=v; } long long ra...
### Prompt Please create a solution in CPP to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given b...
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--){ long long int a,b; cin>>a>>b; long long int diff = abs(a-b); long long int moves = 0; if(a==b) cout<<0<<" "<<0<<"\n"; else{ if(a>diff) moves = a%diff; ...
### Prompt Please formulate a cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given b...
#include <bits/stdc++.h> using namespace std; int main(){ int t; cin>>t; while(t--){ long long a, b; cin>>a>>b; if(a==b){ cout<<0<<' '<<0<<endl; }else{ long long c=abs(a-b); long long d=min(a%c, c-a%c); cout<<c<<' '<<d<<endl; } } }
### Prompt Please provide a CPP coded solution to the problem described below: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans ...
#include <iostream> #include <math.h> #include <algorithm> using namespace std; int main() { int t; cin >> t; while(t--){ long long a,b; cin >> a >> b; if(a == b){ cout << 0 << " " << 0 << endl; } else{ long long exc = abs(a-b); long long num = min(a%exc, exc - a%exc); ...
### Prompt Construct a Cpp code solution to the problem outlined: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by g...
#include <bits/stdc++.h> using namespace std; typedef long long int ll; #define PB push_back #define MP make_pair #define PPB pop_back int gcd(int a, int b){ if(b==0) return a; return gcd(b,a%b); } int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t=1; cin>>...
### Prompt Please formulate a CPP solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given b...
#include<iostream> #include<bits/stdc++.h> using namespace std; #define ll long long #define pb push_back #define mp make_pair #define ff first #define ss second #define MOD 1000000007 // void func(){ // } void solution(){ ll a,b; cin>>a>>b; ll val = abs(a-b); if(val==0){ cout<<"0 0"<<endl; return; ...
### Prompt Generate a Cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd(a,...
#include<bits/stdc++.h> #define ll long long using namespace std; int main() { // freopen("file.in", "r", stdin); int t; cin >> t; while(t--){ ll a, b; cin>>a>>b; if(a == b) { cout<<0<<' '<<0<<'\n'; continue; } cout<<abs(a-b)<<' '; ...
### Prompt Please create a solution in cpp to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given b...
#include<bits/stdc++.h> using namespace std; const int N=100200; typedef long long ll; int main(){ ll t; ll a, b, k, mi; cin>>t; while(t--){ cin>>a>>b; if(b>a)swap(a,b); if(a==b)cout<<"0 0"<<endl; else{ k=a-b; mi=min(a%k,k-a%k); cout<...
### Prompt Your task is to create a Cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is g...
#include<bits/stdc++.h> #define int long long #define pb push_back #define MAX INT_MAX #define MIN INT_MIN #define fr(a,b) for(int i = a; i < b; i++) #define rep(i,a,b) for(int i = a; i < b; i++) #define mod 1000000007 #define all(x) (x).begin(), (x).end() #define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL)...
### Prompt Create a solution in CPP for the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd(...
#include <bits/stdc++.h> using namespace std; #define ll long long int main(){ ll t; cin>>t; while(t--){ ll n,k; cin>>n>>k; if(abs(n-k)==0){ cout<<0<<" "<<0<<endl; continue; } ll p=abs(n-k); cout<<p<<" "<<min({n%p, k%p, p-(...
### Prompt Construct a Cpp code solution to the problem outlined: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by g...
#include <iostream> #include <fstream> #include <map> #include <vector> #include <algorithm> #include <queue> #include <cmath> #define MAX_N 10002 #define mp make_pair #define pb push_back #define pii pair<int,int> typedef long long ll; using namespace std; int main(){ int t; cin >> t; while(t--){ ll a,b; cin >> a...
### Prompt Create a solution in CPP for the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd(...
#include <iostream> using namespace std; long long int gcd(long long int a, long long int b) { if (a == 0) return b; if (b == 0) { return a; } if (a == b) return a; if (a > b) return gcd(a-b, b); return gcd(a, b-a); } int main() { int t; cin>>t...
### Prompt Create a solution in Cpp for the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd(...
#include <iostream> using namespace std; #include<bits/stdc++.h> #define ll long long int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int t; cin>>t; while(t--) { ll a,b,d; cin>>a>>b; if(a==b) { cout<<0<<" "<<0<<"\n"; } else if...
### Prompt Please provide a Cpp coded solution to the problem described below: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans ...
#include <iostream> using namespace std; #include<bits/stdc++.h> #define ll long long ll closestMultiple(ll n, ll x) { if(x>n) return x; n = n + x/2; n = n - (n%x); return n; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int t; cin>>t; ...
### Prompt Generate a Cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd(a,...
#include<bits/stdc++.h> using namespace std; #define ll long long #define loopf(i,a,b) for(int i=a;i<b;i++) #define loopb(i,a,b) for(int i=a;i>b;i--) #define pb push_back #define fast ios_base::sync_with_stdio(false);cin.tie(NULL); #define ff first #define ss second #define vc vector #define vii vector<int> #define vl...
### Prompt In Cpp, your task is to solve the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd...
#include <iostream> using namespace std; using ll = long long; void solve() { ll a, b; cin >> a >> b; if (a == b ) { cout << "0 0\n"; return; } ll dif = abs(a-b); ll up = a%dif; if (up > dif - up) { cout << dif << " " << dif - up << endl; } else { c...
### Prompt Your challenge is to write a Cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans ...
#include <bits/stdc++.h> #define x first #define y second #define pb push_back #define all(x) (x).begin(), (x).end() #define rall(x) (x).rbegin(), (x).rend() using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; int main() { ios_base::sync_with_stdio(false); cin.tie(...
### Prompt Please provide a Cpp coded solution to the problem described below: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans ...
#include<bits/stdc++.h> using namespace std; #define ll long long #define ld long double #define pb push_back #define pf push_front #define pll pair<ll,ll> #define pii pair<int,int> #define vll vector<ll> #define vi vector<int> #define sz(v) (ll)v.size() #define all(v) v.begin(),v.end() #define pq_max priority_queue<ll...
### Prompt Construct a cpp code solution to the problem outlined: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by g...
#include <bits/stdc++.h> #define error(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); } #define sz(x) (int)x.size() #define all(x) x.begin(),x.end() using namespace std; using ll = long long; void err(istream_iterator<s...
### Prompt Generate a cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd(a,...
#include<iostream> using namespace std; #define long long long int main() { long tt; cin>>tt; while(tt--) { long a,b; cin>>a>>b; long h1,m1; h1=abs(a-b); if(h1==0) { cout<<0<<" "<<0<<endl; } else if(a==0 || b==0) { cout<<max(a,b)<<" "<<0<<endl; } else { m1=min(a%h1,h1-a%h1); ...
### Prompt Your challenge is to write a CPP solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans ...
#include <bits/stdc++.h> #define endl '\n' //pls remove while debugging #define ll long long int using namespace std; void solve() { ll a, b; cin>>a>>b; if (a == b) { cout<<0<<" "<<0<<endl; return; } ll dif = abs(a-b); cout<<abs(a - b)<<" "<<min(a%dif, dif- a%dif)<<endl; } int...
### Prompt Develop a solution in Cpp to the problem described below: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given b...
#include <bits/stdc++.h> using namespace std; #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC optimization ("unroll-loops") #define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); #define inf 1e18+5 #define mod 1000000007 #define MAXN 100005 #define ll long long #define p...
### Prompt Please formulate a Cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given b...
#pragma GCC target("avx2") #pragma GCC optimize("Ofast") #pragma GCC optimize("unroll-loops") #include <bits/stdc++.h> //#include <atcoder/all> using namespace std; //using namespace atcoder; #define DEBUG #ifdef DEBUG template <class T, class U> ostream &operator<<(ostream &os, const pair<T, U> &p) { os << '(' << ...
### Prompt Develop a solution in cpp to the problem described below: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given b...
#include<bits/stdc++.h> using namespace std; #define ll long long int main(){ ll t; cin >> t; while (t--){ ll a, b; cin >> a >> b; if(a == b) cout << "0 0" << endl; else{ ll mE = abs(a - b); ll mA; ll x1 = (a/mE + 1) * mE - a; ...
### Prompt Create a solution in cpp for the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd(...
#include <bits/stdc++.h> using namespace std; #define ll long long #define int long long #define all(x) x.begin() , x.end() #define ld long double #define debug(x) cout << #x << " = " << x << "\n" const long long inf = 1e18 + 5LL; const int inf32 = INT_MAX; const int mod = 998244353 ; //1e9 + 7LL; const int N = (1e6 + ...
### Prompt Your task is to create a Cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is g...
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main() { ll t; cin>>t; while(t--) { ll a,b; cin>>a>>b; if(a==b) { cout<<"0"<<" "<<"0"<<endl; } else{ ll g=abs(a-b); cout<<g<<" "; cout<<min(a%g,g-a%g...
### Prompt Generate a CPP solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd(a,...
#include <bits/stdc++.h> using namespace std; typedef long long ll; void testcase () { ll a, b; cin >> a >> b; if (a < b) swap (a, b); if (a == b) { puts ("0 0"); return; } ll diff = a - b; cout << diff << ' ' << min (a % diff, diff - (a % diff)) << "\n"; return; } int main () { int t = 1; c...
### Prompt Your challenge is to write a Cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans ...
#include<bits/stdc++.h> #define ll long long #define int ll #define pb push_back #define INF 1e18 #define MOD 1000000007 #define mp make_pair #define REP(i,n) for (int i = 0; i < n; i++) #define FOR(i,a,b) for (int i = a; i < b; i++) #define REPD(i,n) for (int i = n-1; i >= 0; i--) #define FORD(i,a,b) for (int i = a; i...
### Prompt Your challenge is to write a CPP solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans ...
#include <bits/stdc++.h> using namespace std; #define fast ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); typedef long long ll; typedef long double ld; typedef vector<ll> vll; typedef pair<ll,ll> pll; #define F first #define S second #define PB push_back #define MP make_pair #define all(x) x.begin(),x.end() #define fo...
### Prompt Please provide a cpp coded solution to the problem described below: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans ...
#include<bits/stdc++.h> using namespace std; #define int long long void solve(){ int a, b; cin >> a >> b; if (a == b) { cout << "0 0\n"; return; } if (a < b) swap(a, b); if (!b) { cout << a << ' ' << 0 << '\n'; return; } int d = a - b; int x = b % d; cout << d << ' ' << min(x, d - x) << '\n'; ...
### Prompt Please provide a Cpp coded solution to the problem described below: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans ...
// 1543A.cpp // Created by Ashish Negi /******** All Required Header Files ********/ #include <iostream> #include <string> #include <vector> #include <algorithm> #include <sstream> #include <queue> #include <deque> #include <bitset> #include <iterator> #include <list> #include <stack> #include <map> #include <set> #...
### Prompt Construct a cpp code solution to the problem outlined: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by g...
#include<bits/stdc++.h> #define ll long long #define all( x ) x.begin() , x.end() using namespace std ; void solve() { // If there is only one test case make t = 1 ll a , b ; cin >> a >> b ; ll req = abs( a - b ) ; ll moves = 1e18 ; if( req ) { ll x = min( a , b ) % req ; ...
### Prompt Your task is to create a cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is g...
#include<bits/stdc++.h> #define ll long long using namespace std; int main() { #ifndef ONLINE_JUDGE //input from input.txt freopen("input.txt", "r", stdin); //output on output.txt freopen("output.txt", "w", stdout); #endif ll tc; cin>>tc; for(int i=0;i<tc;i++) { ...
### Prompt Construct a cpp code solution to the problem outlined: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by g...
#include<bits/stdc++.h> #define ll long long #define pb push_back #define fast ios_base::sync_with_stdio(false), cin.tie(nullptr) ,cout.tie(nullptr); const int mod = 1000000007; using namespace std; void solve(){ ll a,b; cin>>a>>b; if(a==b){ cout<<0<<" "<<0<<endl; return ; } if(a>b) swap(a,b); ...
### Prompt Your challenge is to write a Cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans ...
#include<bits/stdc++.h> using namespace std; #define int long long void solve(){ int a,b; cin>>a>>b; if(a==b){ cout<<0<<' '<<0<<'\n'; return; } if(b<a)swap(a,b); set<int>facts; int diff=b-a; int ans=diff; int moves=b/diff; if(b%ans==0){ cout<<ans<<" "<<0<<'\n'; return; }else{ c...
### Prompt Create a solution in cpp for the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd(...
#include<bits/stdc++.h> using namespace std; #define ll long long #define endl "\n" const double pi = acos(-1); #define pb push_back #define LL unsigned long long int static dp[1005][1005]; #define RADHE KRISHNA const int MOD = 1e9 + 7; const int N = 1e6 + 2; // int lcs(string s , string t , i...
### Prompt Construct a Cpp code solution to the problem outlined: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by g...
#include<bits/stdc++.h> using namespace std; #define int int64_t void solve(){ int a,b; cin >> a >> b; if(a == b){ cout << "0 0\n"; return; } if(a > b) swap(a,b); int ans = b - a; if(ans == a) cout << ans << " " << 0 << '\n'; else{ cout << ans << " " << min(a%ans,ans-a%ans) << '\n'; } } signed main(){ ...
### Prompt In cpp, your task is to solve the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd...
#include<bits/stdc++.h> using namespace std; int main(){ int t; cin >> t; while(t--){ long long a, b; cin >> a >> b; long long maxx, minn; maxx = max(a, b); minn = min(a, b); cout << maxx - minn << " "; if(a == b){ ...
### Prompt Your task is to create a Cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is g...
#include<bits/stdc++.h> using namespace std; typedef long long int ll; int main() { ll t; cin>>t; while(t--) { ll a,b; cin>>a>>b; if(a==b) cout<<0<<" "<<0<<endl; else { ll gcd = abs(b-a); ll minn = min(a%gcd,gcd-a%gcd); cout<...
### Prompt Generate a cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd(a,...
#include <bits/stdc++.h> #define ll long long int #define st string #define pb(x) push_back(x) #define sz size() using namespace std; const ll maxn=1e3*2+1,maxv=1e6,mod=1e9; ll a1[maxn]; ll dp[maxn]; int main() { std::ios_base::sync_with_stdio(false);cin.tie(0),cout.tie(0); ll n,a,b; cin>>n; for(int i=1;i...
### Prompt Please formulate a Cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given b...
#include <iostream> using namespace std; #define f(x,y,z) for(int x=y;x<z;++x) typedef long long ll; ll a, b, s, t; int main() { ios_base::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr); for(cin >> t; t--;) { cin >> a >> b; s = abs(a-b); cout << s << ' '; if(s < 2) c...
### Prompt Please provide a Cpp coded solution to the problem described below: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans ...
#include <bits/stdc++.h> using namespace std; long long add(vector<long long> v,int n){ long long ans = 0; for(long long x: v){ ans+=x; ans = ans%n; } return ans; } void solve() { long long a,b; cin >> a >> b; if(b>a){ long long t = a; a = b; b = t; } cout << (a-b) << " " << ...
### Prompt Generate a cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd(a,...
#include <bits/stdc++.h> using namespace std; #define ll long long #define f(i,n) for(int i=0;i<n;i++) #define endl ("\n") #define pb push_back #define mp make_pair #define pl pair<ll, ll> #define vl vector<ll> #define fastIO ios_base::sync_with_stdio(false);cin.tie(NULL); #define M 1000000007 const int N=2e5+2; ll ...
### Prompt Please formulate a cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given b...
#include <bits/stdc++.h> typedef long long int ll; const unsigned int MOD = 1000000007; using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); #ifndef ONLINE_JUDGE freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout); #endif int t; cin >> t; for (int tt = 0; ...
### Prompt Construct a CPP code solution to the problem outlined: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by g...
#include <bits/stdc++.h> using namespace std; void excbet() { long long a, b; cin >> a >> b; long long c = abs(a - b); long long d = 0; if( c != 0) d = a%c; cout << c << " " << min(d, c-d) << endl; } int main() { int t; cin >> t; for(int i=0; i<t; i++) { excbet...
### Prompt Generate a CPP solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by gcd(a,...
#include<bits/stdc++.h> using namespace std; #define ll long long ll const MAX_N=1e7+5; int main(){ ll t; cin>>t; while(t--){ ll a, b; cin>>a>>b; ll ans=0; ll a1=max(a,b); ll a2=min(a,b); if(a1*2==b){ cout<<a1<<" "<<0<<endl; } else if(a1==a2){ cout<<0<<" "<<0<<endl; } el...
### Prompt Your task is to create a CPP solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is g...
#include<iostream> #include<algorithm> #include<string> #include<cstring> #include<cstdio> #include<stdio.h> #include<cmath> #include<math.h> #include<vector> #include<set> #include<queue> #include<map> #include<sstream> #include<iomanip> #define forn(i,n) for(int (i)=0;i<(n);i++) #define pb push_back #define mp make_p...
### Prompt Please provide a cpp coded solution to the problem described below: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans ...
#include<bits/stdc++.h> using namespace std; #define rep(i,a,n) for(int i=a;i<n;i++) #define brep(i,a) for(int i=a;i>=0;i--) #define all(x) x.begin(),x.end() #define allara(x,n) x,x+n #define testcase(x) int x; cin>>x; while(x--) #define vec vector<int> #define vectorpair vector<pair<int,int>> #d...
### Prompt Your challenge is to write a Cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans ...
#include<bits/stdc++.h> using namespace std; #define int long long int t, a, b; signed main() { for(cin >> t; t--; ) { cin >> a >> b; if(a == b) { cout << "0 0\n"; continue; } if(a < b) swap(a, b); int ans = a - b; cout << ans << " " << min(ans-b%ans, b%ans) << "\n"; } }
### Prompt Construct a CPP code solution to the problem outlined: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given by g...
#include<iostream> #include<algorithm> #include<cmath> using namespace std; typedef long long LL; LL gcd(LL a,LL b){ return b ? gcd(b,b%a) : a; } void solve(){ LL x,y; cin>>x>>y; if(x<y)swap(x,y); if(x==y)cout<<"0 0"<<endl; else{ LL t = x - y; LL l = 0,r = 1e18 / t+1; whi...
### Prompt Your challenge is to write a Cpp solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans ...
#include <bits/stdc++.h> using namespace std; void solve(){ long long a,b; cin>>a>>b; if(a==b) cout<<0<<" "<<0<<endl; else{ cout<< abs(a-b)<<" "<<min(a%abs(a-b), abs(a-b)-a%abs(a-b))<<endl; } } int main() { int t = 1; cin >> t; while (t--){ solve(); } ret...
### Prompt Please create a solution in Cpp to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is given b...
#include <bits/stdc++.h> #define FOR(i, a, b) for (int i = (a); i < (b); ++i) #define RFOR(i, a, b) for (int i = (a); i > (b); --i) #define ALL(x) x.begin(), x.end() #define F first #define S second #define PB push_back #define MP make_pair using namespace std; using ll = long long; using ld = long double; typedef v...
### Prompt Your task is to create a CPP solution to the following problem: Welcome to Rockport City! It is time for your first ever race in the game against Ronnie. To make the race interesting, you have bet a dollars and Ronnie has bet b dollars. But the fans seem to be disappointed. The excitement of the fans is g...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n == 1) { cout << 1; return 0; } cout << n * (n - 1) * 6 + 1; return 0; }
### Prompt Please provide a cpp coded solution to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int ma...
#include <bits/stdc++.h> using namespace std; const int N = int(300000) + 5; long long int k, n, m, t, cnt, sum, ans, x, y; long long int a[N], b[N]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cin >> n; if (n == 1) { cout << 1; return 0; } cnt = 1; while (n > 1) { sum += 12; ...
### Prompt In CPP, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; const int N = int(300...
#include <bits/stdc++.h> using namespace std; int ans = 1, n; int main() { cin >> n; ans = (2 * n - 1) * (2 * n - 1) + 4 * (n - 1) * (n) / 2; cout << ans; return 0; }
### Prompt In CPP, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int ans = 1, n; int m...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int res = 1; for (int i = 1, t = 12; i < n; i++, t += 12) res += t; cout << res << endl; return 0; }
### Prompt Your task is to create a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main()...
#include <bits/stdc++.h> int main(int argc, char *argv[]) { int n; scanf("%d", &n); printf("%d\n", 6 * n * (n - 1) + 1); return 0; }
### Prompt Construct a Cpp code solution to the problem outlined: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main(int argc, char *argv[]) { int...
#include <bits/stdc++.h> int main() { int n, a[20000], i, s = 0; scanf("%d", &n); a[1] = 1; for (i = 2; i <= n; i++) { a[i] = 12 * (i - 1); s += a[i]; } printf("%d", s + 1); return 0; }
### Prompt Your challenge is to write a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { int n, a[200...
#include <bits/stdc++.h> int main() { long long int n, i, c = 0; scanf("%I64d", &n); printf("%I64d", 6 * n * (n - 1) + 1); return 0; }
### Prompt Construct a CPP code solution to the problem outlined: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { long long int n, i, c = 0...
#include <bits/stdc++.h> using namespace std; int main() { int m, n, i, j, k, a, b; scanf("%d", &a); if (a == 1) printf("1\n"); else { printf("%d\n", (a - 1) * a / 2 * 12 + 1); } }
### Prompt Your task is to create a Cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main()...
#include <bits/stdc++.h> const long long int INF = 1e15; using namespace std; const long long int MAX = 1e7 + 5; const long long int mod = 1e9 + 7; long long int gcd(long long int a, long long int b) { while (b > 0) { a = a % b; swap(a, b); } return a; } long long int binpow(long long int a, long long int...
### Prompt Please provide a Cpp coded solution to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> const long long int INF = 1...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << 1 + 6 * n * (n - 1); return 0; }
### Prompt Please create a solution in CPP to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { i...
#include <bits/stdc++.h> int main() { int n, aux; scanf("%d", &n); aux = 1; for (int i = 2; i <= n; i++) aux += 12 * (i - 1); printf("%d", aux); return 0; }
### Prompt Please formulate a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { int n, aux; scanf("%...
#include <bits/stdc++.h> using namespace std; long star(int a) { if (a == 1) return 1; else return star(a - 1) + 12 * (a - 1); } int main() { int n; cin >> n; cout << star(n) << endl; }
### Prompt Your task is to create a Cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; long star(...
#include <bits/stdc++.h> int main() { int n; scanf("%d", &n); printf("%d", 6 * n * (n - 1) + 1); return 0; }
### Prompt Your task is to create a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { int n; scanf("...
#include <bits/stdc++.h> int dr[] = {-1, -1, -1, 0, 0, 1, 1, 1}; int dc[] = {-1, 0, 1, -1, 1, -1, 0, 1}; int dr_y[] = {-1, 0, 1, 0}; int dc_x[] = {0, 1, 0, -1}; int f[100000]; using namespace std; void init() { int i; f[1] = 1; for (int i = 2; i <= 18257; i++) f[i] = f[i - 1] + (i - 1) * 12; } int main() { int ...
### Prompt Generate a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int dr[] = {-1, -1, -1, 0, 0, 1, 1, 1}; int d...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << 6 * n * (n - 1) + 1 << endl; return 0; }
### Prompt Create a solution in cpp for the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n; ...
#include <bits/stdc++.h> using namespace std; int main() { long long int n; cin >> n; cout << (n * (n - 1) * 6) + 1 << endl; return 0; }
### Prompt Construct a CPP code solution to the problem outlined: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long...
#include <bits/stdc++.h> #pragma GCC target("avx,avx2,fma") #pragma GCC optimization("O8") #pragma GCC optimization("unroll-loops") using namespace std; const long long int N = 1e6 + 20, mod = 1e9 + 7, inf = 2e18, dlt = 12250, maxm = 524288; int main() { long long n; cin >> n; cout << 1 + 6 * ...
### Prompt In CPP, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> #pragma GCC target("avx,avx2,fma") #pragma...
#include <bits/stdc++.h> using namespace std; int main() { long long sl, sB, k; cin >> k; sl = k - 1; sB = k * 3 - 2; cout << ((sB + 1) * sB) / 2 + 3 * ((sl + 1) * sl) / 2; return 0; }
### Prompt Please formulate a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { l...
#include <bits/stdc++.h> using namespace std; int main(int argc, const char *argv[]) { int n; cin >> n; cout << 12 * (n - 1) + 6 * (n - 1) * (n - 2) + 1; return 0; }
### Prompt Please create a solution in CPP to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main(int arg...
#include <bits/stdc++.h> using namespace std; long long gcd(long long x, long long y) { return (y == 0) ? x : gcd(y, x % y); } unsigned long long lcm(long long x, long long y) { return x / gcd(x, y) * y; } void the_end() {} int dy8[] = {0, 0, 1, -1, 1, -1, -1, 1}; int dx8[] = {1, -1, 0, 0, 1, -1, 1, -1}; int id8[] = {0...
### Prompt Create a solution in cpp for the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; long long gcd(long lon...
#include <bits/stdc++.h> #pragma comment(linker, "/STACK:256000000") using namespace std; template <class T> double sqrt(T x) { return sqrt((double)x); } template <class T> T sqr(T x) { return x * x; } const double PI = acos(-1.0); const int INF = 1000000000; const int MOD = 1000000007; void wa() { cout << 5; e...
### Prompt Create a solution in CPP for the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> #pragma comment(linker, "/STACK:256000000")...
#include <bits/stdc++.h> using namespace std; int main() { int num; long long result; cin >> num; result = 6 * num * (num - 1) + 1; cout << result; return 0; }
### Prompt Your task is to create a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main()...
#include <bits/stdc++.h> int main() { int n; scanf("%d", &n); int add = 0; long long total = 1; for (int i = 0; i < n; i++) { total += add; add += 12; } printf("%I64d\n", total); return 0; }
### Prompt Please create a solution in CPP to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { int n; scanf("%d", &...
#include <bits/stdc++.h> int main() { int n; std::cin >> n; std::cout << 6 * n * (n - 1) + 1; }
### Prompt Please formulate a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { int n; std::cin >> n...
#include <bits/stdc++.h> using namespace std; int main() { long a, S, i; for (cin >> a, i = 0, S = 0; i < 1; S += (6 * a * (a - 1) + 1), cout << S, ++i) ; return 0; }
### Prompt Your challenge is to write a CPP solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int ma...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; cout << (6 * n * (n - 1)) + 1; return 0; }
### Prompt Construct a CPP code solution to the problem outlined: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int t = 1; long long n, ans; while (t--) { cin >> n; cout << (6 * n * (n - 1)) + 1; } return 0; }
### Prompt Your challenge is to write a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int ma...
#include <bits/stdc++.h> using namespace std; int main() { long long int N; cin >> N; cout << (N * (N - 1) * 6) + 1 << endl; }
### Prompt Please provide a CPP coded solution to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int ma...
#include <bits/stdc++.h> using namespace std; int MAX(long long int a, long long int b) { if (a > b) { return a; } else { return b; } } int MIN(long long int a, long long int b) { if (a < b) { return a; } else { return b; } } int gcd(long long int a, long long int b) { long long int c; w...
### Prompt In CPP, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int MAX(long long int...
#include <bits/stdc++.h> int main() { unsigned long int a, sum = 1, i; scanf("%lu", &a); for (i = 2; i <= a; i++) { sum += (i - 1) * 12; } printf("%lu", sum); return 0; }
### Prompt Please provide a CPP coded solution to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { unsigned lon...
#include <bits/stdc++.h> int main() { long long a; scanf("%I64d", &a); if (a == 1) puts("1"); else printf("%I64d\n", a * (a - 1) * 6 + 1); return 0; }
### Prompt Construct a Cpp code solution to the problem outlined: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { long long a; scanf("%I6...
#include <bits/stdc++.h> using namespace std; long long MOD = 1e9 + 7; long long MAX = 1e17; int main() { ios_base::sync_with_stdio(0); ; int n; cin >> n; n = 1 + 6 * n * (n - 1); cout << n << endl; ; return 0; }
### Prompt Develop a solution in Cpp to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; long long MOD = ...
#include <bits/stdc++.h> using namespace std; long long star(int n) { if (n == 1) return 1; else return 12 * n - 12 + star(n - 1); } int main() { int n; cin >> n; cout << star(n); return 0; }
### Prompt Your challenge is to write a Cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; long l...
#include <bits/stdc++.h> using namespace std; int A[19000] = {0}; int main() { int a; cin >> a; A[0] = 1; for (int i = 1; i < a; i++) A[i] = A[i - 1] + 6 + 6 * (2 * i - 1); cout << A[a - 1] << endl; }
### Prompt Please create a solution in CPP to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int A[19000] = {...
#include <bits/stdc++.h> int main() { int n; long long int s; scanf("%d", &n); s = 6 * n * (n - 1) + 1; printf("%I64d", s); return 0; }
### Prompt Please formulate a Cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main() { int n; long long int...
#include <bits/stdc++.h> using namespace std; void loadData(void); int proc(void); void printRes(int); int a; int main(int argc, char** argv) { loadData(); printRes(proc()); return 0; } int proc(void) { long long res = 0; res += (long long)(a + a + a - 1) * (long long)a / (long long)2; res += (long long)(a ...
### Prompt Your challenge is to write a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; void l...
#include <bits/stdc++.h> using namespace std; int main(int argc, char** argv) { int n; scanf("%d", &n); n--; printf("%d\n", (int)(1 + (long long)(n + 1) * (long long)n * 6)); return 0; }
### Prompt Create a solution in Cpp for the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main(int argc, cha...
#include <bits/stdc++.h> using namespace std; long long n, s; int main() { cin >> n; s = 6 * n * (n - 1) + 1; cout << s; }
### Prompt Please formulate a cpp solution to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; long long n, s; ...
#include <bits/stdc++.h> using namespace std; int A[10]; int main() { int n, m, i, s = 1; cin >> n; cout << 6 * n * (n - 1) + 1; return 0; }
### Prompt Construct a cpp code solution to the problem outlined: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int A[10]; int main...
#include <bits/stdc++.h> using namespace std; int main() { int a; scanf("%d", &a); printf("%d\n", 6 * a * (a - 1) + 1); return 0; }
### Prompt Please create a solution in Cpp to the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { i...
#include <bits/stdc++.h> int main(void) { int n; scanf("%d", &n); n--; long m = n * (n + 1) / 2; m *= 12; m++; printf("%I32d", m); return 0; }
### Prompt Develop a solution in Cpp to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> int main(void) { int n; scanf("%d...
#include <bits/stdc++.h> using namespace std; long long a; int main() { scanf("%lld", &a); printf("%lld", 1 + 12 * (a * (a - 1) / 2)); return 0; }
### Prompt Please provide a Cpp coded solution to the problem described below: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; long l...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int ans = 0; for (int i = 1; i < n; i++) ans += i * 12; cout << ans + 1; return 0; }
### Prompt In cpp, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n;...
#include <bits/stdc++.h> using namespace std; int main() { long long a; cin >> a; if (a == 1) { cout << 1; return 0; } cout << (a - 1) * a * 6 + 1; }
### Prompt In Cpp, your task is to solve the following problem: <image> Input The input contains a single integer a (1 ≤ a ≤ 18257). Output Print a single integer output (1 ≤ output ≤ 2·109). Examples Input 2 Output 13 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long l...