output
stringlengths
52
181k
instruction
stringlengths
296
182k
#include<bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; int num = pow(2, m); cout << (n - m)*100*num + 1900*num*m << endl; }
### Prompt Please formulate a CPP solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; int num = pow(2, m); cout << (n - m)*100*num + 1900*num*m << endl; } ```
#include <bits/stdc++.h> //#include<con> using namespace std; int main(){ int n,m; cin>>n>>m; cout<<(1900*m+100*(n-m))*(pow(2,m))<<endl; }
### Prompt Please create a solution in Cpp to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> //#include<con> using namespace std; int main(){ int n,m; cin>>n>>m; cout<<(1900*m+100*(n-m))*(pow(2,m))<<endl; } ```
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin>>N>>M; cout<<pow(2,M)*(100*(N-M)+1900*M)<<endl; }
### Prompt Develop a solution in CPP to the problem described below: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int N,M; cin>>N>>M; cout<<pow(2,M)*(100*(N-M)+1900*M)<<endl; } ```
#include<bits//stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; cout << (1900 * m + 100 * (n - m)) * pow(2, m) << endl; }
### Prompt Please provide a Cpp coded solution to the problem described below: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits//stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; cout << (1900 * m + 100 * (n - m)) * pow(2, m) << endl; } ```
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; cout << (1900 * m + (n-m)* 100) * pow(2,m) << endl; }
### Prompt Your challenge is to write a cpp solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; cout << (1900 * m + (n-m)* 100) * pow(2,m) << endl; } ```
#include <iostream> #include <cmath> using namespace std; int main(){ int n,m,x=0; cin>>n>>m; x+=(1900*m+(n-m)*100)*pow(2.0,m); cout<<x<<endl; return 0; }
### Prompt Please provide a Cpp coded solution to the problem described below: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <iostream> #include <cmath> using namespace std; int main(){ int n,m,x=0; cin>>n>>m; x+=(1900*m+(n-m)*100)*pow(2.0,m); cout<<x<<endl; return 0; } ```
#include<iostream> #include<math.h> using namespace std; int main(){ int N,M; cin>>N>>M; cout<<(((N-M)*100)+(M*1900))*pow(2,M)<<endl; }
### Prompt Please create a solution in Cpp to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<iostream> #include<math.h> using namespace std; int main(){ int N,M; cin>>N>>M; cout<<(((N-M)*100)+(M*1900))*pow(2,M)<<endl; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int sum = 1900*m+100*(n-m); while (m--) sum *= 2; cout << sum << endl; }
### Prompt Create a solution in cpp for the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; int sum = 1900*m+100*(n-m); while (m--) sum *= 2; cout << sum << endl; } ```
#include<stdio.h> int main(){ int n,m,i,a=1; scanf("%d %d\n",&n,&m); for(i=0;i<m;i++){ a=a*2; } printf("%d\n",1900*m*a+100*(n-m)*a); return 0; }
### Prompt In Cpp, your task is to solve the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<stdio.h> int main(){ int n,m,i,a=1; scanf("%d %d\n",&n,&m); for(i=0;i<m;i++){ a=a*2; } printf("%d\n",1900*m*a+100*(n-m)*a); return 0; } ```
#include <iostream> using namespace std; int main(){ int n,s;cin>>n>>s; int q = 1; for(int i = 0; s > i; i++)q*=2; cout << ((n-s)*100+s*1900)*q << endl; }
### Prompt Please provide a cpp coded solution to the problem described below: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <iostream> using namespace std; int main(){ int n,s;cin>>n>>s; int q = 1; for(int i = 0; s > i; i++)q*=2; cout << ((n-s)*100+s*1900)*q << endl; } ```
#include<stdio.h> int main(){int n,m;scanf("%d%d",&n,&m);printf("%d\n",100*((18*m+n)<<m));}
### Prompt Construct a CPP code solution to the problem outlined: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<stdio.h> int main(){int n,m;scanf("%d%d",&n,&m);printf("%d\n",100*((18*m+n)<<m));} ```
#include <bits/stdc++.h> using namespace std; int main() { long n,m; cin >> n >> m; cout << (m*1800+n*100)*pow(2,m) << endl; }
### Prompt Please provide a cpp coded solution to the problem described below: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long n,m; cin >> n >> m; cout << (m*1800+n*100)*pow(2,m) << endl; } ```
#include<bits/stdc++.h> using namespace std; int n,m; int main(){ cin>>n>>m; cout<<(1900*m+100*(n-m))*(pow(2,m))<<endl; return 0; }
### Prompt Your task is to create a cpp solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int n,m; int main(){ cin>>n>>m; cout<<(1900*m+100*(n-m))*(pow(2,m))<<endl; return 0; } ```
#include <iostream> #include <cmath> using namespace std; int main(){ int n,m; cin >> n >> m; cout << pow(2,m)*(1900*m+100*(n-m)) << endl; }
### Prompt Generate a Cpp solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <iostream> #include <cmath> using namespace std; int main(){ int n,m; cin >> n >> m; cout << pow(2,m)*(1900*m+100*(n-m)) << endl; } ```
#include <iostream> using namespace std; int main() { int n, m, ans; cin >> n >> m; ans = (100 * (n - m) + 1900 * m) << m; cout << ans << endl; return 0; }
### Prompt Your challenge is to write a CPP solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <iostream> using namespace std; int main() { int n, m, ans; cin >> n >> m; ans = (100 * (n - m) + 1900 * m) << m; cout << ans << endl; return 0; } ```
#include<bits/stdc++.h> #define ll long long using namespace std; int main() { ll n,m; cin>>n>>m; cout<<(1900LL*m+100LL*(n-m))*powl(2, m)<<endl; }
### Prompt Create a solution in CPP for the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> #define ll long long using namespace std; int main() { ll n,m; cin>>n>>m; cout<<(1900LL*m+100LL*(n-m))*powl(2, m)<<endl; } ```
#include"iostream" using namespace std; int main() { int n,m;cin>>n>>m; int ans=1900*m+100*(n-m);ans*=(1<<m); cout<<ans; }
### Prompt Create a solution in cpp for the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include"iostream" using namespace std; int main() { int n,m;cin>>n>>m; int ans=1900*m+100*(n-m);ans*=(1<<m); cout<<ans; } ```
#include <bits/stdc++.h> int main(){ int N,M; std::cin>>N>>M; int m=1<<M; std::cout<<100*m*(N+18*M); }
### Prompt Generate a cpp solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> int main(){ int N,M; std::cin>>N>>M; int m=1<<M; std::cout<<100*m*(N+18*M); } ```
#include <iostream> int n, m;int main(){std::cin>>n>>m;std::cout<<((n+18*m)<<m)*100;return 0;}
### Prompt Create a solution in CPP for the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <iostream> int n, m;int main(){std::cin>>n>>m;std::cout<<((n+18*m)<<m)*100;return 0;} ```
#include <bits/stdc++.h> using namespace std; int main(){ int N,M; cin>>N>>M; cout<<(1900*M+100*(N-M))*pow(2,M)<<endl; }
### Prompt Create a solution in Cpp for the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main(){ int N,M; cin>>N>>M; cout<<(1900*M+100*(N-M))*pow(2,M)<<endl; } ```
#include <bits/stdc++.h> using namespace std; int n,m; int main(){ cin >> n >> m; cout << (1<<m)*(m*1900+(n-m)*100) << endl; return 0; }
### Prompt Your task is to create a cpp solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int n,m; int main(){ cin >> n >> m; cout << (1<<m)*(m*1900+(n-m)*100) << endl; return 0; } ```
#include <iostream> #include <math.h> using namespace std; int main() { int N,M;cin >> N >> M;cout << pow(2,M)*(M*1900+(N-M)*100) << endl;return 0; }
### Prompt Create a solution in CPP for the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <iostream> #include <math.h> using namespace std; int main() { int N,M;cin >> N >> M;cout << pow(2,M)*(M*1900+(N-M)*100) << endl;return 0; } ```
#include<iostream> #include<cmath> using namespace std; int main() { int n,m; cin>>n>>m; cout<<(1900*m+100*(n-m))*pow(2,m); return 0; }
### Prompt Create a solution in Cpp for the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<iostream> #include<cmath> using namespace std; int main() { int n,m; cin>>n>>m; cout<<(1900*m+100*(n-m))*pow(2,m); return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; cout << (1 << M) * (M * 1900 + (N - M) * 100) << endl; }
### Prompt Generate a cpp solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; cout << (1 << M) * (M * 1900 + (N - M) * 100) << endl; } ```
#include<iostream> #include<cmath> using namespace std; int main(){ int a,b; cin >> a >> b; cout << (int)((a-b)+19*b)*100*pow(2,b) << endl; }
### Prompt Generate a Cpp solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<iostream> #include<cmath> using namespace std; int main(){ int a,b; cin >> a >> b; cout << (int)((a-b)+19*b)*100*pow(2,b) << endl; } ```
#include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin>>N>>M; int ans=pow(2,M)*(100*N+1800*M); cout<<ans<<endl; }
### Prompt In cpp, your task is to solve the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main(){ int N,M; cin>>N>>M; int ans=pow(2,M)*(100*N+1800*M); cout<<ans<<endl; } ```
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >>N >>M; long S=1900*M+100*(N-M); S *= pow(2, M); cout <<S <<endl; return 0; };
### Prompt Generate a CPP solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >>N >>M; long S=1900*M+100*(N-M); S *= pow(2, M); cout <<S <<endl; return 0; }; ```
#include<bits/stdc++.h> using namespace std; int main(){ int n,m,i,ans; cin>>n>>m; ans=100*n+1800*m; for(i=0;i<m;i++) ans*=2; cout<<ans<<endl; }
### Prompt Please formulate a CPP solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main(){ int n,m,i,ans; cin>>n>>m; ans=100*n+1800*m; for(i=0;i<m;i++) ans*=2; cout<<ans<<endl; } ```
#include <iostream> using namespace std; int main() { int N, M; cin >> N >> M; cout << (100*N+1800*M)*(1<<M) << endl; }
### Prompt Your challenge is to write a cpp solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <iostream> using namespace std; int main() { int N, M; cin >> N >> M; cout << (100*N+1800*M)*(1<<M) << endl; } ```
#include <iostream> #include <cmath> using namespace std; int main(){ int N,M; cin>>N>>M; cout<<((N-M)*100+M*1900)*pow(2,M)<<endl; return 0; }
### Prompt Please create a solution in CPP to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <iostream> #include <cmath> using namespace std; int main(){ int N,M; cin>>N>>M; cout<<((N-M)*100+M*1900)*pow(2,M)<<endl; return 0; } ```
#include <iostream> using namespace std; int main(){ int N,M; cin>>N>>M; //基礎タイム int t=M*1800+N*100; //期待値はNの数だけ倍々 for(int i=1;i<=M;i++){t=t*2;} cout<<t; }
### Prompt In cpp, your task is to solve the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <iostream> using namespace std; int main(){ int N,M; cin>>N>>M; //基礎タイム int t=M*1800+N*100; //期待値はNの数だけ倍々 for(int i=1;i<=M;i++){t=t*2;} cout<<t; } ```
#include<bits/stdc++.h> using namespace std; int main() { int n,m; cin>>n>>m; cout<<(1900*m+100*(n-m))*(pow(2,m))<<endl; return 0; }
### Prompt Please provide a cpp coded solution to the problem described below: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main() { int n,m; cin>>n>>m; cout<<(1900*m+100*(n-m))*(pow(2,m))<<endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int N,M; cin>>N>>M; int kaz=pow(2,M); cout<<(M*1900+100*(N-M))*kaz<<endl; }
### Prompt Your challenge is to write a Cpp solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int N,M; cin>>N>>M; int kaz=pow(2,M); cout<<(M*1900+100*(N-M))*kaz<<endl; } ```
#include <bits/stdc++.h> using namespace std; int main(){ int64_t N,M; cin>>N>>M; cout<<(100*N+1800*M)*pow(2,M)<<endl; }
### Prompt Construct a cpp code solution to the problem outlined: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main(){ int64_t N,M; cin>>N>>M; cout<<(100*N+1800*M)*pow(2,M)<<endl; } ```
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; cout << (1900 * M + 100* (N-M)) * (1 << M) << endl; }
### Prompt Please provide a Cpp coded solution to the problem described below: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; cout << (1900 * M + 100* (N-M)) * (1 << M) << endl; } ```
#include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; cout<<((a-b)*100+1900*b)*pow(2,b); }
### Prompt Please provide a cpp coded solution to the problem described below: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main(){ int a,b; cin>>a>>b; cout<<((a-b)*100+1900*b)*pow(2,b); } ```
#include<iostream> int main(){int N,M;std::cin>>N>>M;std::cout<<100*(1<<M)*(N+18*M);}
### Prompt Create a solution in CPP for the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<iostream> int main(){int N,M;std::cin>>N>>M;std::cout<<100*(1<<M)*(N+18*M);} ```
#include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; cout << (1900 * M + 100 * (N - M)) * (1 << M) << endl; return 0; }
### Prompt Generate a cpp solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int N, M; cin >> N >> M; cout << (1900 * M + 100 * (N - M)) * (1 << M) << endl; return 0; } ```
#include<iostream> #include<cmath> using namespace std; int main(){ int n, m; cin>>n>>m; cout<<((n-m)*100+1900*m)*pow(2, m)<<endl; return 0; }
### Prompt Please create a solution in CPP to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<iostream> #include<cmath> using namespace std; int main(){ int n, m; cin>>n>>m; cout<<((n-m)*100+1900*m)*pow(2, m)<<endl; return 0; } ```
#include <iostream> #include <cmath> int n,m; int main(void){ std::cin>>n>>m; std::cout<<(1900*m+100*(n-m))*(std::pow(2,m))<<std::endl; }
### Prompt Your challenge is to write a cpp solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <iostream> #include <cmath> int n,m; int main(void){ std::cin>>n>>m; std::cout<<(1900*m+100*(n-m))*(std::pow(2,m))<<std::endl; } ```
#include <bits/stdc++.h> using namespace std; int main(){ long long n, m; cin >> n >> m; cout << ((1900 * m + 100 * (n - m))<<m) << endl; return 0; }
### Prompt In CPP, your task is to solve the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main(){ long long n, m; cin >> n >> m; cout << ((1900 * m + 100 * (n - m))<<m) << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; int main(void){ int n,m; cin>>n>>m; cout<<(1900*m+100*(n-m))*pow(2,m)<<endl; }
### Prompt Please provide a CPP coded solution to the problem described below: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main(void){ int n,m; cin>>n>>m; cout<<(1900*m+100*(n-m))*pow(2,m)<<endl; } ```
#include<bits/stdc++.h> using namespace std; #define ll long long int int main(){ ll n,m; cin >> n >> m; cout << (1900*m+100*(n-m))*pow(2,m) << endl; }
### Prompt Please create a solution in CPP to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> using namespace std; #define ll long long int int main(){ ll n,m; cin >> n >> m; cout << (1900*m+100*(n-m))*pow(2,m) << endl; } ```
#include <bits/stdc++.h> using namespace std; int main(){ double n, m; cin >> n >> m; cout << (int)pow(2, m)*(100*n+1800*m) << '\n'; return 0; }
### Prompt Create a solution in CPP for the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main(){ double n, m; cin >> n >> m; cout << (int)pow(2, m)*(100*n+1800*m) << '\n'; return 0; } ```
#include<bits/stdc++.h> using namespace std; int n, m; int main(){ cin >> n >> m; cout << (1900*m+100*(n-m))*pow(2,m) << endl; }
### Prompt Please create a solution in Cpp to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int n, m; int main(){ cin >> n >> m; cout << (1900*m+100*(n-m))*pow(2,m) << endl; } ```
#include<bits/stdc++.h> using namespace std; int a,b; int main() { cin>>a>>b; cout<<(b*1900+(a-b)*100)*pow(2,b)<<endl; }
### Prompt In Cpp, your task is to solve the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int a,b; int main() { cin>>a>>b; cout<<(b*1900+(a-b)*100)*pow(2,b)<<endl; } ```
#include <iostream> #include <cmath> int main(){int n,m;std::cin>>n>>m;printf("%.f\n",100*(18*m+n)*pow(2,m));}
### Prompt Please provide a cpp coded solution to the problem described below: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <iostream> #include <cmath> int main(){int n,m;std::cin>>n>>m;printf("%.f\n",100*(18*m+n)*pow(2,m));} ```
#include <bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; cout << pow(2, m) * (1900*m + 100*(n-m)) << endl; return 0; }
### Prompt Create a solution in Cpp for the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main(){ int n, m; cin >> n >> m; cout << pow(2, m) * (1900*m + 100*(n-m)) << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n,m; cin >> n >> m; cout << (1900*m + 100*(n-m)) * pow(2,m); }
### Prompt Construct a cpp code solution to the problem outlined: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; typedef long long ll; int main() { int n,m; cin >> n >> m; cout << (1900*m + 100*(n-m)) * pow(2,m); } ```
#include <bits/stdc++.h> using namespace std; int main() { int n,m; cin>>n>>m; int a=1900*m+100*(n-m); int p=pow(2,m); int ans=a*p; cout<<ans<<endl; }
### Prompt Construct a cpp code solution to the problem outlined: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n,m; cin>>n>>m; int a=1900*m+100*(n-m); int p=pow(2,m); int ans=a*p; cout<<ans<<endl; } ```
#include<bits/stdc++.h> using namespace std; int main(){int N,M;cin>>N>>M;cout<<pow(2,M)*(1900*M+(N-M)*100)<<endl;}
### Prompt Create a solution in cpp for the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main(){int N,M;cin>>N>>M;cout<<pow(2,M)*(1900*M+(N-M)*100)<<endl;} ```
#include<stdio.h> #include<math.h> int main(){ int n,m; int tn,tm,ts,x; tn=100; tm=1900; scanf("%d %d",&n,&m); ts=1900*m+100*(n-m); x=ts*pow(2,m); printf("%d\n",x); }
### Prompt Please formulate a cpp solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<stdio.h> #include<math.h> int main(){ int n,m; int tn,tm,ts,x; tn=100; tm=1900; scanf("%d %d",&n,&m); ts=1900*m+100*(n-m); x=ts*pow(2,m); printf("%d\n",x); } ```
#include <bits/stdc++.h> using namespace std; int main() { int n,m; cin>>n>>m; cout<<(1900*m+100*(n-m))*(pow(2,m))<<endl; //c++自带的幂函数 return 0; }
### Prompt Construct a CPP code solution to the problem outlined: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n,m; cin>>n>>m; cout<<(1900*m+100*(n-m))*(pow(2,m))<<endl; //c++自带的幂函数 return 0; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n,m,ans; cin>>n>>m; ans = pow(2,m) * (1800*m + 100*n); cout<<ans<<endl; }
### Prompt Create a solution in Cpp for the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n,m,ans; cin>>n>>m; ans = pow(2,m) * (1800*m + 100*n); cout<<ans<<endl; } ```
#include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; cout << (n*100 + m*1800)*(1 << m) << endl; return 0; }
### Prompt Create a solution in cpp for the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { int n, m; cin >> n >> m; cout << (n*100 + m*1800)*(1 << m) << endl; return 0; } ```
#include<bits/stdc++.h> #define int long long using namespace std; signed main(){ int n,m; cin>>n>>m; cout<<pow(2,m)*((n-m)*100+m*1900)<<endl; }
### Prompt Your task is to create a cpp solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> #define int long long using namespace std; signed main(){ int n,m; cin>>n>>m; cout<<pow(2,m)*((n-m)*100+m*1900)<<endl; } ```
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin>>n>>m; cout<<(1900*m+(n-m)*100)*pow(2,m); }
### Prompt In CPP, your task is to solve the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin>>n>>m; cout<<(1900*m+(n-m)*100)*pow(2,m); } ```
#include <bits/stdc++.h> using namespace std; int main(){ int n,m; scanf("%d %d",&n,&m); cout<<(1900*m+100*(n-m))*(pow(2,m)); return 0; }
### Prompt In cpp, your task is to solve the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main(){ int n,m; scanf("%d %d",&n,&m); cout<<(1900*m+100*(n-m))*(pow(2,m)); return 0; } ```
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin>>n>>m; cout<<100*((18*m+n)<<m)<<"\n"; return 0; }
### Prompt Create a solution in cpp for the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin>>n>>m; cout<<100*((18*m+n)<<m)<<"\n"; return 0; } ```
#include<iostream> #include<math.h> using namespace std; int main() { int n,m,k,s; cin>>n>>m; k=(n-m)*100+m*1900; s=k*pow(2,m); cout<<s; }
### Prompt Please formulate a Cpp solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<iostream> #include<math.h> using namespace std; int main() { int n,m,k,s; cin>>n>>m; k=(n-m)*100+m*1900; s=k*pow(2,m); cout<<s; } ```
#include<bits/stdc++.h> using namespace std; int main(){ int N, M; cin >> N >> M; cout << (100*(N-M)+1900*M)*(int)pow(2,M) << endl; return 0; }
### Prompt Construct a cpp code solution to the problem outlined: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main(){ int N, M; cin >> N >> M; cout << (100*(N-M)+1900*M)*(int)pow(2,M) << endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int(i)=0;i<(n);i++) int main(){ int n,m;cin>>n>>m; cout<<(1900*m+100*(n-m))*pow(2,m); }
### Prompt Your task is to create a cpp solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; #define REP(i,n) for(int(i)=0;i<(n);i++) int main(){ int n,m;cin>>n>>m; cout<<(1900*m+100*(n-m))*pow(2,m); } ```
#include <bits/stdc++.h> using namespace std; int main(){ int n,m; cin>>n>>m; double p=1/pow(2,m); cout<<(1900*m+100*(n-m))/p<<endl; }
### Prompt Your task is to create a CPP solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main(){ int n,m; cin>>n>>m; double p=1/pow(2,m); cout<<(1900*m+100*(n-m))/p<<endl; } ```
#include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; cout << 100*pow(2,m)*(n+18*m) << endl; }
### Prompt Develop a solution in cpp to the problem described below: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; cout << 100*pow(2,m)*(n+18*m) << endl; } ```
#include <bits/stdc++.h> using namespace std; int main(void) { int n, m; cin >> n >> m; cout << ((n - m) * 100 + m * 1900) * pow(2, m) << endl; return 0; }
### Prompt Your challenge is to write a CPP solution to the following problem: Takahashi is now competing in a programming contest, but he received TLE in a problem where the answer is `YES` or `NO`. When he checked the detailed status of the submission, there were N test cases in the problem, and the code received TLE in M of those cases. Then, he rewrote the code to correctly solve each of those M cases with 1/2 probability in 1900 milliseconds, and correctly solve each of the other N-M cases without fail in 100 milliseconds. Now, he goes through the following process: * Submit the code. * Wait until the code finishes execution on all the cases. * If the code fails to correctly solve some of the M cases, submit it again. * Repeat until the code correctly solve all the cases in one submission. Let the expected value of the total execution time of the code be X milliseconds. Print X (as an integer). Constraints * All input values are integers. * 1 \leq N \leq 100 * 1 \leq M \leq {\rm min}(N, 5) Input Input is given from Standard Input in the following format: N M Output Print X, the expected value of the total execution time of the code, as an integer. It can be proved that, under the constraints in this problem, X is an integer not exceeding 10^9. Examples Input 1 1 Output 3800 Input 10 2 Output 18400 Input 100 5 Output 608000 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main(void) { int n, m; cin >> n >> m; cout << ((n - m) * 100 + m * 1900) * pow(2, m) << endl; return 0; } ```
#include<cstdio> int main(){ int n,a,b; scanf("%d%d%d",&n,&a,&b); if(a>b||(n==1&&a!=b))printf("0\n"); else if(a==b)printf("1\n"); else printf("%lld\n",(1ll*b*(n-1)+a)-(1ll*a*(n-1)+b)+1); return 0; }
### Prompt Your challenge is to write a Cpp solution to the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<cstdio> int main(){ int n,a,b; scanf("%d%d%d",&n,&a,&b); if(a>b||(n==1&&a!=b))printf("0\n"); else if(a==b)printf("1\n"); else printf("%lld\n",(1ll*b*(n-1)+a)-(1ll*a*(n-1)+b)+1); return 0; } ```
#include <iostream> using namespace std; long long n,a,b; int main() { cin>>n>>a>>b; if(a>b||(n==1&&a!=b)) cout<<0; else cout<<1LL*(n-2)*b-1LL*(n-2)*a+1; return 0; }
### Prompt Develop a solution in cpp to the problem described below: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include <iostream> using namespace std; long long n,a,b; int main() { cin>>n>>a>>b; if(a>b||(n==1&&a!=b)) cout<<0; else cout<<1LL*(n-2)*b-1LL*(n-2)*a+1; return 0; } ```
#include <iostream> #include <stdio.h> using namespace std; typedef long long LL; int main () { LL n,a,b; cin >> n >>a >>b; cout << max(0LL,(b-a)*(n-2)+1)<<endl; }
### Prompt Please provide a CPP coded solution to the problem described below: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include <iostream> #include <stdio.h> using namespace std; typedef long long LL; int main () { LL n,a,b; cin >> n >>a >>b; cout << max(0LL,(b-a)*(n-2)+1)<<endl; } ```
#include<bits/stdc++.h> using namespace std; int main(){ long long n,a,b; cin>>n>>a>>b; (a>b||n==1)?cout<<(a==b)<<endl:cout<<(n-2)*(b-a)+1<<endl; return 0; // TAT }
### Prompt Generate a cpp solution to the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main(){ long long n,a,b; cin>>n>>a>>b; (a>b||n==1)?cout<<(a==b)<<endl:cout<<(n-2)*(b-a)+1<<endl; return 0; // TAT } ```
#include<bits/stdc++.h> using namespace std; #define int long long int n,a,b; signed main(){ scanf("%lld%lld%lld",&n,&a,&b); if (a>b||(a!=b&&n==1)){ puts("0"); return 0; } printf("%lld\n",(n-2)*(b-a)+1); }
### Prompt Your task is to create a cpp solution to the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<bits/stdc++.h> using namespace std; #define int long long int n,a,b; signed main(){ scanf("%lld%lld%lld",&n,&a,&b); if (a>b||(a!=b&&n==1)){ puts("0"); return 0; } printf("%lld\n",(n-2)*(b-a)+1); } ```
#include <bits/stdc++.h> using namespace std; int main(){ long long n,a,b; cin >> n >> a >> b; long long m = a * (n-1) + b; long long M = b * (n-1) + a; cout << max((M-m+1), 0ll) << endl; return 0; }
### Prompt Your task is to create a cpp solution to the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main(){ long long n,a,b; cin >> n >> a >> b; long long m = a * (n-1) + b; long long M = b * (n-1) + a; cout << max((M-m+1), 0ll) << endl; return 0; } ```
#include<iostream> #include<cmath> using namespace std; int main(){ long long n,a,b,m,M; cin >> n >> a >> b; m = a*(n-1)+b; M = b*(n-1)+a; if((M-m+1)>=0) cout << M-m+1 << endl; else cout << 0 << endl; }
### Prompt Create a solution in Cpp for the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<iostream> #include<cmath> using namespace std; int main(){ long long n,a,b,m,M; cin >> n >> a >> b; m = a*(n-1)+b; M = b*(n-1)+a; if((M-m+1)>=0) cout << M-m+1 << endl; else cout << 0 << endl; } ```
#include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n, a, b; cin >> n >> a >> b; ll ans = max((b-a)*(n-2) + 1, 0ll); cout << ans << endl; }
### Prompt Create a solution in Cpp for the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include <bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll n, a, b; cin >> n >> a >> b; ll ans = max((b-a)*(n-2) + 1, 0ll); cout << ans << endl; } ```
#include<iostream> using namespace std; int main() { long long sum=0,n,a,b; cin>>n>>a>>b; if(n>1&&b>=a||n==1&&a==b) cout<<(n-2)*(b-a)+1<<endl; else cout<<0<<endl; }
### Prompt Generate a CPP solution to the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<iostream> using namespace std; int main() { long long sum=0,n,a,b; cin>>n>>a>>b; if(n>1&&b>=a||n==1&&a==b) cout<<(n-2)*(b-a)+1<<endl; else cout<<0<<endl; } ```
#include<bits/stdc++.h> using namespace std; long long n,a,b; int main() { cin>>n>>a>>b; if(n>1&&b>=a||n==1&&a==b)cout<<(n-2)*(b-a)+1; else cout<<"0"; cout<<endl; }
### Prompt Please create a solution in Cpp to the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<bits/stdc++.h> using namespace std; long long n,a,b; int main() { cin>>n>>a>>b; if(n>1&&b>=a||n==1&&a==b)cout<<(n-2)*(b-a)+1; else cout<<"0"; cout<<endl; } ```
#include <bits/stdc++.h> using namespace std; int main() { long long n,a,b,max,min; cin>>n>>a>>b; max=a+(n-1)*b; min=(n-1)*a+b; cout<<(max<min?0:(max-min+1))<<endl; return 0; }
### Prompt Your challenge is to write a cpp solution to the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main() { long long n,a,b,max,min; cin>>n>>a>>b; max=a+(n-1)*b; min=(n-1)*a+b; cout<<(max<min?0:(max-min+1))<<endl; return 0; } ```
#include<bits/stdc++.h> using namespace std; int main(){ long long int n,a,b; cin>>n>>a>>b; if(a>b || (n==1 && a!=b)){ cout<<"0\n"; } else{ long long int x=(n-2)*(b-a); cout << ++x <<"\n"; } }
### Prompt Create a solution in CPP for the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main(){ long long int n,a,b; cin>>n>>a>>b; if(a>b || (n==1 && a!=b)){ cout<<"0\n"; } else{ long long int x=(n-2)*(b-a); cout << ++x <<"\n"; } } ```
#include <bits/stdc++.h> using namespace std; int main(){ long long n, a, b; cin >> n >> a >> b; long long ans = max((long long)0, b*(n-2) - a*(n-2) + 1); cout << ans << endl; }
### Prompt Your task is to create a CPP solution to the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include <bits/stdc++.h> using namespace std; int main(){ long long n, a, b; cin >> n >> a >> b; long long ans = max((long long)0, b*(n-2) - a*(n-2) + 1); cout << ans << endl; } ```
#include<bits/stdc++.h> using namespace std; int N, A, B; int main() { scanf("%d %d %d", &N, &A, &B); cout << max(0LL, 1LL * (N - 1) * B + A - 1LL * (N - 1) * A - B + 1); }
### Prompt Develop a solution in cpp to the problem described below: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int N, A, B; int main() { scanf("%d %d %d", &N, &A, &B); cout << max(0LL, 1LL * (N - 1) * B + A - 1LL * (N - 1) * A - B + 1); } ```
#include<iostream> using namespace std; int main(){ long long n , a , b; cin >> n >> a >> b; if((a > b)||(n==1 && a!=b)){ cout<<0<<endl; } else{ cout<<(b-a)*(n-2) + 1 <<endl; } }
### Prompt Create a solution in Cpp for the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<iostream> using namespace std; int main(){ long long n , a , b; cin >> n >> a >> b; if((a > b)||(n==1 && a!=b)){ cout<<0<<endl; } else{ cout<<(b-a)*(n-2) + 1 <<endl; } } ```
#include <bits/stdc++.h> using namespace std; #define ll long long int main(){ ll n,a,b; scanf("%lld%lld%lld",&n,&a,&b); ll ans =1+(n-2)*(b-a); if(ans<=0)ans=0; printf("%lld\n",ans); }
### Prompt Construct a Cpp code solution to the problem outlined: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include <bits/stdc++.h> using namespace std; #define ll long long int main(){ ll n,a,b; scanf("%lld%lld%lld",&n,&a,&b); ll ans =1+(n-2)*(b-a); if(ans<=0)ans=0; printf("%lld\n",ans); } ```
#include<bits/stdc++.h> using namespace std; long long n,a,b; int main (){ cin>>n>>a>>b; if(n>1&&b>=a||n==1&&a==b){ cout<<(b-a)*(n-2)+1<<endl; } else{ cout<<0<<endl; } return 0; }
### Prompt In cpp, your task is to solve the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<bits/stdc++.h> using namespace std; long long n,a,b; int main (){ cin>>n>>a>>b; if(n>1&&b>=a||n==1&&a==b){ cout<<(b-a)*(n-2)+1<<endl; } else{ cout<<0<<endl; } return 0; } ```
#include <iostream> int main() { long long n, a, b; std::cin >> n >> a >> b; std::cout << std::max((n-2)*(b-a)+1,0ll); }
### Prompt Generate a Cpp solution to the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include <iostream> int main() { long long n, a, b; std::cin >> n >> a >> b; std::cout << std::max((n-2)*(b-a)+1,0ll); } ```
#include<bits/stdc++.h> using namespace std; int main() { long long n; cin>>n; long long a,b; cin>>a>>b; if(n>1&&b>=a||n==1&&a==b) cout<<(n-2)*(b-a)+1<<endl; else cout<<"0"<<endl; return 0; }
### Prompt Construct a Cpp code solution to the problem outlined: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main() { long long n; cin>>n; long long a,b; cin>>a>>b; if(n>1&&b>=a||n==1&&a==b) cout<<(n-2)*(b-a)+1<<endl; else cout<<"0"<<endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; long long int n, a, b; int main() { cin >> n >> a >> b; a *= (n - 2); b *= (n - 2); b - a < -1 ? cout << 0 : cout << b - a + 1; return 0; }
### Prompt Generate a CPP solution to the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include <bits/stdc++.h> using namespace std; long long int n, a, b; int main() { cin >> n >> a >> b; a *= (n - 2); b *= (n - 2); b - a < -1 ? cout << 0 : cout << b - a + 1; return 0; } ```
#include<bits/stdc++.h> using namespace std; int main(){ long long N,A,B; cin >> N >> A >> B; long long count = 0; for(long long i = (N-2)*A; i <= (N-2)*B; i++){ count++; } cout << count <<endl; }
### Prompt Develop a solution in cpp to the problem described below: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main(){ long long N,A,B; cin >> N >> A >> B; long long count = 0; for(long long i = (N-2)*A; i <= (N-2)*B; i++){ count++; } cout << count <<endl; } ```
#include <iostream> #include <algorithm> using namespace std; int main() { long long int N, A, B; cin >> N >> A >> B; cout << max((N - 2) * (B - A) + 1, 0ll) << endl; return 0; }
### Prompt Develop a solution in Cpp to the problem described below: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include <iostream> #include <algorithm> using namespace std; int main() { long long int N, A, B; cin >> N >> A >> B; cout << max((N - 2) * (B - A) + 1, 0ll) << endl; return 0; } ```
#include<iostream> using namespace std; long N,A,B; int main() { cin>>N>>A>>B; if(N==1&&A!=B||A>B)cout<<0<<endl; else cout<<(N-1)*B+A-(N-1)*A-B+1<<endl; }
### Prompt Create a solution in cpp for the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<iostream> using namespace std; long N,A,B; int main() { cin>>N>>A>>B; if(N==1&&A!=B||A>B)cout<<0<<endl; else cout<<(N-1)*B+A-(N-1)*A-B+1<<endl; } ```
#include <bits/stdc++.h> using namespace std; #define int long long signed main() { int N,A,B; cin >> N >> A >> B; cout << max((B*(N-1)+A)-(A*(N-1)+B)+1,0LL) << endl; }
### Prompt Your challenge is to write a Cpp solution to the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include <bits/stdc++.h> using namespace std; #define int long long signed main() { int N,A,B; cin >> N >> A >> B; cout << max((B*(N-1)+A)-(A*(N-1)+B)+1,0LL) << endl; } ```
#include<cstdio> using namespace std; int main() { int n,A,B; scanf("%d%d%d",&n,&A,&B); if (n==1) printf("%d\n",A==B); else printf("%lld\n",1ll*(A<=B)*(n-2)*(B-A)+(A<=B)); }
### Prompt In Cpp, your task is to solve the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<cstdio> using namespace std; int main() { int n,A,B; scanf("%d%d%d",&n,&A,&B); if (n==1) printf("%d\n",A==B); else printf("%lld\n",1ll*(A<=B)*(n-2)*(B-A)+(A<=B)); } ```
#include <bits/stdc++.h> using namespace std; #define ll long long int main(){ ll N,A,B; cin>>N>>A>>B; ll ans=0; if((N==1&&A==B)||(N>1&&A<=B)) ans=(N-2)*(B-A)+1; cout<<ans<<endl; }
### Prompt Generate a Cpp solution to the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include <bits/stdc++.h> using namespace std; #define ll long long int main(){ ll N,A,B; cin>>N>>A>>B; ll ans=0; if((N==1&&A==B)||(N>1&&A<=B)) ans=(N-2)*(B-A)+1; cout<<ans<<endl; } ```
#include<bits/stdc++.h> using namespace std; long long n,a,b; int main() { cin>>n>>a>>b; if(a>b) cout<<0<<endl; else if(n==1&&a!=b) cout<<0<<endl; else cout<<(n-2)*(b-a)+1<<endl; return 0; }
### Prompt Create a solution in Cpp for the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<bits/stdc++.h> using namespace std; long long n,a,b; int main() { cin>>n>>a>>b; if(a>b) cout<<0<<endl; else if(n==1&&a!=b) cout<<0<<endl; else cout<<(n-2)*(b-a)+1<<endl; return 0; } ```
#include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n, a, b; cin >> n >> a >> b; ll ans = (a+b*(n-1)) - (a*(n-1)+b) + 1; cout << max(ans, 0LL) << endl; }
### Prompt Create a solution in CPP for the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include <bits/stdc++.h> using namespace std; using ll = long long; int main() { ll n, a, b; cin >> n >> a >> b; ll ans = (a+b*(n-1)) - (a*(n-1)+b) + 1; cout << max(ans, 0LL) << endl; } ```
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll N, A, B; cin >> N >> A >> B; if(A > B) cout << 0 << endl; else cout << max(0LL, (N - 2) * (B - A) + 1) << endl; }
### Prompt Please create a solution in Cpp to the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll N, A, B; cin >> N >> A >> B; if(A > B) cout << 0 << endl; else cout << max(0LL, (N - 2) * (B - A) + 1) << endl; } ```
#include<bits/stdc++.h> using namespace std; int main(){ long long n,a,b; cin >> n >> a >> b; if(n==1&&a<b)cout << 0; else if(a>b)cout << 0; else cout << (a+b*(n-1))+1-(b+a*(n-1)); }
### Prompt Generate a Cpp solution to the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main(){ long long n,a,b; cin >> n >> a >> b; if(n==1&&a<b)cout << 0; else if(a>b)cout << 0; else cout << (a+b*(n-1))+1-(b+a*(n-1)); } ```
#include<bits/stdc++.h> using namespace std; long long n,a,b; int main() { cin>>n>>a>>b; if(n>1 && b>=a || n==1 && a==b) cout<<(n-2)*(b-a)+1<<endl; else cout<<0; return 0; }
### Prompt Please provide a CPP coded solution to the problem described below: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<bits/stdc++.h> using namespace std; long long n,a,b; int main() { cin>>n>>a>>b; if(n>1 && b>=a || n==1 && a==b) cout<<(n-2)*(b-a)+1<<endl; else cout<<0; return 0; } ```
#include<bits/stdc++.h> using namespace std; long long n,a,b; int main() { cin>>n>>a>>b; if(n>1&&b>=a||n==1&&a==b) cout<<(n-2)*(b-a)+1<<endl; else cout<<0<<endl; return 0; }
### Prompt Please provide a Cpp coded solution to the problem described below: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<bits/stdc++.h> using namespace std; long long n,a,b; int main() { cin>>n>>a>>b; if(n>1&&b>=a||n==1&&a==b) cout<<(n-2)*(b-a)+1<<endl; else cout<<0<<endl; return 0; } ```
#include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll a,b,n; cin>>n>>a>>b; ll mx=(n-1)*b+a,mn=(n-1)*a+b; ll ans=mx-mn+1; if(ans<0)ans=0; cout<<ans<<endl; return 0; }
### Prompt Please provide a CPP coded solution to the problem described below: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<bits/stdc++.h> using namespace std; typedef long long ll; int main(){ ll a,b,n; cin>>n>>a>>b; ll mx=(n-1)*b+a,mn=(n-1)*a+b; ll ans=mx-mn+1; if(ans<0)ans=0; cout<<ans<<endl; return 0; } ```
#include<iostream> using namespace std; #define int long long int n,a,b; signed main(){ cin>>n>>a>>b; if(a>b||(n==1&&a!=b))cout<<"0"<<endl; else cout<<(b*(n-1)+a)-(a*(n-1)+b)+1<<endl; return 0; }
### Prompt Develop a solution in CPP to the problem described below: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<iostream> using namespace std; #define int long long int n,a,b; signed main(){ cin>>n>>a>>b; if(a>b||(n==1&&a!=b))cout<<"0"<<endl; else cout<<(b*(n-1)+a)-(a*(n-1)+b)+1<<endl; return 0; } ```
#include<bits/stdc++.h> using namespace std; int main(){ long long n,a,b;cin>>n>>a>>b; long long ans=0; if((n==1&&a!=b)||(b<a)) ans=0; else ans=(b*(n-1)+a)-(a*(n-1)+b)+1; cout<<ans<<endl; return 0; }
### Prompt Generate a cpp solution to the following problem: Snuke has N integers. Among them, the smallest is A, and the largest is B. We are interested in the sum of those N integers. How many different possible sums there are? Constraints * 1 ≤ N,A,B ≤ 10^9 * A and B are integers. Input Input is given from Standard Input in the following format: N A B Output Print the number of the different possible sums. Examples Input 4 4 6 Output 5 Input 5 4 3 Output 0 Input 1 7 10 Output 0 Input 1 3 3 Output 1 ### Response ```cpp #include<bits/stdc++.h> using namespace std; int main(){ long long n,a,b;cin>>n>>a>>b; long long ans=0; if((n==1&&a!=b)||(b<a)) ans=0; else ans=(b*(n-1)+a)-(a*(n-1)+b)+1; cout<<ans<<endl; return 0; } ```