import java.util.*;

public class HargaNavigasi {
    public static void main(String[] args) {
        TreeSet<Integer> harga = new TreeSet<>(List.of(15000, 5000, 25000, 10000, 40000));
        System.out.println("Isi terurut      : " + harga);

        // Ujung nilai.
        System.out.println("first()          : " + harga.first());
        System.out.println("last()           : " + harga.last());

        // Navigasi ke tetangga terdekat.
        System.out.println("floor(12000)     : " + harga.floor(12000));
        System.out.println("ceiling(12000)   : " + harga.ceiling(12000));
        System.out.println("lower(25000)     : " + harga.lower(25000));
        System.out.println("higher(25000)    : " + harga.higher(25000));

        // Potongan rentang (view, bukan salinan).
        System.out.println("headSet(15000)   : " + harga.headSet(15000));
        System.out.println("tailSet(15000)   : " + harga.tailSet(15000));
    }
}
