Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cstdio>
- #include <iostream>
- #include <algorithm>
- #include <vector>
- #define pb push_back
- const int N = 105;
- using namespace std;
- int n, m, mx = 0, t[N];
- vector<int> au[N], timer[N];
- int main() {
- freopen("input.txt", "r", stdin);
- freopen("output.txt", "w", stdout);
- cin >> n >> m;
- for (int i = 0; i < m; i++) {
- cin >> t[i];
- mx = max(t[i], mx);
- }
- cout << mx * n << endl;
- for (int i = 0; i < n; i++)
- for (int j = 0; j < m; j++) {
- int num = (i + j) % n;
- au[num].pb(j + 1);
- timer[num].pb(mx * i);
- }
- for (int i = 0; i < n; i++) {
- cout << endl;
- for (int j = 0; j < m; j++)
- cout << au[i][j] << " " << timer[i][j] << endl;
- }
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement