Problem:
Score : 100 points

Problem Statement

You will turn on the air conditioner if, and only if, the temperature of the room is 30 degrees Celsius or above.

The current temperature of the room is X degrees Celsius. Will you turn on the air conditioner?

Constraints

-40 \leq X \leq 40

X is an integer.

Input

Input is given from Standard Input in the following format:

X

Output

Print Yes if you will turn on the air conditioner; print No otherwise.

Sample Input 1

25

Sample Output 1

No

Sample Input 2

30

Sample Output 2

Yes

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

import java.util.Scanner;


public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
			
			int N = sc.nextInt();
			
			String s = sc.next();
			
			int len = s.length();
			
			int cnt=0;
			char[] sChars = s.toCharArray();
			int leftindex=N-1;
			
			int rdcnt=0;
			int whcnt=0;
			for(int i=0;i<N;i++) {
				if(sChars[i]=='W') {
					whcnt++;
				}else {
					rdcnt++;
				}
			}
			
			
			for(int i=0;i<N;i++) {
			
				if(sChars[i]=='W') {
					for(int j=0;j<leftindex-i;j++) {
						if(sChars[leftindex-j]=='R') {
							sChars[i]='R';
							sChars[leftindex-j]='W';
							leftindex=leftindex-j-1;
							cnt++;
							break;
						}
					}
					if(cnt>=rdcnt||cnt>=whcnt) {
						break;
					}
				}
				if(leftindex==i) {
					break;
				}	
			}
			System.out.println(cnt);
	}	
}