blob: fc0de0b47d1ff3cefd4733697b844806af2873f7 (
plain)
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
|
#include <iostream>
#include <random>
#include <vector>
using std::cout;
int main() {
std::default_random_engine engine(std::random_device{}());
std::uniform_int_distribution<int> distribution(1, 1000);
const int SIZE = 100;
std::vector<int> b;
for (int i = 0; i < SIZE * 2; i++) {
b.push_back(distribution(engine));
}
long long sum = 0;
for (int i = 0; i < SIZE; i++) {
sum += b[i * 2] * b[i * 2 + 1];
}
cout << SIZE << ' ' << (sum + 10) << '\n';
for (int i = 0; i < SIZE; i++) {
cout << b[i * 2] << ' ' << b[i * 2 + 1] << '\n';
}
return 0;
}
|