1 solutions

  • 0
    @ 2026-11-29 19:30:44

    C++ :

    #include <bits/stdc++.h>
    using namespace std;
    
    int main(){
        int n,a,d;
        cin >> n >> a >> d;
        int ans = (2*a + (n -1) * d) * n /2;
        cout << ans;
        
        return 0;
    }
    
    • 1

    Information

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