B. Equation

Problem Setup

  • login to CS50 IDE
  • write cd in the terminal to go to the home directory
  • write mkdir equation to create a folder called equation
  • write cd equation to go to the equation folder
  • write code equation.cpp to create a file called equation.cpp and open it in the editor

Problem

You are given \(4\) integers \(a\), \(b\), \(c\), and \(d\). You need to calculate the value of \(z = a \times b + c - d\), where \(z\) is the result of the calculation.

Input

One line containing four integers \(a\), \(b\), \(c\), and \(d\) where \(1 \leq a, b, c, d \leq 1000\).

Output

Print the value of \(z\) in a single line, where \(z = a \times b + c - d\).

Example

Input:

4 2 5 3

Output:

10

Test Your Code

Make sure you are in the equation directory, then run the following command:

check50 iti-technical-team/problemset/2026/1/equation

Submit Your Code

Make sure you are in the equation directory, then run the following command:

submit50 iti-technical-team/problemset/2026/1/equation