Codeforces Round #720 (Div. 2) 1521B - Nastia and a Good Array Solution
Problem Link : https://codeforces.com/problemset/problem/1521/B
Solution in C++:
- /// La ilaha illellahu muhammadur rasulullah
- ///******Bismillahir-Rahmanir-Rahim******///
- /// Abul Hasnat Tonmoy
- /// Department of CSE,23rd batch
- /// Islamic University,Bangladesh
- ///**********ALLAH IS ALMIGHTY************///
- #include <bits/stdc++.h>
- using namespace std;
- int32_t main() {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- int t;
- cin >> t;
- while (t--) {
- int n;
- cin >> n;
- int a[n + 2];
- for (int i = 0; i < n; i++) cin >> a[i];
- cout << n / 2 << endl;
- for (auto i = 1; i < n; i += 2) {
- cout << i << " " << i + 1 << " " << min(a[i], a[i - 1]) << " " << "1000000009" << endl;
- }
- }
- return 0;
- }
No comments