forked from wotjd4305/Algorithm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswe3142.java
More file actions
43 lines (32 loc) · 967 Bytes
/
swe3142.java
File metadata and controls
43 lines (32 loc) · 967 Bytes
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
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Scanner;
public class swe3142 {
static Scanner sc = new Scanner(System.in);
static int answer = 0;
static int Arr[];
public static void main(String[] args)
{
solution();
}
public static void solution()
{
int t = sc.nextInt();
//N개의 퀸이 N*N배열
for(int T=1; T<=t; T++) {
int N = sc.nextInt();
int M = sc.nextInt();
int unihorn_num;
int twinhorn_num;
for(int i =0; i<=M; i++)
{
unihorn_num = (M-i)*1;
twinhorn_num = i*2;
int total_num = unihorn_num + twinhorn_num;
if(N == total_num)
System.out.println("#" + T + " " + (M-i) + " " + i);
}
}
}
}