forked from ngthanhtrung23/CompetitiveProgramming
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA.cpp
More file actions
39 lines (31 loc) · 856 Bytes
/
A.cpp
File metadata and controls
39 lines (31 loc) · 856 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include "bits/stdc++.h"
#define int long long
using namespace std;
int32_t main() {
ios::sync_with_stdio(0);
cin.tie(0);
int n; cin >> n;
vector<int> a(n);
for (int& x : a) cin >> x;
if (n == 1) {
cout << 1 << ' ' << 1 << endl;
cout << -a[n-1] << endl;
cout << 1 << ' ' << 1 << endl;
cout << 0 << endl;
cout << 1 << ' ' << 1 << endl;
cout << 0 << endl;
return 0;
}
cout << 1 << ' ' << n-1 << endl;
for (int i = 0; i < n-1; i++) {
cout << a[i] * (n-1) << ' ';
}
cout << endl;
cout << n << ' ' << n << endl;
cout << a[n-1] * -1 << endl;
cout << 1 << ' ' << n << endl;
for (int i = 0; i < n; i++) {
if (i == n-1) cout << 0 << endl;
else cout << -a[i] * n << ' ';
}
}