1 solutions

  • 0
    @ 2026-11-29 18:56:33

    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;
    }
    
    • 1

    Information

    ID
    445
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    (None)
    Tags
    # Submissions
    0
    Accepted
    0
    Uploaded By