1 solutions

  • 0
    @ 2023-9-30 13:48:38
    #include<iostream>
    using namespace std;
    int main()
    {
    	int a1,a2,n;
    	cin>>a1>>a2>>n;
    	int d=a2-a1;
    	cout<<(a1+(n-1)*d);
    	return 0;
    }
    
    • 1

    Information

    ID
    6727
    Time
    1000ms
    Memory
    128MiB
    Difficulty
    3
    Tags
    (None)
    # Submissions
    188
    Accepted
    102
    Uploaded By