Sum in Pairs Zscaler Interview Question
Sum in Pairs Zscaler Interview Question
// @Author: Mars_Coder
// @date: 20-Jun-23 8:59:22 PM +06
// https://codeforces.com/problemset/problem/1843/C
#define _USE_MATH_DEFINES
#include<bits/stdc++.h>
using namespace std;
// array<T, n> a = {}
int main(void){
stop_sync;
untie_ios;
#ifndef ONLINE_JUDGE
//freopen("generator.txt", "r", stdin);
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
freopen("error.txt", "w", stderr);
#endif
/*
some familiar issues & sugg.:
!----> [RE-READ THE CODE!]
!----> [invariants to array?]
!----> [kinda back-tracking?]
!----> [use clear() at last if resize() used!]
!----> [look at global variables and their values]
!----> [llabs() for long long int type]
!----> [look at input size and time limit]
!----> [No sync with puts fn]
!----> [prefix vs suffix]
!----> [binary search? -> ubd, lbd]
!----> [array contains duplicate values!]
!----> [(a/b+1)*b vs uceil(a,b)*b]
!----> [unq_v for vec only]
!----> [bitmask vs unsigned; (1ull << i) -> pow2]
!----> [use gcd(), NOT __gcd() for ai < 0]
*/