1 solutions

  • 0
    @ 2024-12-1 14:51:00
    #include<bits/stdc++.h>
    using namespace std;
    int main()
    {
    	int a1,a2,n;
    	cin>>a1>>a2>>n;
    	int d=a2-a1;
    	int an=a1+(n-1)*d;
    	cout<<setw(3)<<an;
    	return 0;
    }
    
    • 1

    Information

    ID
    852
    Time
    1000ms
    Memory
    256MiB
    Difficulty
    2
    Tags
    (None)
    # Submissions
    251
    Accepted
    67
    Uploaded By