## Algorithm

Problem Name: beecrowd | 1007

Algorithm:

``((A * B) - (C * D))``

Problem Detail: beecrowd | 1007

# Difference

Adapted by Neilor Tonin, URI Brazil

Timelimit: 1

Read four integer values named A, B, C and D. Calculate and print the difference of product A and B by the product of C and D (A * B - C * D).

## Input

The input file contains 4 integer values.

## Output

Print DIFERENCA (DIFFERENCE in Portuguese) with all the capital letters, according to the following example, with a blank space before and after the equal signal.

 Input Samples Output Samples 5 6 7 8 DIFERENCA = -26

 0 0 7 8 DIFERENCA = -56

 5 6 -7 8 DIFERENCA = 86

## Code Examples

### #1 Code Example with C Programming

```Code - C Programming```

``````
#include <stdio.h>
int main() {

int A , B , C , D, difference;

scanf("%d %d %d %d", &A , &B ,&C, &D);

difference=((A * B) - (C * D));

printf("DIFERENCA = %d\n", difference);

return 0;

}
``````
Copy The Code &

Input

cmd
5
6
7
8

Output

cmd
DIFERENCA = -26

### #2 Code Example with C++ Programming

```Code - C++ Programming```

``````

#include <stdio.h>
int main() {

int A , B , C , D, difference;

scanf("%d %d %d %d", &A , &B ,&C, &D);

difference=((A * B) - (C * D));

printf("DIFERENCA = %d\n", difference);

return 0;

}

``````
Copy The Code &

Input

cmd
0
0
7
8

Output

cmd
DIFERENCA = -56

### #3 Code Example with Java Programming

```Code - Java Programming```

``````
import java.util.Scanner;
public class Main {
public static void main(String[] args){

int A , B , C , D, difference;
Scanner sc = new Scanner(System.in);
A = sc.nextInt();
B = sc.nextInt();
C = sc.nextInt();
D = sc.nextInt();

difference=((A * B) - (C * D));

System.out.printf("DIFERENCA = %d\n", difference);
}
}
``````
Copy The Code &

Input

cmd
0
0
7
8

Output

cmd
DIFERENCA = -56

### #4 Code Example with Python Programming

```Code - Python Programming```

``````
a= int(input())
b= int(input())
c= int(input())
d= int(input())

difference=((a * b) - (c * d))

print("DIFERENCA = %d" %difference)
``````
Copy The Code &

Input

cmd
5
6
-7
8

Output

cmd
DIFERENCA = 86

### #5 Code Example with C# Programming

```Code - C# Programming```

``````
using System;
class URI {

static void Main(string[] args) {
int a, b, c, d, difference;

difference = ((a * b) - (c * d));

Console.WriteLine("DIFERENCA = " + difference);
}
}
``````
Copy The Code &

Input

cmd
5
6
-7
8

Output

cmd
DIFERENCA = 86

## Demonstration

#1007 Beecrowd Online Judge Solution 1007 Solution C, C++, Java, Python