-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathContest510A.java
More file actions
46 lines (42 loc) · 1.23 KB
/
Copy pathContest510A.java
File metadata and controls
46 lines (42 loc) · 1.23 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
import java.util.Scanner;
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
/**
*
* @author rn-sshawish
*/
public class Contest510A {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
int x = input.nextInt();
int y = input.nextInt();
StringBuilder st1 = new StringBuilder();
for (int i = 0; i < y; i++) {
st1.append('#');
}
StringBuilder st2 = new StringBuilder();
for (int i = 0; i < y-1; i++) {
st2.append('.');
}
st2.append('#');
StringBuilder st3 = new StringBuilder();
st3.append('#');
for (int i = 1; i < y; i++) {
st3.append('.');
}
StringBuilder output = new StringBuilder();
for (int i = 1; i <= x; i++) {
if (i%2 != 0) {
output.append(st1).append("\n");
}else if (i%4 == 0) {
output.append(st3).append("\n");
}else{
output.append(st2).append("\n");
}
}
System.out.println(output);
}
}