-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path503.cpp
More file actions
33 lines (28 loc) · 679 Bytes
/
Copy path503.cpp
File metadata and controls
33 lines (28 loc) · 679 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
#include <iostream>
using namespace std;
void min(unsigned short& min, unsigned short& max) {
if(min < max) return;
unsigned short aux = min;
min = max;
max = aux;
}
int main() {
unsigned short cases;
cin >> cases;
for(unsigned short i = 0; i < cases; ++i) {
unsigned short uno, dos;
cin >> uno >> dos;
if(uno == dos) {
cout << ((uno + dos) / 2) + 1 << "\n";
} else {
min(uno, dos);
unsigned short i = uno + 1;
cout << i;
while(i < dos + 1) {
cout << " " << (++i);
}
cout << "\n";
}
}
return 0;
}