-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathJ01025 - HÌNH VUÔNG
More file actions
49 lines (48 loc) · 2.16 KB
/
J01025 - HÌNH VUÔNG
File metadata and controls
49 lines (48 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import java.util.Scanner;
import java.lang.Math;
public class Lazygarde {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int a1 = sc.nextInt();
int b1 = sc.nextInt();
int c1 = sc.nextInt();
int d1 = sc.nextInt();
int a2 = sc.nextInt();
int b2 = sc.nextInt();
int c2 = sc.nextInt();
int d2 = sc.nextInt();
int x1 = Math.min(a1, a2);
int x2 = Math.min(b1, b2);
int y1 = Math.max(c1, c2);
int y2 = Math.max(d1, d2);
int x = Math.max((y1 - x1), (y2 - x2));
System.out.print(x * x);
}
}
/* Do Xuan Huong
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@##################@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@#############################@@@@@@@@@@@@@@@@
@@@@@@@@@@@@&####################################@@@@@@@@@@@@
@@@@@@@@@@##########################################@@@@@@@@@
@@@@@@@@##############################################@@@@@@@
@@@@@@#################################################@@@@@@
@@@@@####################################################@@@@
@@@%#####################@@@@@@@@@@@######################@@@
@@@###################@@@@@@@@@@@@@@@@@####################@@
@@##################@@@@@@ @@@@@@##################@@
@@#################@@@@@ @@@@###################@
@@@@@@@@@@@@@@@@@@@@@@@@ @@@@@@@@@@@@@@@@@@@@@@@@
@ &@@@@ @@@@ .......@@
@@ @@@@@@ @@@@@@ .......@@
@@ @@@@@@@@@@@@@@@@@ .......@@@
@@@ @@@@@@@@@@@ ......@@@@
@@@@ ......@@@@@
@@@@@@ ......@@@@@@
@@@@@@@ .....@@@@@@@@
@@@@@@@@@ .....@@@@@@@@@@
@@@@@@@@@@@@ ....@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@ ....@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@% .@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
*/