output
stringlengths 52
181k
| instruction
stringlengths 296
182k
|
---|---|
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
for (int i = 1; i <= t; i++) {
int n, x;
cin >> n >> x;
cout << x * 2 << endl;
}
return 0;
}
| ### Prompt
Please formulate a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
for (int i = 1; i <= t; i++) {
int n, x;
cin >> n >> x;
cout << x * 2 << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
int t;
cin >> t;
while (t--) {
int n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
| ### Prompt
Please provide a cpp coded solution to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int32_t main() {
int t;
cin >> t;
while (t--) {
int n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n], b[n];
for (long long i = 0; i < n; i++) {
cin >> a[i] >> b[i];
}
for (long long i = 0; i < n; i++) {
cout << b[i] * 2 << endl;
}
}
| ### Prompt
Construct a Cpp code solution to the problem outlined:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
int a[n], b[n];
for (long long i = 0; i < n; i++) {
cin >> a[i] >> b[i];
}
for (long long i = 0; i < n; i++) {
cout << b[i] * 2 << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, i, t, j, k;
scanf("%d", &t);
for (i = 1; i <= t; i++) {
scanf("%d %d", &n, &x);
j = 0;
for (k = 1; k <= x; k++) {
j = j + 2;
}
printf("%d\n", j);
}
return 0;
}
| ### Prompt
Please provide a Cpp coded solution to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, i, t, j, k;
scanf("%d", &t);
for (i = 1; i <= t; i++) {
scanf("%d %d", &n, &x);
j = 0;
for (k = 1; k <= x; k++) {
j = j + 2;
}
printf("%d\n", j);
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int T, a;
cin >> T;
for (int i = 1; i <= T; i++) {
cin >> a >> a;
cout << a * 2 << endl;
}
return 0;
}
| ### Prompt
Construct a Cpp code solution to the problem outlined:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int T, a;
cin >> T;
for (int i = 1; i <= T; i++) {
cin >> a >> a;
cout << a * 2 << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
long long ab(long long x) { return x > 0LL ? x : -x; }
long long round_up(long long x, long long y) {
long long r = x / y;
return r * y == x ? r : ++r;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long t;
cin >> t;
while (t--) {
long long n, x;
cin >> n >> x;
if (2 * x > n) {
cout << n << '\n';
} else {
cout << 2 * x << '\n';
}
}
}
| ### Prompt
Construct a CPP code solution to the problem outlined:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
long long ab(long long x) { return x > 0LL ? x : -x; }
long long round_up(long long x, long long y) {
long long r = x / y;
return r * y == x ? r : ++r;
}
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
long long t;
cin >> t;
while (t--) {
long long n, x;
cin >> n >> x;
if (2 * x > n) {
cout << n << '\n';
} else {
cout << 2 * x << '\n';
}
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
;
int t;
cin >> t;
while (t--) {
int n, x;
cin >> n >> x;
cout << 2 * x << "\n";
}
}
| ### Prompt
Construct a Cpp code solution to the problem outlined:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
;
int t;
cin >> t;
while (t--) {
int n, x;
cin >> n >> x;
cout << 2 * x << "\n";
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int a, b;
cin >> a >> b;
cout << 2 * b << endl;
}
return 0;
}
| ### Prompt
Please provide a cpp coded solution to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int a, b;
cin >> a >> b;
cout << 2 * b << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int t;
cin >> t;
for (long long int q = 1; q <= t; q++) {
long long int n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
| ### Prompt
Create a solution in CPP for the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int t;
cin >> t;
for (long long int q = 1; q <= t; q++) {
long long int n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, x, y;
cin >> t;
while (t--) {
cin >> x >> y;
cout << y * 2 << endl;
}
return 0;
}
| ### Prompt
Your challenge is to write a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, x, y;
cin >> t;
while (t--) {
cin >> x >> y;
cout << y * 2 << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int t, n, x, i;
map<int, bool> prime;
int main() {
scanf("%d", &t);
while (t--) {
scanf("%d %d", &n, &x);
printf("%d\n", 2 * x);
}
return 0;
}
| ### Prompt
Develop a solution in Cpp to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int t, n, x, i;
map<int, bool> prime;
int main() {
scanf("%d", &t);
while (t--) {
scanf("%d %d", &n, &x);
printf("%d\n", 2 * x);
}
return 0;
}
``` |
#include <bits/stdc++.h>
int main() {
long long int t;
scanf("%lld", &t);
while (t--) {
long long int a, b;
scanf("%lld%lld", &a, &b);
printf("%lld\n", 2 * b);
}
return 0;
}
| ### Prompt
Construct a Cpp code solution to the problem outlined:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
int main() {
long long int t;
scanf("%lld", &t);
while (t--) {
long long int a, b;
scanf("%lld%lld", &a, &b);
printf("%lld\n", 2 * b);
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, x, T;
cin >> T;
while (T--) {
cin >> n >> x;
cout << x * 2 << endl;
}
}
| ### Prompt
Your task is to create a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, x, T;
cin >> T;
while (T--) {
cin >> n >> x;
cout << x * 2 << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false), cin.tie(0);
;
int t;
cin >> t;
long long int n, x;
while (t--) {
cin >> n >> x;
cout << 2 * x << endl;
}
}
| ### Prompt
Your task is to create a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false), cin.tie(0);
;
int t;
cin >> t;
long long int n, x;
while (t--) {
cin >> n >> x;
cout << 2 * x << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long n, k;
cin >> n >> k;
cout << 2 * k << endl;
}
}
| ### Prompt
Please create a solution in CPP to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long n, k;
cin >> n >> k;
cout << 2 * k << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int T, N, X;
scanf("%d", &T);
for (int i = 0; i < T; ++i) {
scanf("%d%d", &N, &X);
printf("%d\n", X * 2);
}
}
| ### Prompt
Your task is to create a Cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int T, N, X;
scanf("%d", &T);
for (int i = 0; i < T; ++i) {
scanf("%d%d", &N, &X);
printf("%d\n", X * 2);
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
signed main() {
long long t;
cin >> t;
long long x, n;
for (long long i = 0; i < t; i++) {
cin >> x >> n;
cout << n * 2 << '\n';
}
return 0;
}
| ### Prompt
Your challenge is to write a Cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
signed main() {
long long t;
cin >> t;
long long x, n;
for (long long i = 0; i < t; i++) {
cin >> x >> n;
cout << n * 2 << '\n';
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long int n, x, i, j, k = 0;
cin >> n >> x;
for (i = 1, j = 1; (i - k) <= x; i = (j + k)) {
if ((i - k) == j) {
k++;
j++;
}
}
cout << x + k << endl;
}
return 0;
}
| ### Prompt
Your challenge is to write a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long int n, x, i, j, k = 0;
cin >> n >> x;
for (i = 1, j = 1; (i - k) <= x; i = (j + k)) {
if ((i - k) == j) {
k++;
j++;
}
}
cout << x + k << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using maxHeap = priority_queue<int>;
using minHeap = priority_queue<int, vector<int>, greater<int>()>;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int t, n, x;
for (cin >> t; t; t--) {
cin >> n >> x;
cout << 2 * x << '\n';
}
return 0;
}
| ### Prompt
Please create a solution in cpp to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using maxHeap = priority_queue<int>;
using minHeap = priority_queue<int, vector<int>, greater<int>()>;
int main() {
ios::sync_with_stdio(0), cin.tie(0);
int t, n, x;
for (cin >> t; t; t--) {
cin >> n >> x;
cout << 2 * x << '\n';
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
while (n--) {
int temp, m;
cin >> temp >> m;
cout << 2 * m << endl;
}
}
| ### Prompt
In Cpp, your task is to solve the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
cin >> n;
while (n--) {
int temp, m;
cin >> temp >> m;
cout << 2 * m << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int t, n, x;
scanf("%d", &t);
while (t--) {
scanf("%d %d", &n, &x);
printf("%d\n", 2 * x);
}
}
| ### Prompt
In CPP, your task is to solve the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main() {
int t, n, x;
scanf("%d", &t);
while (t--) {
scanf("%d %d", &n, &x);
printf("%d\n", 2 * x);
}
}
``` |
#include <bits/stdc++.h>
int main() {
int t, a, b;
scanf("%d", &t);
while (t--) {
scanf("%d%d", &a, &b);
printf("%d\n", 2 * b);
}
return 0;
}
| ### Prompt
Please provide a CPP coded solution to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
int main() {
int t, a, b;
scanf("%d", &t);
while (t--) {
scanf("%d%d", &a, &b);
printf("%d\n", 2 * b);
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <typename T>
inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
const double EPS = 1e-10;
const double PI = acos(-1);
class ARemoveAProgression {
public:
int T;
void input(std::istream& in, std::ostream& out) {
ios_base::sync_with_stdio(false);
in.tie(nullptr), out.tie(nullptr);
in >> T;
}
void solve(std::istream& in, std::ostream& out) {
input(in, out);
while (T--) {
int x, n;
in >> n >> x;
out << 2 * x << '\n';
}
}
};
int main() {
ARemoveAProgression solver;
std::istream& in(std::cin);
std::ostream& out(std::cout);
solver.solve(in, out);
return 0;
}
| ### Prompt
Please formulate a CPP solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
template <typename T>
inline bool chmax(T& a, T b) {
if (a < b) {
a = b;
return true;
}
return false;
}
template <typename T>
inline bool chmin(T& a, T b) {
if (a > b) {
a = b;
return true;
}
return false;
}
const double EPS = 1e-10;
const double PI = acos(-1);
class ARemoveAProgression {
public:
int T;
void input(std::istream& in, std::ostream& out) {
ios_base::sync_with_stdio(false);
in.tie(nullptr), out.tie(nullptr);
in >> T;
}
void solve(std::istream& in, std::ostream& out) {
input(in, out);
while (T--) {
int x, n;
in >> n >> x;
out << 2 * x << '\n';
}
}
};
int main() {
ARemoveAProgression solver;
std::istream& in(std::cin);
std::ostream& out(std::cout);
solver.solve(in, out);
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
long long r, t, n;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> t;
while (t--) {
cin >> n >> r;
cout << 2 * r << "\n";
}
return 0;
}
| ### Prompt
Construct a Cpp code solution to the problem outlined:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
long long r, t, n;
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cin >> t;
while (t--) {
cin >> n >> r;
cout << 2 * r << "\n";
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, n, x;
cin >> t;
int r[t];
for (int i = 0; i < t; i++) {
cin >> n >> x;
r[i] = x * 2;
}
for (int i = 0; i < t; i++) {
cout << r[i] << "\n";
}
}
| ### Prompt
In cpp, your task is to solve the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, n, x;
cin >> t;
int r[t];
for (int i = 0; i < t; i++) {
cin >> n >> x;
r[i] = x * 2;
}
for (int i = 0; i < t; i++) {
cout << r[i] << "\n";
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
long double PI = acosl(-1);
bool myfunc(int a, int b) { return (a > b); }
long long int fact(long long int n) {
if (n == 0 || n == 1)
return 1;
else
return n * fact(n - 1);
}
int main() {
long long int t, x, n;
cin >> t;
while (t--) {
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
| ### Prompt
Construct a cpp code solution to the problem outlined:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
long double PI = acosl(-1);
bool myfunc(int a, int b) { return (a > b); }
long long int fact(long long int n) {
if (n == 0 || n == 1)
return 1;
else
return n * fact(n - 1);
}
int main() {
long long int t, x, n;
cin >> t;
while (t--) {
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int t, n, x;
int main() {
cin >> t;
for (int i = 1; i <= t; i++) {
cin >> n >> x;
cout << x * 2 << '\n';
}
}
| ### Prompt
In CPP, your task is to solve the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int t, n, x;
int main() {
cin >> t;
for (int i = 1; i <= t; i++) {
cin >> n >> x;
cout << x * 2 << '\n';
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, z;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x >> z;
cout << z * 2 << endl;
}
return 0;
}
| ### Prompt
Construct a cpp code solution to the problem outlined:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int n, x, z;
cin >> n;
for (int i = 0; i < n; i++) {
cin >> x >> z;
cout << z * 2 << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 100;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
long long t, n, a;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
;
cin >> t;
while (t--) {
cin >> n >> a;
cout << a * 2 << endl;
}
return 0;
}
| ### Prompt
Your challenge is to write a Cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 100;
const long long MOD = 1e9 + 7;
const long long INF = 1e18;
long long t, n, a;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
;
cin >> t;
while (t--) {
cin >> n >> a;
cout << a * 2 << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
scanf("%d", &n);
while (n--) {
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", b * 2);
}
return 0;
}
| ### Prompt
Please provide a Cpp coded solution to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int n;
scanf("%d", &n);
while (n--) {
int a, b;
scanf("%d%d", &a, &b);
printf("%d\n", b * 2);
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long x, n;
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
| ### Prompt
Please formulate a Cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long x, n;
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
long long t;
cin >> t;
while (t--) {
long long n, x;
cin >> n >> x;
cout << (2 * x) << endl;
}
return 0;
}
| ### Prompt
Please create a solution in cpp to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
long long t;
cin >> t;
while (t--) {
long long n, x;
cin >> n >> x;
cout << (2 * x) << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long T, i, j;
cin >> T;
while (T--) {
cin >> i >> j;
cout << j * 2 << "\n";
}
return 0;
}
| ### Prompt
Generate a Cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
long long T, i, j;
cin >> T;
while (T--) {
cin >> i >> j;
cout << j * 2 << "\n";
}
return 0;
}
``` |
#include <bits/stdc++.h>
int main() {
int T;
int n, x, i, j;
scanf("%d", &T);
while (T--) {
scanf("%d%d", &n, &x);
printf("%d\n", 2 * x);
}
return 0;
}
| ### Prompt
Generate a Cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
int main() {
int T;
int n, x, i, j;
scanf("%d", &T);
while (T--) {
scanf("%d%d", &n, &x);
printf("%d\n", 2 * x);
}
return 0;
}
``` |
#include <bits/stdc++.h>
#pragma GCC omptimize("unroll-loops")
#pragma optimize("SEX_ON_THE_BEACH")
#pragma GCC optimize("no-stack-protector")
#pragma comment(linker, "/STACK:1000000000")
using namespace std;
const int INF32 = 1e9;
const int sz = 1e4;
const long long INF64 = 1e18;
void Solve() {
int n, x;
cin >> n >> x;
cout << (x << 1) << endl;
}
signed main() {
ios_base::sync_with_stdio(0);
cout.tie(0);
cin.tie(0);
int q;
cin >> q;
while (q--) Solve();
}
| ### Prompt
Please create a solution in CPP to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
#pragma GCC omptimize("unroll-loops")
#pragma optimize("SEX_ON_THE_BEACH")
#pragma GCC optimize("no-stack-protector")
#pragma comment(linker, "/STACK:1000000000")
using namespace std;
const int INF32 = 1e9;
const int sz = 1e4;
const long long INF64 = 1e18;
void Solve() {
int n, x;
cin >> n >> x;
cout << (x << 1) << endl;
}
signed main() {
ios_base::sync_with_stdio(0);
cout.tie(0);
cin.tie(0);
int q;
cin >> q;
while (q--) Solve();
}
``` |
#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y) {
long long res = 1;
x = x % 1000000007;
while (y > 0) {
if (y & 1) {
res = (res * x) % 1000000007;
}
y = y >> 1;
x = (x * x) % 1000000007;
}
return res;
}
long long inv(long long x) { return power(x, 1000000007 - 2); }
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t, n, x, i;
cin >> t;
while (t--) {
cin >> n >> x;
cout << 2 * x << endl;
}
}
| ### Prompt
Your challenge is to write a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
long long power(long long x, long long y) {
long long res = 1;
x = x % 1000000007;
while (y > 0) {
if (y & 1) {
res = (res * x) % 1000000007;
}
y = y >> 1;
x = (x * x) % 1000000007;
}
return res;
}
long long inv(long long x) { return power(x, 1000000007 - 2); }
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t, n, x, i;
cin >> t;
while (t--) {
cin >> n >> x;
cout << 2 * x << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
void solve() {
long long int n, x;
cin >> n >> x;
cout << 2 * x << '\n';
}
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long int T = 1;
cin >> T;
for (long long int TT = 1; TT <= T; TT++) {
solve();
}
}
| ### Prompt
Your task is to create a Cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
void solve() {
long long int n, x;
cin >> n >> x;
cout << 2 * x << '\n';
}
int32_t main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long int T = 1;
cin >> T;
for (long long int TT = 1; TT <= T; TT++) {
solve();
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
void solve() {
int a, b;
cin >> a >> b;
cout << 2 * b << endl;
}
int main() {
int t;
cin >> t;
while (t--) {
solve();
}
return 0;
}
| ### Prompt
Develop a solution in Cpp to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
void solve() {
int a, b;
cin >> a >> b;
cout << 2 * b << endl;
}
int main() {
int t;
cin >> t;
while (t--) {
solve();
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int T, n, x;
for (scanf("%d", &T); T--; printf("%d\n", x << 1)) scanf("%d%d", &n, &x);
}
| ### Prompt
Your challenge is to write a CPP solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int T, n, x;
for (scanf("%d", &T); T--; printf("%d\n", x << 1)) scanf("%d%d", &n, &x);
}
``` |
#include <bits/stdc++.h>
using namespace std;
const int MX = 2e5 + 5, MXX = 23;
const long long mod = 1e9 + 7, inf = 1e18 + 6;
int T;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cout << fixed << setprecision(9);
cin >> T;
while (T--) {
int n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
| ### Prompt
Your challenge is to write a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
const int MX = 2e5 + 5, MXX = 23;
const long long mod = 1e9 + 7, inf = 1e18 + 6;
int T;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
cout << fixed << setprecision(9);
cin >> T;
while (T--) {
int n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3fffffff;
int main() {
int a, b, n;
cin >> n;
while (n--) {
cin >> a >> b;
cout << b * 2 << endl;
}
return 0;
}
| ### Prompt
Create a solution in cpp for the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
const int INF = 0x3fffffff;
int main() {
int a, b, n;
cin >> n;
while (n--) {
cin >> a >> b;
cout << b * 2 << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
scanf("%d", &t);
while (t--) {
int n, x;
scanf("%d %d", &n, &x);
x *= 2;
cout << x << endl;
}
}
| ### Prompt
In CPP, your task is to solve the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
scanf("%d", &t);
while (t--) {
int n, x;
scanf("%d %d", &n, &x);
x *= 2;
cout << x << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
void solve() {
long long n, x;
cin >> n >> x;
cout << x * 2 << endl;
}
int main() {
int t;
cin >> t;
while (t--) {
solve();
}
}
| ### Prompt
Your task is to create a Cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
void solve() {
long long n, x;
cin >> n >> x;
cout << x * 2 << endl;
}
int main() {
int t;
cin >> t;
while (t--) {
solve();
}
}
``` |
#include <bits/stdc++.h>
void print_array(int *a, int n) {
printf("#");
for (int i = 0; i < n; i++) printf("%d%c", a[i], i == n - 1 ? '\n' : ' ');
}
using namespace std;
const double EPS = 1e-8;
const long long INF = 0x3f3f3f3f3f3f3f3f;
int main() {
int _;
cin >> _;
while (_--) {
long long x, y;
cin >> x >> y;
cout << y * 2 << endl;
}
return 0;
}
| ### Prompt
Generate a Cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
void print_array(int *a, int n) {
printf("#");
for (int i = 0; i < n; i++) printf("%d%c", a[i], i == n - 1 ? '\n' : ' ');
}
using namespace std;
const double EPS = 1e-8;
const long long INF = 0x3f3f3f3f3f3f3f3f;
int main() {
int _;
cin >> _;
while (_--) {
long long x, y;
cin >> x >> y;
cout << y * 2 << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long t;
cin >> t;
for (long long i = 0; i < t; i++) {
long long n, x;
cin >> n >> x;
cout << (2 * x) << endl;
}
return 0;
}
| ### Prompt
Please provide a cpp coded solution to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
long long t;
cin >> t;
for (long long i = 0; i < t; i++) {
long long n, x;
cin >> n >> x;
cout << (2 * x) << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u,
v, w, x, y, z;
cin >> t;
while (t--) {
cin >> n >> x;
cout << x * 2 << "\n";
}
return 0;
}
| ### Prompt
Create a solution in Cpp for the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u,
v, w, x, y, z;
cin >> t;
while (t--) {
cin >> n >> x;
cout << x * 2 << "\n";
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int q;
cin >> q;
while (q--) {
long long int n, k;
cin >> n >> k;
cout << 2 * k << endl;
}
return 0;
}
| ### Prompt
Construct a CPP code solution to the problem outlined:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int q;
cin >> q;
while (q--) {
long long int n, k;
cin >> n >> k;
cout << 2 * k << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int q, n, m;
cin >> q;
for (int i = 0; i < q; i++) {
cin >> n >> m;
cout << m * 2 << "\n";
}
}
| ### Prompt
Your task is to create a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int q, n, m;
cin >> q;
for (int i = 0; i < q; i++) {
cin >> n >> m;
cout << m * 2 << "\n";
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
}
| ### Prompt
Please create a solution in cpp to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int t;
cin >> t;
while (t--) {
int x, n;
cin >> x >> n;
cout << (n << 1) << "\n";
}
return 0;
}
| ### Prompt
Please formulate a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0), cin.tie(0), cout.tie(0);
int t;
cin >> t;
while (t--) {
int x, n;
cin >> x >> n;
cout << (n << 1) << "\n";
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int T, j;
scanf("%d", &T);
for (j = 0; j < T; j++) {
int n, i, sum = 0, m, s = 0, x;
scanf("%d %d", &n, &x);
printf("%d\n", 2 * x);
}
return 0;
}
| ### Prompt
Develop a solution in cpp to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int T, j;
scanf("%d", &T);
for (j = 0; j < T; j++) {
int n, i, sum = 0, m, s = 0, x;
scanf("%d %d", &n, &x);
printf("%d\n", 2 * x);
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int N, T, x;
int main() {
cin >> T;
for (int t = 1; t <= T; t++) {
cin >> N >> x;
cout << 2 * x << '\n';
}
return 0;
}
| ### Prompt
Your task is to create a CPP solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int N, T, x;
int main() {
cin >> T;
for (int t = 1; t <= T; t++) {
cin >> N >> x;
cout << 2 * x << '\n';
}
return 0;
}
``` |
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
const char E = '\n';
const int N = 1001;
const int mod = 1e9 + 7;
mt19937_64 mt_rnd_64(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll l, ll r) { return (mt_rnd_64() % (r - l + 1)) + l; }
inline void solve() {
int n;
cin >> n;
while (n) {
n--;
int x, y;
cin >> x >> y;
cout << y * 2 << E;
}
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
srand(time(0));
solve();
return 0;
}
| ### Prompt
Your task is to create a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
using namespace std;
using ll = long long;
const char E = '\n';
const int N = 1001;
const int mod = 1e9 + 7;
mt19937_64 mt_rnd_64(chrono::steady_clock::now().time_since_epoch().count());
ll rnd(ll l, ll r) { return (mt_rnd_64() % (r - l + 1)) + l; }
inline void solve() {
int n;
cin >> n;
while (n) {
n--;
int x, y;
cin >> x >> y;
cout << y * 2 << E;
}
}
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
srand(time(0));
solve();
return 0;
}
``` |
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int N = 1e6 + 1;
void checkmate() {
int n;
cin >> n >> n;
cout << (2 * n) << '\n';
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t = 1;
cin >> t;
while (t--) checkmate();
return 0;
}
| ### Prompt
Construct a CPP code solution to the problem outlined:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int N = 1e6 + 1;
void checkmate() {
int n;
cin >> n >> n;
cout << (2 * n) << '\n';
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t = 1;
cin >> t;
while (t--) checkmate();
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, n, x;
cin >> t;
for (int i = 0; i < t; i++) {
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
| ### Prompt
Generate a Cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, n, x;
cin >> t;
for (int i = 0; i < t; i++) {
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
long int T, N, x;
cin >> T;
while (T--) {
cin >> N;
cin >> x;
cout << (2 * x);
cout << endl;
}
}
| ### Prompt
Please create a solution in CPP to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
long int T, N, x;
cin >> T;
while (T--) {
cin >> N;
cin >> x;
cout << (2 * x);
cout << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int t, n, x;
cin >> t;
while (t--) {
cin >> n >> x;
cout << 2 * x << "\n";
}
return 0;
}
| ### Prompt
Construct a CPP code solution to the problem outlined:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int t, n, x;
cin >> t;
while (t--) {
cin >> n >> x;
cout << 2 * x << "\n";
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
int t;
cin >> t;
while (t--) {
int x, y;
cin >> x >> y;
cout << 2 * y << endl;
}
return 0;
}
| ### Prompt
Create a solution in cpp for the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
int t;
cin >> t;
while (t--) {
int x, y;
cin >> x >> y;
cout << 2 * y << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
long x, n;
cin >> t;
for (int i = 0; i < t; i++) {
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
| ### Prompt
Please formulate a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
long x, n;
cin >> t;
for (int i = 0; i < t; i++) {
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
}
| ### Prompt
Please formulate a CPP solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
int n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long n, m, i, x = 0;
cin >> n >> m;
for (i = 1; i <= m; i++) {
x = x + 2;
}
cout << x << endl;
}
}
| ### Prompt
Your challenge is to write a CPP solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long n, m, i, x = 0;
cin >> n >> m;
for (i = 1; i <= m; i++) {
x = x + 2;
}
cout << x << endl;
}
}
``` |
#include <bits/stdc++.h>
int main(void) {
int t;
long int n, x;
scanf("%d", &t);
while (t--) {
scanf("%ld%ld", &n, &x);
printf("%ld\n", x * 2);
}
return 0;
}
| ### Prompt
Your challenge is to write a CPP solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
int main(void) {
int t;
long int n, x;
scanf("%d", &t);
while (t--) {
scanf("%ld%ld", &n, &x);
printf("%ld\n", x * 2);
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int test, x, y;
cin >> test;
for (int i = 0; i < test; i++) {
cin >> x >> y;
cout << y * 2 << endl;
}
return 0;
}
| ### Prompt
Your challenge is to write a CPP solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int test, x, y;
cin >> test;
for (int i = 0; i < test; i++) {
cin >> x >> y;
cout << y * 2 << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int T, n, x;
cin >> T;
while (T--) {
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
| ### Prompt
Please create a solution in CPP to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
int T, n, x;
cin >> T;
while (T--) {
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
long long T, n, k;
cin >> T;
for (int i = 0; i < T; i++) {
cin >> n >> k;
cout << k * 2 << "\n";
}
}
| ### Prompt
Your task is to create a Cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(false);
long long T, n, k;
cin >> T;
for (int i = 0; i < T; i++) {
cin >> n >> k;
cout << k * 2 << "\n";
}
}
``` |
#include <bits/stdc++.h>
const int INF = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vii = vector<pii>;
using vi = vector<ll>;
int D(int px, int py, int qx, int qy, int rx, int ry) {
return (px * qy + qx * ry + rx * py) - (py * qx + qy * rx + ry * px);
}
int main() {
int n, T, first;
cin >> T;
while (T--) {
cin >> n >> first;
cout << 2 * first << endl;
}
return 0;
}
| ### Prompt
Construct a Cpp code solution to the problem outlined:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
const int INF = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using vii = vector<pii>;
using vi = vector<ll>;
int D(int px, int py, int qx, int qy, int rx, int ry) {
return (px * qy + qx * ry + rx * py) - (py * qx + qy * rx + ry * px);
}
int main() {
int n, T, first;
cin >> T;
while (T--) {
cin >> n >> first;
cout << 2 * first << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int T;
int N[101];
int x[101];
vector<int> num;
int main(void) {
cin >> T;
for (int i = 0; i < T; i++) {
cin >> N[i];
cin >> x[i];
}
for (int i = 0; i < T; i++) {
cout << x[i] * 2 << "\n";
}
return 0;
}
| ### Prompt
Please provide a CPP coded solution to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int T;
int N[101];
int x[101];
vector<int> num;
int main(void) {
cin >> T;
for (int i = 0; i < T; i++) {
cin >> N[i];
cin >> x[i];
}
for (int i = 0; i < T; i++) {
cout << x[i] * 2 << "\n";
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
for (int in = 1; in <= t; in++) {
long long n, k, x;
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
| ### Prompt
Generate a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
for (int in = 1; in <= t; in++) {
long long n, k, x;
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int T;
cin >> T;
while (T--) {
int N, M;
cin >> N >> M;
cout << M * 2 << endl;
}
return 0;
}
| ### Prompt
Please formulate a CPP solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int T;
cin >> T;
while (T--) {
int N, M;
cin >> N >> M;
cout << M * 2 << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, n, x;
cin >> t;
while (t--) {
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
| ### Prompt
Please provide a cpp coded solution to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, n, x;
cin >> t;
while (t--) {
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 100;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int tc;
cin >> tc;
while (tc--) {
int n, x;
cin >> n >> x;
cout << x + x << endl;
}
return 0;
}
| ### Prompt
Construct a cpp code solution to the problem outlined:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 100;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
int tc;
cin >> tc;
while (tc--) {
int n, x;
cin >> n >> x;
cout << x + x << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int b;
cin >> b;
for (int jj = 0; jj < b; ++jj) {
int a[1005];
int n, i, j, k, l, m;
cin >> n >> m;
cout << m * 2 << endl;
}
}
| ### Prompt
Create a solution in cpp for the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int b;
cin >> b;
for (int jj = 0; jj < b; ++jj) {
int a[1005];
int n, i, j, k, l, m;
cin >> n >> m;
cout << m * 2 << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
long long t;
void solve() {
cin >> t;
while (t--) {
long long n, x;
cin >> n >> x;
cout << x * 2 << '\n';
}
}
int main() {
ios::sync_with_stdio(false);
solve();
}
| ### Prompt
Construct a cpp code solution to the problem outlined:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
long long t;
void solve() {
cin >> t;
while (t--) {
long long n, x;
cin >> n >> x;
cout << x * 2 << '\n';
}
}
int main() {
ios::sync_with_stdio(false);
solve();
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
int n, k;
int g;
cin >> g;
for (int j = 0; j < g; j++) {
cin >> n >> k;
cout << 2 * k << "\n";
}
return 0;
}
| ### Prompt
Develop a solution in Cpp to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main(int argc, const char* argv[]) {
int n, k;
int g;
cin >> g;
for (int j = 0; j < g; j++) {
cin >> n >> k;
cout << 2 * k << "\n";
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7, N = 1e2 + 7;
int n, m;
int a[N];
int main() {
int t;
cin >> t;
while (t--) {
int x;
cin >> n >> x;
cout << x * 2 << '\n';
}
return 0;
}
| ### Prompt
Create a solution in cpp for the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
const int mod = 1e9 + 7, N = 1e2 + 7;
int n, m;
int a[N];
int main() {
int t;
cin >> t;
while (t--) {
int x;
cin >> n >> x;
cout << x * 2 << '\n';
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t--) {
int n, x;
cin >> n >> x;
cout << x * 2 << '\n';
}
}
| ### Prompt
Please formulate a Cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int t;
cin >> t;
while (t--) {
int n, x;
cin >> n >> x;
cout << x * 2 << '\n';
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
long long t, n, x;
cin >> t;
for (int i = 0; i < t; i++) {
cin >> n >> x;
cout << x * 2 << endl;
}
}
| ### Prompt
Construct a cpp code solution to the problem outlined:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(0);
long long t, n, x;
cin >> t;
for (int i = 0; i < t; i++) {
cin >> n >> x;
cout << x * 2 << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
for (int i = 0; i < t; i++) {
int n, x;
cin >> n >> x;
cout << x * 2 << endl;
}
return 0;
}
| ### Prompt
Your task is to create a CPP solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
for (int i = 0; i < t; i++) {
int n, x;
cin >> n >> x;
cout << x * 2 << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
const int inf = 0X3f3f3f3f;
using namespace std;
void solve() {
int n, m;
cin >> n >> m;
if (m * 2 <= n) {
cout << m * 2 << "\n";
} else {
if (n & 1) {
cout << n - 1 << "\n";
} else {
cout << n << "\n";
}
}
}
int32_t main() {
int t;
cin >> t;
while (t--) solve();
;
return 0;
}
| ### Prompt
Generate a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
const int inf = 0X3f3f3f3f;
using namespace std;
void solve() {
int n, m;
cin >> n >> m;
if (m * 2 <= n) {
cout << m * 2 << "\n";
} else {
if (n & 1) {
cout << n - 1 << "\n";
} else {
cout << n << "\n";
}
}
}
int32_t main() {
int t;
cin >> t;
while (t--) solve();
;
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
| ### Prompt
Please formulate a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
while (t--) {
long long n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
const int N = 30010;
const long long mod = 998244353;
using namespace std;
int n;
int a[N], a1[N], a2[N];
int main() {
ios_base::sync_with_stdio(0);
cin >> n;
for (int i = 1; i <= n; i++) {
int x, y;
cin >> x >> y;
cout << y * 2 << endl;
}
}
| ### Prompt
Please create a solution in Cpp to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
const int N = 30010;
const long long mod = 998244353;
using namespace std;
int n;
int a[N], a1[N], a2[N];
int main() {
ios_base::sync_with_stdio(0);
cin >> n;
for (int i = 1; i <= n; i++) {
int x, y;
cin >> x >> y;
cout << y * 2 << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int n, x[105], t;
int main() {
cin >> t;
int f = t;
int i = 0;
while (t--) {
i++;
cin >> n >> x[i];
}
for (int i = 1; i <= f; ++i) cout << x[i] * 2 << endl;
return 0;
}
| ### Prompt
Your challenge is to write a Cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int n, x[105], t;
int main() {
cin >> t;
int f = t;
int i = 0;
while (t--) {
i++;
cin >> n >> x[i];
}
for (int i = 1; i <= f; ++i) cout << x[i] * 2 << endl;
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
long long n, a[100005];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while (t--) {
long long x;
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
| ### Prompt
In Cpp, your task is to solve the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
long long n, a[100005];
int main() {
ios_base::sync_with_stdio(0);
cin.tie(0);
int t;
cin >> t;
while (t--) {
long long x;
cin >> n >> x;
cout << 2 * x << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
for (int i = 0; i < t; ++i) {
long long n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
}
| ### Prompt
Develop a solution in CPP to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t;
cin >> t;
for (int i = 0; i < t; ++i) {
long long n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
int n;
cin >> n;
while (n-- > 0) {
unsigned int a, b;
cin >> a >> b;
cout << 2 * b << '\n';
}
return 0;
}
| ### Prompt
Please formulate a CPP solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
int n;
cin >> n;
while (n-- > 0) {
unsigned int a, b;
cin >> a >> b;
cout << 2 * b << '\n';
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string& s, char c) {
vector<string> v;
stringstream ss(s);
string x;
while (getline(ss, x, c)) v.emplace_back(x);
return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
cout << it->substr((*it)[0] == ' ', it->length()) << " = " << a << " ";
err(++it, args...);
}
const int M = 1e9 + 7;
int length(string s) { return (int)s.size(); }
int length(long long x) {
int l = 0;
for (long long i = x; i; i /= 10) l++;
return l;
}
int dx[8] = {1, 0, -1, 0, -1, -1, 1, 1};
int dy[8] = {0, 1, 0, -1, -1, 1, -1, 1};
long long power(long long a, long long n) {
long long int res = 1;
while (n) {
if (n & 1) res = ((res % M) * (a % M)) % M;
a = ((a % M) * (a % M)) % M;
n >>= 1;
}
return res % M;
}
int tc = 1;
inline void read(std::vector<int>& v) {
for (int i = 0; i < (int)v.size(); i++) {
cin >> (v[i]);
}
}
inline void readl(std::vector<long long int>& v) {
for (int i = 0; i < (int)v.size(); i++) {
cin >> (v[i]);
}
}
template <class T>
bool remin(T& a, const T& b) {
return a > b ? a = b, 1 : 0;
}
template <class T>
bool remax(T& a, const T& b) {
return a < b ? a = b, 1 : 0;
}
inline void read(int v[], int n) {
for (int i = 0; i < n; i++) {
cin >> (v[i]);
}
}
inline void readl(long long int v[], int n) {
for (int i = 0; i < n; i++) {
cin >> (v[i]);
}
}
inline int add(int a, int b, int mod) {
a += b;
return a >= mod ? a - mod : a;
}
inline int sub(int a, int b, int mod) {
a -= b;
return a < 0 ? a + mod : a;
}
inline int mul(int a, int b, int mod) { return (long long int)a * b % mod; }
const int Inf = (int)2e9 + 5;
const long long int Lnf = (long long int)2e18 + 5;
const int N = 5e5 + 5;
const int NN = 1e6 + 5;
int solve() {
long long int n, k;
cin >> n >> k;
cout << 2 * k << endl;
return 0;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int test = 1;
cin >> test;
while (test--) solve();
return 0;
}
| ### Prompt
Please create a solution in CPP to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
vector<string> split(const string& s, char c) {
vector<string> v;
stringstream ss(s);
string x;
while (getline(ss, x, c)) v.emplace_back(x);
return move(v);
}
void err(vector<string>::iterator it) {}
template <typename T, typename... Args>
void err(vector<string>::iterator it, T a, Args... args) {
cout << it->substr((*it)[0] == ' ', it->length()) << " = " << a << " ";
err(++it, args...);
}
const int M = 1e9 + 7;
int length(string s) { return (int)s.size(); }
int length(long long x) {
int l = 0;
for (long long i = x; i; i /= 10) l++;
return l;
}
int dx[8] = {1, 0, -1, 0, -1, -1, 1, 1};
int dy[8] = {0, 1, 0, -1, -1, 1, -1, 1};
long long power(long long a, long long n) {
long long int res = 1;
while (n) {
if (n & 1) res = ((res % M) * (a % M)) % M;
a = ((a % M) * (a % M)) % M;
n >>= 1;
}
return res % M;
}
int tc = 1;
inline void read(std::vector<int>& v) {
for (int i = 0; i < (int)v.size(); i++) {
cin >> (v[i]);
}
}
inline void readl(std::vector<long long int>& v) {
for (int i = 0; i < (int)v.size(); i++) {
cin >> (v[i]);
}
}
template <class T>
bool remin(T& a, const T& b) {
return a > b ? a = b, 1 : 0;
}
template <class T>
bool remax(T& a, const T& b) {
return a < b ? a = b, 1 : 0;
}
inline void read(int v[], int n) {
for (int i = 0; i < n; i++) {
cin >> (v[i]);
}
}
inline void readl(long long int v[], int n) {
for (int i = 0; i < n; i++) {
cin >> (v[i]);
}
}
inline int add(int a, int b, int mod) {
a += b;
return a >= mod ? a - mod : a;
}
inline int sub(int a, int b, int mod) {
a -= b;
return a < 0 ? a + mod : a;
}
inline int mul(int a, int b, int mod) { return (long long int)a * b % mod; }
const int Inf = (int)2e9 + 5;
const long long int Lnf = (long long int)2e18 + 5;
const int N = 5e5 + 5;
const int NN = 1e6 + 5;
int solve() {
long long int n, k;
cin >> n >> k;
cout << 2 * k << endl;
return 0;
}
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
int test = 1;
cin >> test;
while (test--) solve();
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, x, t;
cin >> t;
while (t--) {
cin >> n >> x;
cout << x * 2 << endl;
}
}
| ### Prompt
Your task is to create a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, x, t;
cin >> t;
while (t--) {
cin >> n >> x;
cout << x * 2 << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
void solve() {
int n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
int main() {
int t;
cin >> t;
while (t--) {
solve();
}
return 0;
}
| ### Prompt
Please formulate a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
void solve() {
int n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
int main() {
int t;
cin >> t;
while (t--) {
solve();
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long t;
cin >> t;
while (t--) {
long long n, x;
cin >> n >> x;
cout << x * 2 << endl;
}
}
| ### Prompt
Please provide a cpp coded solution to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
long long t;
cin >> t;
while (t--) {
long long n, x;
cin >> n >> x;
cout << x * 2 << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
const int OO = 1e9;
const double EPS = 1e-9;
int T, n, x;
int main() {
ios::sync_with_stdio(false);
cout.precision(10);
cin.tie(0);
cin >> T;
for (int i = 0; i < T; ++i) {
cin >> n >> x;
cout << x * 2 << '\n';
}
return 0;
}
| ### Prompt
Please provide a cpp coded solution to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
const int OO = 1e9;
const double EPS = 1e-9;
int T, n, x;
int main() {
ios::sync_with_stdio(false);
cout.precision(10);
cin.tie(0);
cin >> T;
for (int i = 0; i < T; ++i) {
cin >> n >> x;
cout << x * 2 << '\n';
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int nQueries = 0;
cin >> nQueries;
for (int i = 0; i < nQueries; i++) {
int n, x;
cin >> n >> x;
cout << 2 * x << '\n';
}
return 0;
}
| ### Prompt
Your challenge is to write a Cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int nQueries = 0;
cin >> nQueries;
for (int i = 0; i < nQueries; i++) {
int n, x;
cin >> n >> x;
cout << 2 * x << '\n';
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, n, x;
cin >> t;
while (t--) {
cin >> n >> x;
cout << 2 * x << endl;
}
}
| ### Prompt
In cpp, your task is to solve the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int t, n, x;
cin >> t;
while (t--) {
cin >> n >> x;
cout << 2 * x << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
void inOut();
int main() {
long long int i, j, k, l, q, m, n;
string s;
cin >> q;
while (q--) {
cin >> n >> k;
cout << k * 2 << endl;
}
return 0;
}
void inOut() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
| ### Prompt
Your challenge is to write a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
void inOut();
int main() {
long long int i, j, k, l, q, m, n;
string s;
cin >> q;
while (q--) {
cin >> n >> k;
cout << k * 2 << endl;
}
return 0;
}
void inOut() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int t, k, n;
cin >> t;
while (t--) {
cin >> n >> k;
cout << 2 * k << endl;
}
}
| ### Prompt
Create a solution in CPP for the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
long long int t, k, n;
cin >> t;
while (t--) {
cin >> n >> k;
cout << 2 * k << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long t;
cin >> t;
while (t--) {
long long x, n;
cin >> x >> n;
cout << 2 * n << endl;
}
}
| ### Prompt
Create a solution in cpp for the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
long long t;
cin >> t;
while (t--) {
long long x, n;
cin >> x >> n;
cout << 2 * n << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, i, j;
cin >> n;
for (i = 0; i < n; i++) {
long long x, y;
cin >> x >> y;
cout << 2 * y << endl;
}
return 0;
}
| ### Prompt
In cpp, your task is to solve the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
long long n, i, j;
cin >> n;
for (i = 0; i < n; i++) {
long long x, y;
cin >> x >> y;
cout << 2 * y << endl;
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--) {
int n, x;
cin >> n >> x;
cout << 2 * x << '\n';
}
return 0;
}
| ### Prompt
Please provide a Cpp coded solution to the problem described below:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t;
cin >> t;
while (t--) {
int n, x;
cin >> n >> x;
cout << 2 * x << '\n';
}
return 0;
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int t, n, x, i;
cin >> t;
for (i = 0; i < t; i++) {
cin >> n >> x;
cout << 2 * x << "\n";
}
}
| ### Prompt
Please create a solution in CPP to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
long long int t, n, x, i;
cin >> t;
for (i = 0; i < t; i++) {
cin >> n >> x;
cout << 2 * x << "\n";
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
int main() {
int T;
cin >> T;
for (int i = 0; i < T; i++) {
long long int n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
}
| ### Prompt
Create a solution in cpp for the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
int main() {
int T;
cin >> T;
for (int i = 0; i < T; i++) {
long long int n, x;
cin >> n >> x;
cout << 2 * x << endl;
}
}
``` |
#include <bits/stdc++.h>
using namespace std;
vector<int> vi;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t, c = 0, i, j, p, x, y, osum, nsum = 0, m, v;
int n;
cin >> t;
while (t--) {
cin >> x >> y;
cout << y * 2 << endl;
}
return 0;
}
| ### Prompt
Your task is to create a cpp solution to the following problem:
You have a list of numbers from 1 to n written from left to right on the blackboard.
You perform an algorithm consisting of several steps (steps are 1-indexed). On the i-th step you wipe the i-th number (considering only remaining numbers). You wipe the whole number (not one digit).
<image>
When there are less than i numbers remaining, you stop your algorithm.
Now you wonder: what is the value of the x-th remaining number after the algorithm is stopped?
Input
The first line contains one integer T (1 β€ T β€ 100) β the number of queries. The next T lines contain queries β one per line. All queries are independent.
Each line contains two space-separated integers n and x (1 β€ x < n β€ 10^{9}) β the length of the list and the position we wonder about. It's guaranteed that after the algorithm ends, the list will still contain at least x numbers.
Output
Print T integers (one per query) β the values of the x-th number after performing the algorithm for the corresponding queries.
Example
Input
3
3 1
4 2
69 6
Output
2
4
12
### Response
```cpp
#include <bits/stdc++.h>
using namespace std;
vector<int> vi;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int t, c = 0, i, j, p, x, y, osum, nsum = 0, m, v;
int n;
cin >> t;
while (t--) {
cin >> x >> y;
cout << y * 2 << endl;
}
return 0;
}
``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.