ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Discussion of Problem 2100. Wedding Dinner

on java accepted
Posted by Aleksandr 30 Nov 2025 22:40
import java.io.IOException;


import java.util.Scanner;

public class Main {
    public static int rent = 100;

    public static void main(String[] args) throws IOException {
        Scanner scanner = new Scanner(System.in);
        int numberOfFriends = Integer.parseInt(scanner.nextLine());
        int totalGuests = 2;
        for (int i = 0; i < numberOfFriends; i++) {
            String answer = scanner.nextLine();

            if (answer.contains("+")){
                totalGuests += 2;
            }else{
                totalGuests++;
            }
        }
        if (totalGuests == 13){
            totalGuests++;
        }
        int total = totalGuests*rent;
        System.out.println(total);

        scanner.close();
    }
}