C++ :
#include <bits/stdc++.h> using namespace std; int main(){ int n,a,b; cin >> n >> a >> b; cout << n/2 * b + (n + 1) / 2 * a; return 0; }
By signing up a 大飞信奥 universal account, you can submit code and join discussions in all online judging services provided by us.
Using your 大飞信奥 universal account