Problem:
Score : 100 points

Problem Statement

Dolphin loves programming contests. Today, he will take part in a contest in AtCoder.

In this country, 24-hour clock is used. For example, 9:00 p.m. is referred to as "21 o'clock".

The current time is A o'clock, and a contest will begin in exactly B hours.
When will the contest begin? Answer in 24-hour time.

Constraints

0 \leq A,B \leq 23

A and B are integers.

Input

The input is given from Standard Input in the following format:

A B

Output

Print the hour of the starting time of the contest in 24-hour time.

Sample Input 1

9 12

Sample Output 1

21

In this input, the current time is 9 o'clock, and 12 hours later it will be 21 o'clock in 24-hour time.

Sample Input 2

19 0

Sample Output 2

19

The contest has just started.

Sample Input 3

23 2

Sample Output 3

1

The contest will begin at 1 o'clock the next day.

Solution in Java (OpenJDK 11.0.6) (judge verdict: Runtime Error)

import java.util.*;

public class Main {

	public static void main(String[] args) {
		Main main = new Main();
		main.run();
	}

	long C[][];
	public void init(int n) {
		C = new long[n+1][n+1];
		C[0][0]=1;
		for(int i=1; i<=n; i++) {
			C[i][0]=1;
			for(int j=1; j<=n; j++) {
				C[i][j] = C[i-1][j-1]+C[i-1][j];
			}
		}
	}

	private long com(int n, int k) {
		if(n<k) return 0;
		return C[n][k];
	}

	public void run() {
		Scanner sc = new Scanner(System.in);
		int n=sc.nextInt();
		int a=sc.nextInt();
		int b=sc.nextInt();
		ArrayList<Long> v= new ArrayList<Long>();
		for(int i=0; i<n; i++) {
			v.add(sc.nextLong());
		}
		init(n);
		Collections.sort(v,Collections.reverseOrder());
		int acnt=0;
		int apos=0;
		for(int i=0; i<n; i++) {
			if(v.get(i).equals(v.get(a))) {
				acnt++;
				if(i<a) {
					apos++;
				}
			}
		}
		double total = 0.0;
		for(int i=0; i<a; i++) {
			total += v.get(i);
		}
		double ave = total/(double)a;
		System.out.println(ave);

		long ans = 0;
		if(apos==a) {
			for(int i=a; i<=b; i++) {
				ans += com(acnt, i);
			}
		}else {
			ans = com(acnt, apos);
		}
		System.out.println(ans);
		sc.close();
	}

}