import java.util.Scanner;

class WirelessLAN {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        System.out.print("Enter number of nodes: ");
        int nodes = sc.nextInt();

        System.out.print("Enter number of rounds: ");
        int rounds = sc.nextInt();

        int sent = 0, received = 0, dropped = 0;

        System.out.println("\nWireless LAN Simulation");

        for (int i = 1; i <= rounds; i++) {
            System.out.print("Enter transmitting nodes in round "
                             + i + ": ");

            int n = sc.nextInt();

            sent += n;

            if (n == 1) {
                received++;
                System.out.println("Packet transmitted successfully");
            } else if (n > 1) {
                dropped += n;
                System.out.println("Collision! Packets dropped");
            } else {
                System.out.println("No transmission");
            }
        }

        System.out.println("\nTotal Packets Sent: " + sent);
        System.out.println("Packets Received: " + received);
        System.out.println("Packets Dropped: " + dropped);

        if (sent > 0) {
            double performance = (received * 100.0) / sent;
            System.out.println("Performance: " + performance + "%");
        }
    }
}