#include #include #include #include #include #include #include #include #include #include using namespace std; using ll = long long; #define INF 1ll << 60 bool localTest = false; long long readLongLong() { long long t; cin >> t; return t; } std::vector readVector(long long size) { std::vector v(size); for (long long i = 0; i < size; i++) { cin >> v[i]; } return v; } class CodeForcesPrint { public: CodeForcesPrint operator<<(int n) { CodeForcesPrint tmp; std::cout << n << std::endl; return tmp; } CodeForcesPrint operator<<(long long n) { CodeForcesPrint tmp; std::cout << n << std::endl; return tmp; } CodeForcesPrint operator<<(long unsigned int n) { CodeForcesPrint tmp; std::cout << n << std::endl; return tmp; } CodeForcesPrint operator<<(long long unsigned int n) { CodeForcesPrint tmp; std::cout << n << std::endl; return tmp; } CodeForcesPrint operator<<(double n) { CodeForcesPrint tmp; std::cout << n << std::endl; return tmp; } CodeForcesPrint operator<<(long double n) { CodeForcesPrint tmp; std::cout << n << std::endl; return tmp; } CodeForcesPrint operator<<(std::vector v) { CodeForcesPrint tmp; for (long unsigned int i = 0; i < v.size(); i++) { cout << v[i] << " "; } cout << endl; return tmp; } CodeForcesPrint operator<<(std::vector> finalAnswer) { CodeForcesPrint tmp; if (localTest) { cout << "--final answer--" << endl; } for (long unsigned int i = 0; i < finalAnswer.size(); i++) { for (long unsigned int k = 0; k < finalAnswer.at(i).size(); k++) { cout << finalAnswer.at(i).at(k) << " "; } cout << endl; } return tmp; } CodeForcesPrint operator<<(char s) { CodeForcesPrint tmp; cout << s << endl; return tmp; } CodeForcesPrint operator<<(string s) { CodeForcesPrint tmp; cout << s << endl; return tmp; } CodeForcesPrint operator<<(std::vector finalAnswer) { CodeForcesPrint tmp; if (localTest) { cout << "--final answer--" << endl; } for (long unsigned int i = 0; i < finalAnswer.size(); i++) { cout << finalAnswer[i] << endl; } return tmp; } }; template std::vector permutation(std::vector vec, std::vector before_list, std::vector after_list) { std::vector res(vec.size()); for (long unsigned int i = 0; i < vec.size(); i++) { for (long unsigned int k = 0; k < before_list.size(); k++) { if (vec[i] == before_list[k]) { res[i] = after_list[k]; } } } return res; } template vector permutationRead(long long size, std::vector before_list, std::vector after_list) { vector t(size); for (long unsigned int i = 0; i < size; i++) { cin >> t[i]; } return permutation(t, before_list, after_list); } long long readTestcaseSize() { ll t; cin >> t; return t; } #define inTest \ ll t = readTestcaseSize(); \ for (ll testcase = 0; testcase < t; testcase++) class OddNumber { }; class EvenNumber { }; bool operator==([[maybe_unused]] OddNumber oddNumber, long long n) { return n % 2 == 1; } bool operator==([[maybe_unused]] EvenNumber evenNumber, long long n) { return n % 2 == 0; } bool operator==(long long n, [[maybe_unused]] OddNumber oddNumber) { return n % 2 == 1; } bool operator==(long long n, [[maybe_unused]] EvenNumber evenNumber) { return n % 2 == 0; } #define ll(name) long long name = readLongLong() #define llV(name, size) std::vector name = readVector(size) OddNumber Odd; EvenNumber Even; CodeForcesPrint print; //________________________________________________________________________________ #define rep(name, n) for (long unsigned int name = 0; name < n; name++) #define rep1(name, n) for (long unsigned int name = 1; name < n; name++) #define string(name) \ string name; \ cin >> name; class NumString : public string { private: string s_; vector nums; long long length_; long long number; public: NumString(string s) : s_(s) { for (long unsigned int i = 0; i < s.length(); i++) { nums.push_back((ll)s[i] - 48); } length_ = s.length(); number = 0; ll tmp = 1; for (long unsigned int i = 0; i < s.length(); i++) { number += nums[i] * tmp; tmp *= 10; } } NumString(long long n) { number = n; string s = to_string(n); s_ = s; for (long unsigned int i = 0; i < s.length(); i++) { nums.push_back((ll)s[i] - 48); } length_ = s.length(); } long long getNumber() { return number; } long long length() { return length_; } long long &operator[](long long index) { return nums.at(length_ - index - 1); } vector getNums() { return nums; } }; #define all(v) v.begin(), v.end() #define yes print << "Yes" #define no print << "No" class ULString { private: string s_; long long length_; long long upper_case_letter_numbers; long long lower_case_letter_numbers; const long long border = 94; //no problem if this is x | 91<=x<=96 const long long dis_upper_lower = 32; //note upper IsUppers; public: ULString(string s) : IsUppers(s.length()) { s_ = s; length_ = s.length(); upper_case_letter_numbers = 0; lower_case_letter_numbers = 0; for (unsigned int i = 0; i < s.length(); i++) { if (s[i] > border) { IsUppers[i] = false; lower_case_letter_numbers--; } else { IsUppers[i] = true; upper_case_letter_numbers++; } } } long long length() { return length_; } char &operator[](long long index) { return s_[index]; } bool IsUpper(long long index) { if (s_[index] > border) { return true; } else { return false; } } bool IsLower(long long index) { return !IsUpper(index); } string AllU() { string res = s_; for (unsigned int i = 0; i < length_; i++) { if (!IsUppers[i]) { res[i] = char(res[i] - dis_upper_lower); } } return res; } string AllL() { string res = s_; for (unsigned int i = 0; i < length_; i++) { if (IsUppers[i]) { res[i] = char(res[i] + dis_upper_lower); } } return res; } vector getIsUppers() { return IsUppers; } }; long long sum(vector v) { ll res = 0; for (unsigned int i = 0; i < v.size(); i++) res += v[i]; return res; } #define YES print << "YES" #define NO print << "NO" bool f(string s) { rep(i, s.length() / 2) { if (s[i] != s[s.length() - i - 1]) return false; } return true; } int main() { ll counter=0; ll res=0; // ll(N);llV(x,N); // ll res1=0; // rep(i,N)res1+=abs(x[i]); // long double res2=0; // rep(i,N)res2+=x[i]*x[i]; // res2=sqrt(res2); // ll res3=-INF; // rep(i,N)res3=max(res3,abs(x[i])); // print<