2x2 Determinant

2x2 Determinant

Easy Computer Mathematics Matrices 31 views
Explanation Complexity

Problem Statement

Compute determinant of 2x2 matrix.

Input Format

Four integers a b c d (matrix [[a,b],[c,d]]).

Output Format

One integer det.

Example

1 2 3 4
-2

Constraints

Values fit 64-bit

Input / Output Format

Input Format
Four integers a b c d (matrix [[a,b],[c,d]]).
Output Format
One integer det.
Constraints
Values fit 64-bit

Examples

Input:
1 2 3 4
Output:
-2

Example Solution (Public)

Computer Mathematics
det = a*d - b*c.

Official Solution Code

det = a*d - b*c.
Please login to submit solutions.
Editor
Output

                                        
Please login to submit solutions.