Expression Value A
Python
Medium
4 views
Problem Description
Four integers a b c d are provided. Compute (a+b)*c - d and output it.
Input Format
One line: a b c d.
Output Format
One integer result.
Constraints
Values fit in 64-bit.
Official Solution
import sys
p=sys.stdin.read().strip().split()
if len(p)<4: sys.exit(0)
a=int(p[0]); b=int(p[1]); c=int(p[2]); d=int(p[3])
sys.stdout.write(str((a+b)*c - d))
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!