-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest.cpp
43 lines (36 loc) · 941 Bytes
/
test.cpp
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
40
41
42
43
#include<bits/stdc++.h>
typedef long long int ll;
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
#ifndef ONLINE_JUDGE
freopen("Input.txt","r",stdin);
freopen("Output.txt","w",stdout);
#endif
ll n; cin >> n;
vector<ll> arr(n);
for (ll i = 0; i < n; i++) {
cin >> arr[i];
}
if (n == 1) {
cout << 1 << " " << 1 << endl;
cout << 0 << endl;
cout << 1 << " " << 1 << endl;
cout << 0 << endl;
cout << 1 << " " << 1 << endl;
cout << -arr[0] << endl;
return 0;
}
cout << 1 << " " << n << endl;
for (ll i = 0; i < n; i++) {
cout << (ll)arr[i]*-n << " ";
}
cout << endl << 2 << " " << n << endl;
for (ll i = 1; i < n; i++) {
cout << (ll)arr[i]*(n-1) << " ";
}
cout << endl << 1 << " " << 1 << endl;
cout << (ll)(n-1)*arr[0] << endl;
return 0;
}