Algorithm/백준

백준 9372 상근이의 여행 - 자바

chbong 2024. 8. 22. 19:40
package mission;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Boj9372 {
    static int N,M;
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int T = Integer.parseInt(br.readLine());
        for(int i = 0; i< T; i++){
            StringTokenizer st = new StringTokenizer(br.readLine());
             N = Integer.parseInt(st.nextToken());
             M = Integer.parseInt(st.nextToken());

            for(int j = 0; j< M; j++){
                st = new StringTokenizer(br.readLine());
            }

            System.out.println(N-1);

        }

    }
}