text
stringlengths
49
983k
#include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; cout << n / 2 + 1 << "\n"; } int main() { int tc, cse = 0; cin >> tc; while (tc--) solve(); }
#include <bits/stdc++.h> using namespace std; int main() { int t = 1; cin >> t; while (t--) { int n; scanf("%d", &n); int ans = n / 2 + 1; printf("%d\n", ans); } }
#include <bits/stdc++.h> using namespace std; const int N = 2e5 + 11; long long int add(long long int a, long long int b) { a += b; if (a >= 1000000007) a -= 1000000007; return a; } long long int mul(long long int a, long long int b) { a = (a * b) % 1000000007; return a; } void init() {} void kishu() { long long int n; cin >> n; cout << (n / 2) + 1 << "\n"; } int main() { ios_base::sync_with_stdio(0); cin.tie(NULL); cout.tie(NULL); init(); long long int t = 1; cin >> t; while (t--) { kishu(); } return 0; }
#include <bits/stdc++.h> using namespace std; const long long maxN = 100009; const long long inf = (long long)1e18 + 1; long long N; void solve() { long long i, j, k; cin >> N; cout << ((N / 2) + 1) << "\n"; } signed main() { if (true) { ios_base::sync_with_stdio(false); cin.tie(NULL); } long long T = 1; if (true) { cin >> T; } while (T--) { solve(); } }
#include <bits/stdc++.h> using namespace std; template <class T> void IN(T& x) { cin >> x; } template <class H, class... T> void IN(H& h, T&... t) { IN(h); IN(t...); } template <class T1, class T2> void OUT(const pair<T1, T2>& x); template <class T> void OUT(const T& x) { cout << x; } template <class H, class... T> void OUT(const H& h, const T&... t) { OUT(h); OUT(t...); } template <class T1, class T2> void OUT(const pair<T1, T2>& x) { OUT(x.first, " ", x.second); } template <class... T> void OUTL(const T&... t) { OUT(t..., "\n"); } void program(); int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); program(); } const int MX = 5e5; int testCases; int n; void program() { IN(testCases); while (testCases--) { IN(n); OUTL((n + 2) / 2); } }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int t, n; cin >> t; while (t--) { cin >> n; cout << (n / 2 + 1) << "\n"; } return 0; }
#include <bits/stdc++.h> #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") using namespace std; int main() { ios::sync_with_stdio(false); cin.tie(NULL); int T, n; cin >> T; while (T--) { cin >> n; cout << (n / 2 + 1) << '\n'; } return 0; }
#include <bits/stdc++.h> using namespace std; bool isprime(long long int n) { if (n < 2) return false; for (long long int i = 2; i <= sqrt(n); i++) if (n % i == 0) return false; return true; } long long int countDivisors(long long int n) { long long int cnt = 0; for (long long int i = 1; i <= sqrt(n); i++) { if (n % i == 0) { if (n / i == i) cnt++; else cnt = cnt + 2; } } return cnt; } int main() { int t; cin >> t; while (t--) { long long int n; cin >> n; cout << n / 2 + 1 << endl; ; } return 0; }
#include <bits/stdc++.h> using namespace std; int n; void solve() { cin >> n; if (n % 2 == 0) { cout << (n + 2) / 2 << endl; } else { cout << (n + 1) / 2 << endl; } } int main() { int t; cin >> t; while (t--) solve(); }
#include <bits/stdc++.h> using namespace std; long long power(long long x, long long y) { if (y == 0) return 1; else if (y % 2 == 0) return ((power(x, y / 2)) * (power(x, y / 2))); else return (((x * (power(x, y / 2)))) * (power(x, y / 2))); } long long ceiling(long long d, long long x) { long long res = d / x; if (d % x != 0) res++; return res; } bool powerOfx(long long n, long long x) { long long count = 0; while (n % x == 0) { n /= x; count++; } if (n == 1) return true; return false; } long long maxArr(long long arr[], long long n) { long long max = arr[0]; for (long long i = 0; i < n; i++) { if (max < arr[i]) max = arr[i]; } return max; } long long minArr(long long arr[], long long n) { long long min = arr[0]; for (long long i = 0; i < n; i++) { if (min > arr[i]) min = arr[i]; } return min; } long long gcd(long long a, long long b) { if (b == 0) return a; return gcd(b, a % b); } long long lcm(long long a, long long b) { return (a * b) / gcd(a, b); } long long pal(string s, long long l, long long r) { if (l > r) return 0; else if (l == r) return 1; else if (s[l] == s[r]) return 2 + pal(s, l + 1, r - 1); else return max(pal(s, l, r - 1), pal(s, l + 1, r)); } signed main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); long long t; cin >> t; while (t--) { long long n; cin >> n; long long x = (n / 2) + 1; cout << x << '\n'; } return 0; }
#include <bits/stdc++.h> using namespace std; template <class TH> void _dbg(const char *sdbg, TH h) { cerr << sdbg << '=' << h << endl; } template <class TH, class... TA> void _dbg(const char *sdbg, TH h, TA... a) { while (*sdbg != ',') cerr << *sdbg++; cerr << '=' << h << ','; _dbg(sdbg + 1, a...); } template <class T> ostream &operator<<(ostream &os, vector<T> V) { os << "["; for (auto vv : V) os << vv << ","; return os << "]"; } template <class L, class R> ostream &operator<<(ostream &os, pair<L, R> P) { return os << "(" << P.first << "," << P.second << ")"; } template <class T> using min_heap = priority_queue<T, vector<T>, greater<T>>; template <class T> using max_heap = priority_queue<T>; const int mod = 998244353; long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; } struct PairHash { template <typename T1, typename T2> std::size_t operator()(const pair<T1, T2> &p) const { return hash<T1>()(p.first) ^ hash<T2>()(p.second); } }; const int N = 2 * int(1e5) + 10; void solve(int ncase) { int n; cin >> n; cout << (n / 2 + 1) << endl; } void solve_all_cases() { int T = 1; cin >> T; int ncase = 0; while (T--) { solve(++ncase); } } int main() { cout << std::fixed; cout << setprecision(9); solve_all_cases(); }
#include <bits/stdc++.h> using namespace std; int t, n; int main() { cin >> t; for (int tt = 1; tt <= t; tt++) { cin >> n; cout << n / 2 + 1 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int t; long long a; cin >> t; while (t--) { cin >> a; cout << a / 2 + 1 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; using ll = long long; const int inf = 1e9 + 7; const ll longinf = 1LL << 60; const ll mod = 1e9 + 7; int main() { ios::sync_with_stdio(false); cin.tie(0); int t; cin >> t; for (int i = 0; i < t; ++i) { int n; cin >> n; cout << n / 2 + 1 << "\n"; } }
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ios::sync_with_stdio(false); cin.tie(nullptr); cout.precision(10); int T; cin >> T; for (int i = 0; i < (T); ++i) { ll n; cin >> n; if (n < 3) cout << n << '\n'; else { ll moves = n / 2ll; cout << ++moves << '\n'; } } return 0; }
#include <bits/stdc++.h> const long long mod = 1e9 + 7; using namespace std; long long gcd(long long a, long long b) { return b ? gcd(b, a % b) : a; } long long ksm(long long a, long long b) { long long ret = 1; while (b) { if (b & 1) ret = ret * a % mod; a = a * a % mod; b >>= 1; } return ret; } int t; int main() { cin >> t; while (t--) { int n; cin >> n; if (n == 1) { printf("1\n"); continue; } printf("%d\n", n / 2 + 1); } return 0; }
#include <bits/stdc++.h> using namespace std; const long long Mod = 1e9 + 7; const long long Maxn = 1e5 + 10; const long long INF = 1e18; using pll = pair<long long, long long>; int main() { long long T; scanf("%lld", &T); while (T--) { long long n; cin >> n; cout << n / 2 + 1 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int t, n; scanf("%d", &t); while (t--) { scanf("%d", &n); printf("%d\n", n / 2 + 1); } }
#include <bits/stdc++.h> using namespace std; int main() { long long int t, n, i, l, r, cnt = 0, x = 0, y = 0; cin >> t; while (t--) { cin >> n; cout << n / 2 + 1 << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; cout << (n) / 2 + 1 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long t; cin >> t; while (t--) { long long n; cin >> n; cout << (n / 2) + 1 << "\n"; } }
#include <bits/stdc++.h> using namespace std; int main() { int test; cin >> test; while (test--) { int n; cin >> n; cout << (n + 2) / 2 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; mt19937 rng(chrono::steady_clock::now().time_since_epoch().count()); void rset(); void init_test(); void solve(); signed main() { ios::sync_with_stdio(false); cin.tie(0); cout << fixed; cout.precision(20); init_test(); return 0; } template <typename T> void chmin(T& a, T b) { if (a > b) a = b; } template <typename T> void chmax(T& a, T b) { if (a < b) a = b; } template <typename T> void MACRO_rdv2_Init(int n, T& t) { t.resize(n); } template <typename First, typename... Rest> void MACRO_rdv2_Init(int n, First& first, Rest&... rest) { first.resize(n); MACRO_rdv2_Init(n, rest...); } template <typename T> void MACRO_rdv2_Scan(int p, T& t) { std::cin >> t[p]; } template <typename First, typename... Rest> void MACRO_rdv2_Scan(int p, First& first, Rest&... rest) { std::cin >> first[p]; MACRO_rdv2_Scan(p, rest...); } template <typename T> void wrv(const vector<T>& v) { for (int(__ii) = (0); (__ii) < (((int)v.size())); ++(__ii)) { if (__ii) cout << ' '; cout << v[__ii]; } cout << '\n'; } template <typename T> void wrm(const vector<vector<T>>& v) { for (int(__ii) = (0); (__ii) < (((int)v.size())); ++(__ii)) { for (int(__jj) = (0); (__jj) < (v[__ii].size()); ++(__jj)) { if (__jj) cout << ' '; cout << v[__ii][__jj]; } cout << '\n'; } } template <typename T> void sc(T& x) { cin >> x; } template <typename Head, typename... Tail> void sc(Head& head, Tail&... tail) { cin >> head; sc(tail...); } template <typename T> void wr(const T& x) { cout << x << '\n'; } template <typename Head, typename... Tail> void wr(const Head& head, const Tail&... tail) { cout << head << ' '; wr(tail...); } template <typename T> void wrf(const T& x) { cout << x << endl; } template <typename Head, typename... Tail> void wrf(const Head& head, const Tail&... tail) { cout << head << ' '; wrf(tail...); } template <typename T> void debug_out(const T& x) { cerr << x << '\n'; } template <typename Head, typename... Tail> void debug_out(const Head& head, const Tail&... tail) { cerr << head << ' '; debug_out(tail...); } template <typename... T> void err(const T&... cod) { wr(cod...); exit(0); } void solve() { int n; sc(n); wr(n / 2 + 1); } void init_test() { int qq = 1; cin >> qq; while (qq--) solve(); }
#include <bits/stdc++.h> using namespace std; void solve() { long long n; cin >> n; cout << (n / 2) + 1 << "\n"; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long t; cin >> t; while (t--) { solve(); } }
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; int ans = n / 2 + 1; cout << ans << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; cout << n / 2 + 1 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; template <typename T> inline bool uax(T &x, T y) { return (y > x) ? x = y, true : false; } template <typename T> inline bool uin(T &x, T y) { return (y < x) ? x = y, true : false; } template <typename T> void kek(T ans) { cout << ans << endl; exit(0); } const int MOD = (int)1e9 + 7; const long long INF = (long long)1e18 + 42; void solve_case() { int n; cin >> n; int ans = n / 2; ++ans; cout << ans << '\n'; } int main() { cin.tie(nullptr)->sync_with_stdio(false); int tt; cin >> tt; while (tt--) { solve_case(); } }
#include <bits/stdc++.h> using namespace std; long mod = pow(10, 9) + 7; int countdivisors(int n) { int count = 0; for (int i = 1; i <= sqrt(n); i++) { if (n % i == 0) { if (n / i == i) { count++; } else { count = count + 2; } } } return count; } void remove(std::vector<string> &v) { auto end = v.end(); for (auto it = v.begin(); it != end; ++it) { end = std::remove(it + 1, end, *it); } v.erase(end, v.end()); } bool isPerfectSquare(int x) { int s = sqrt(x); return (s * s == x); } bool isFibonacci(int n) { return isPerfectSquare(5 * n * n + 4) || isPerfectSquare(5 * n * n - 4); } string sortString(string &str) { sort(str.begin(), str.end()); return str; } int isSubstring(string s1, string s2) { int M = s1.length(); int N = s2.length(); for (int i = 0; i <= N - M; i++) { int j; for (j = 0; j < M; j++) if (s2[i + j] != s1[j]) break; if (j == M) return i; } return -1; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); int t; cin >> t; while (t--) { long long n; cin >> n; cout << ((n / 2) + 1) << "\n"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int T; cin >> T; while (T--) { int n; cin >> n; if (n & 1) cout << (n - 1) / 2 + 1 << endl; else cout << (n / 2 + 1) << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); ; long long t, b, i, n; cin >> t; while (t--) { cin >> n; cout << (n / 2) + 1 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n) { for (int i = 0; i < n; i++) { int a; cin >> a; if (a == 1) { cout << 1 << "\n"; } else if (a == 2) { cout << 2 << "\n"; } else if (a % 2 == 0) { cout << a / 2 + 1 << "\n"; } else { cout << (a + 1) / 2 << "\n"; } } } }
#include <bits/stdc++.h> using namespace std; const long long int mod = 1e9 + 7; const long long int mod1 = 998244353; const long long int inf = 9e18 + 5; const double pi = acosl(-1.0l); const long double eps = 1e-9; bool equalTo(double a, double b) { if (fabs(a - b) <= eps) return true; else return false; } bool notEqual(double a, double b) { if (fabs(a - b) > eps) return true; else return false; } bool lessThan(double a, double b) { if (a + eps < b) return true; else return false; } bool lessThanEqual(double a, double b) { if (a < b + eps) return true; else return false; } bool greaterThan(double a, double b) { if (a > b + eps) return true; else return false; } bool greaterThanEqual(double a, double b) { if (a + eps > b) return true; else return false; } void swap(long long int &a, long long int &b) { long long int t = a; a = b; b = t; } long long int min(long long int a, long long int b) { if (a < b) return a; return b; } long long int max(long long int a, long long int b) { if (a > b) return a; return b; } long long int pow(long long int a, long long int b) { a %= mod; long long int ans = 1; while (b > 0) { if (b & 1) ans = ans * a % mod; a = a * a % mod; b /= 2; } return ans; } int main() { ios_base ::sync_with_stdio(0); cin.tie(0); long long int tc; cin >> tc; while (tc--) { long long int n; cin >> n; if (n == 1) { cout << 1 << "\n"; continue; } cout << (n) / 2 + 1 << "\n"; } }
#include <bits/stdc++.h> using namespace std; int main() { long long int t; cin >> t; while (t--) { long long int n; cin >> n; if (n == 1) cout << "1"; else if (n == 2 || n == 3) cout << "2"; else cout << n / 2 + 1; cout << "\n"; } return 0; }
#include <bits/stdc++.h> using namespace std; const int N = (int)1e5; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int T; cin >> T; for (int tc = 1; tc <= T; tc++) { int n; cin >> n; cout << (n / 2) + 1 << "\n"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t-- > 0) { int n; cin >> n; if (n <= 2) { cout << n << endl; } else { cout << (n / 2) + 1 << endl; } } }
#include <bits/stdc++.h> long long mod = 1000000007; long long mod2 = 998244353; long long OO = 1e18; long long david_villa_pow(long long x, long long n) { if (n == 0) return 1; long long u = david_villa_pow(x, n / 2); u = ((u % mod2) * (u % mod2)) % mod2; if (n % 2 == 1) u = ((u % mod2) * (x % mod2)) % mod2; return u % mod2; } long long up(long long x, long long y) { if (x % y == 0) return x / y; return x / y + 1; } using namespace std; void El_MaraVilla() { long long i, j; ; long long n; cin >> n; cout << n / 2 + 1 << endl; } int main() { long long T = 1; cin >> T; while (T--) { El_MaraVilla(); } return 0; }
#include <bits/stdc++.h> using namespace std; const long long M = 1000000007; const long long N = 2e6 + 5; const long long INF = 2e9 + 12; void solve() { long long n; cin >> n; cout << n / 2 + 1 << "\n"; } signed main() { ios_base::sync_with_stdio(false), cin.tie(NULL); long long tc = 1; cin >> tc; for (long long t = 1; t <= tc; t++) { solve(); } }
#include <bits/stdc++.h> using namespace std; const long long int M = 998244353; void solve() { long long int a; cin >> a; cout << ((a / 2) + 1) << endl; } int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long int t = 1; cin >> t; while (t--) solve(); }
#include <bits/stdc++.h> using namespace std; int main() { int tc; cin >> tc; for (int t = 1; t <= tc; t++) { int n; cin >> n; cout << ((n / 2) + 1) << endl; } }
#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 int n; cin >> n; if (n == 1) { cout << 1 << "\n"; } else { long long int ans = 2; n -= 2; ans += n / 2; cout << ans << "\n"; } } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; while (n--) { int t; cin >> t; cout << t / 2 + 1 << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(NULL); long long t, n; cin >> t; while (t--) { cin >> n; cout << (n / 2) + 1 << "\n"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int t, i; cin >> t; while (t--) { int n, b = 0, w = 0; cin >> n; cout << (n + 2) / 2 << endl; } return 0; }
#include <bits/stdc++.h> #pragma GCC optimize("Ofast", "unroll-loops", "omit-frame-pointer", "inline") #pragma GCC option("arch=native", "tune=native", "no-zero-upper") #pragma GCC target("avx2") using namespace std; template <typename T> void maxtt(T& t1, T t2) { t1 = max(t1, t2); } template <typename T> void mintt(T& t1, T t2) { t1 = min(t1, t2); } bool debug = 0; int n, m, k; int dx[4] = {0, 1, 0, -1}, dy[4] = {1, 0, -1, 0}; string direc = "RDLU"; const long long MOD2 = (long long)998244353 * (long long)998244353; long long ln, lk, lm; void etp(bool f = 0) { puts(f ? "YES" : "NO"); exit(0); } void addmod(int& x, int y, int mod = 998244353) { x += y; if (x >= mod) x -= mod; if (x < 0) x += mod; assert(x >= 0 && x < mod); } void et(int x = -1) { printf("%d\n", x); exit(0); } long long fastPow(long long x, long long y, int mod = 998244353) { long long ans = 1; while (y > 0) { if (y & 1) ans = (x * ans) % mod; x = x * x % mod; y >>= 1; } return ans; } long long gcd1(long long x, long long y) { return y ? gcd1(y, x % y) : x; } void fmain(int tid) { scanf("%d", &n); if (n & 1) n++; else n += 2; printf("%d\n", n / 2); } int main() { int t = 1; scanf("%d", &t); for (int(i) = 1; (i) <= (int)(t); (i)++) { fmain(i); } return 0; }
#include <bits/stdc++.h> using namespace std; const long long mod = 1e9 + 7; const int inf = 0x3f3f3f3f; const int maxn = 1e5 + 5; void Solution() { int n; cin >> n; cout << (n / 2) + 1 << '\n'; } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; cin >> t; while (t--) Solution(); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int frh[97498], o[564], sioth[5469]; int t; cin >> t; while (t--) { int n; cin >> n; if (n == 1) cout << "1" << endl; else cout << (n / 2) + 1 << endl; } }
#include <bits/stdc++.h> using namespace std; int n, a[100]; void input() { cin >> n; for (int i = 0; i < n; i++) cin >> a[i]; } void output() { for (int i = 0; i < n; i++) { if (a[i] <= 2) cout << a[i]; else if (a[i] <= 4) cout << a[i] - 1; else cout << a[i] / 2 + 1; cout << endl; } } int main() { input(); output(); }
#include <bits/stdc++.h> using namespace std; long long n; vector<long long> arr; void solve() { cin >> n; long long ans = (n / 2) + 1; cout << ans; } int main() { int t; cin >> t; while (t--) { solve(); cout << "\n"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long t; cin >> t; while (t--) { int n, m, i, k, ma, flag; cin >> n; k = 0; cout << (n / 2) + 1 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int t; scanf("%d", &t); while (t--) { long long n; scanf("%lld", &n); n = (n / 2) + 1; printf("%lld\n", n); } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int t, n; cin >> t; while (t > 0) { cin >> n; if (n % 2 == 0) { cout << (n + 2) / 2 << endl; } else if (n % 2 != 0) { cout << (n + 1) / 2 << endl; } t--; } }
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7; const int MAXN = 5e6 + 100; int main() { int t; cin >> t; while (t--) { int n; cin >> n; cout << n / 2 + 1 << endl; } }
#include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; cout << n / 2 + 1 << "\n"; } int main() { ios::sync_with_stdio(0); cin.tie(0); int t; cin >> t; while (t--) solve(); }
#include <bits/stdc++.h> using namespace std; void solve(); int main() { int t; cin >> t; for (int i = 0; i < t; ++i) { solve(); } } void solve() { int n; cin >> n; cout << n / 2 + 1 << endl; }
#include <bits/stdc++.h> using namespace std; const double PI = acos(-1); const double epsilon = 1e-7; signed main(void) { ios_base::sync_with_stdio(false); cin.tie(NULL); long long t; cin >> t; while (t-- > 0) { long long n; cin >> n; cout << n / 2 + 1 << '\n'; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long int t, n; cin >> t; while (t--) { cin >> n; if (n <= 2) cout << n << "\n"; else cout << (n / 2) + 1 << "\n"; } }
#include <bits/stdc++.h> using namespace std; int main() { int T; cin >> T; while (T--) { int n; cin >> n; cout << n / 2 + 1 << endl; } }
#include <bits/stdc++.h> using namespace std; long long t = 1, T; void print2d(vector<vector<long long>> &v) { for (long long i = 0; i < v.size(); i++) { cout << i << ": "; for (long long x : v[i]) { cout << x << ' '; } cout << '\n'; } } void print(vector<long long> &a) { for (long long x : a) { cout << x << ' '; } cout << '\n'; return; } void solve() { long long n; cin >> n; if (n <= 2) { cout << n << '\n'; return; } long long ans = (n / 2) + 1; cout << ans << '\n'; } int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin >> t; T = t; while (t--) { solve(); } return 0; }
#include <bits/stdc++.h> using namespace std; int main(void) { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); ; int t; cin >> t; while (t--) { int n; cin >> n; if (n % 2 == 0) { cout << n / 2 + 1 << "\n"; } else { cout << n / 2 + 1 << "\n"; } } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t-- > 0) { int n; cin >> n; cout << (n + 2) / 2 << "\n"; } }
#include <bits/stdc++.h> using namespace std; void solve() { long long int n; cin >> n; cout << (n / 2) + 1 << "\n"; } int32_t main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long int t = 1; cin >> t; while (t--) { solve(); } return 0; }
#include <bits/stdc++.h> using namespace std; const long long N = 2e5 + 20; const long long inf = 1e16; long long powm(long long x, long long y, long long m = 1000000007) { x = x % m; long long res = 1; while (y) { if (y & 1) res = res * x; res %= m; y = y >> 1; x = x * x; x %= m; } return res; } long long modinv(long long a, long long m = 1000000007) { return powm(a, m - 2, m); } void mkr() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(0); } int32_t main() { mkr(); long long T; cin >> T; while (T--) { long long n; cin >> n; cout << n / 2 + 1; cout << "\n"; } }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long int tc; cin >> tc; while (tc--) { long long int n1; cin >> n1; if (n1 == 1) { cout << 1 << endl; continue; } if (n1 == 2) { cout << 2 << endl; continue; } long long int p1 = n1 / 2; p1 = p1 + 1; cout << p1 << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; int n[t]; for (int i = 0; i < t; i++) { cin >> n[i]; cout << (n[i] + 2) / 2 << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(NULL); cin.tie(NULL); cout.tie(NULL); int tc; cin >> tc; while (tc--) { long long n; cin >> n; cout << n / 2 + 1 << '\n'; } return 0; }
#include <bits/stdc++.h> using namespace std; using lint = long long; template <class T> ostream &operator<<(ostream &o, const vector<T> &v) { o << "{"; for (int i = 0; i < (int)v.size(); i++) o << (i > 0 ? ", " : "") << v[i]; o << "}"; return o; } int main() { int n, x; cin >> n; for (int i = 0; i < n; i++) { cin >> x; cout << (x / 2) + 1 << "\n"; } }
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { long long int n; cin >> n; if (n == 1) { cout << 1 << endl; } else { cout << n / 2 + 1 << endl; } } }
#include <bits/stdc++.h> #pragma GCC optimize("O3,no-stack-protector") #pragma GCC target( \ "sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,avx2,tune=native") using namespace std; int main() { std::ios_base::sync_with_stdio(false); std::cin.tie(nullptr); int tc; cin >> tc; while (tc--) { int n; cin >> n; if (n == 1) { cout << 1 << '\n'; } else { int k = n / 2; cout << k + 1 << '\n'; } } return 0; }
#include <bits/stdc++.h> using namespace std; void solve() { long long int n; cin >> n; cout << (n / 2) + 1 << endl; } int main() { int t; cin >> t; while (t--) { solve(); } return 0; }
#include <bits/stdc++.h> using namespace std; void fun() { long long i, c = 0, n; cin >> n; c = n / 2 + 1; cout << c << endl; return; } int main() { long long t = 1; cin >> t; while (t--) { fun(); } return 0; }
#include <bits/stdc++.h> using namespace std; const int M = 1e9 + 7; const int N = 1e5 + 7; int main() { long long int t = 1; cin >> t; while (t--) { long long int n; cin >> n; long long int p = n / 2 + 1; cout << p << "\n"; } }
#include <bits/stdc++.h> using namespace std; const int N = 5e3 + 9; const int M = 5e4 + 9; long long read() { long long x = 0, op = 1; char c = getchar(); while (!isdigit(c)) { if (c == '-') op = -1; c = getchar(); } while (isdigit(c)) x = x * 10 + c - 48, c = getchar(); return x * op; } signed main() { int T = read(); while (T--) { int n = read(); if (n & 1) n--; cout << n / 2 + 1 << '\n'; } return 0; }
#include <bits/stdc++.h> using namespace std; void solve() { int n; cin >> n; if (n == 1) { cout << "1\n"; } else if (n == 2 || n == 3) { cout << 2 << "\n"; } else { if (n % 2 != 0) { int a = 1; cout << (n + 1) / 2 << "\n"; } else { cout << n / 2 + 1 << "\n"; } } } int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n = 1; cin >> n; for (int i = 0; i < n; i++) { solve(); } }
#include <bits/stdc++.h> using namespace std; int main() { int t, n; for (cin >> t; t--;) { cin >> n; cout << (n + 2 >> 1) << '\n'; } }
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; for (int i = 0; i < t; i++) { int a; cin >> a; if ((a + 1) % 2 == 0) { cout << ((a + 1) / 2) << endl; } else { cout << ((a + 2) / 2) << endl; } } }
#include <bits/stdc++.h> using namespace std; int main() { int T, n, res; scanf("%d", &T); for (int i = 0; i < T; i++) { scanf("%d", &n); printf("%d\n", n / 2 + 1); } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int test; cin >> test; while (test--) { int num; cin >> num; cout << (num / 2) + 1 << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; for (; t > 0; t--) { int n; cin >> n; cout << n / 2 + 1 << endl; } return 0; }
#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 int n; cin >> n; cout << (n / 2) + 1 << "\n"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t != 0) { t--; int n; cin >> n; cout << (n / 2 + 1) << "\n"; } return 0; }
#include <bits/stdc++.h> using namespace std; const int N = 2E5 + 10; int n; long long solve(int n) { return n / 2 + 1; } int main() { int t; cin >> t; while (t--) { int n; cin >> n; cout << solve(n) << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; signed main() { long long test = 1; cin >> test; while (test--) { long long n; cin >> n; cout << (n / 2 + 1) << endl; } }
#include <bits/stdc++.h> using namespace std; long long board(long long n, long long count) { if (n == 1) return 1; if (n == 2) return 2; if (n == 3) return 2 + count; return board(n - 1, count++); } int main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); long long t; cin >> t; while (t--) { long long n, ans = 0; cin >> n; long long count = 1; if (n % 2 != 0) cout << n / 2 + 1 << "\n"; else cout << n / 2 + 1 << "\n"; } return 0; }
#include <bits/stdc++.h> #pragma GCC optimize("fast-math") using namespace std; int main() { ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); int t; cin >> t; while (t--) { int n; cin >> n; cout << n / 2 + 1 << endl; } }
#include <bits/stdc++.h> using namespace std; using vi = vector<int>; using vvi = vector<vi>; using ll = long long; using vll = vector<ll>; using pii = pair<int, int>; using pll = pair<ll, ll>; void buff() { ios::sync_with_stdio(false); cin.tie(nullptr); } constexpr ll MOD = 1e9 + 7; inline ll pow_mod(ll a, ll b, ll mod = MOD) { ll res = 1; a %= mod; assert(b >= 0); for (; b; b >>= 1) { if (b & 1) res = (res * a) % mod; a = (a * a) % mod; } return res; } template <typename T> inline void remin(T& x, const T& y) { x = min(x, y); } template <typename T> inline void remax(T& x, const T& y) { x = max(x, y); } template <typename T> ostream& operator<<(ostream& os, const vector<T>& v) { os << "{"; string sep; for (const auto& x : v) os << sep << x, sep = ", "; return os << "}"; } template <typename T, size_t size> ostream& operator<<(ostream& os, const array<T, size>& arr) { os << "{"; string sep; for (const auto& x : arr) os << sep << x, sep = ", "; return os << "}"; } template <typename A, typename B> ostream& operator<<(ostream& os, const pair<A, B>& p) { return os << '(' << p.first << ", " << p.second << ')'; } int main() { buff(); int t; cin >> t; while (t--) { int n; cin >> n; if (n == 1) cout << 1 << '\n'; else { cout << (n / 2) + 1 << '\n'; } } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long t, n, i, j; cin >> t; while (t--) { cin >> n; if (n == 1) cout << "1" << endl; else if (n == 2) cout << "2" << endl; else { long long temp = (n / 2) + 1; cout << temp << endl; } } }
#include <bits/stdc++.h> using namespace std; int main() { int t; scanf("%d", &t); while (t--) { int n; scanf("%d", &n); printf("%d\n", n / 2 + 1); } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { long long n; cin >> n; if (n == 1) cout << 1 << "\n"; else if (n == 2) cout << 2 << "\n"; else cout << ((n / 2) + 1) << "\n"; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { int n; cin >> n; cout << n / 2 + 1 << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; for (int i = 0; i < n; i++) { int k; cin >> k; cout << k / 2 + 1 << "\n"; } return 0; }
#include <bits/stdc++.h> using namespace std; void solve() { long long n; cin >> n; long long res = 1; n--; res += ((n + 1) / 2); cout << res << endl; } int main() { ifstream fin("text.in"); ofstream fout("text.out"); long long t = 1; cin >> t; while (t--) solve(); return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int t; cin >> t; while (t--) { long n; cin >> n; cout << (n / 2) + 1 << endl; } }
#include <bits/stdc++.h> using namespace std; int main() { int testcase; cin >> testcase; int result = 0; while (testcase--) { int n; cin >> n; cout << n / 2 + 1 << endl; } }
#include <bits/stdc++.h> using namespace std; const int mod = 1e9 + 7, N = 1e5 + 10; void solve() { int n; cin >> n; cout << n / 2 + 1 << "\n"; return; } int32_t main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int test = 1; cin >> test; while (test--) { solve(); } }
#include <bits/stdc++.h> using namespace std; int main() { long long i, t; cin >> t; while (t--) { cin >> i; cout << (i / 2) + 1 << endl; } }
#include <bits/stdc++.h> using namespace std; void fast() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } void solve() { long long a; cin >> a; cout << a / 2 + 1 << endl; } int main() { fast(); int t; cin >> t; while (t--) { solve(); } return 0; }
#include <bits/stdc++.h> using namespace std; const int INF = 0x3f3f3f3f3f3f; const int N = 1000 + 5; int main() { int t; cin >> t; while (t--) { int n; cin >> n; if (n == 1) cout << 1 << endl; else cout << n / 2 + 1 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { long long int i, j, c, d; cin >> c; while (c--) { cin >> d; cout << (d / 2) + 1 << endl; } return 0; }
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; int a; int res; int cuenta = 0; for (int x = 0; x < n; x++) { cuenta = 0; cin >> a; cuenta = round(a / 2.0); if (a % 2 == 0) { cuenta = a / 2 + 1; } cout << cuenta << endl; } }
#include <bits/stdc++.h> using namespace std; const int maxn = 1e6 + 6; int t, n, a[maxn]; int main() { cin >> t; while (t--) { cin >> n; cout << n / 2 + 1 << endl; } return 0; }