Click Here to go back to the homepage.

Tarifa Solution:


import java.util.Scanner;

class Tarifa {
    static Scanner sc = new Scanner(System.in);
    public static void main(String[] args){
        int first = Integer.parseInt(sc.nextLine());
        int second = Integer.parseInt(sc.nextLine());
        int total = 0;
        for (int i = 0; i < second; i++){
            total += Integer.parseInt(sc.nextLine());
        }
        System.out.println(first*(second+1)-total);
    }
}