IPL
Source: codechef
Difficulty: 217

IPL
Chef has already prepared dinner, and it's his favorite time of the day. It's time for a fantastic cricket match tonight.
If the number of runs scored in an over is
at least
7, Chef cheers "THALA"; otherwise, he cheers "BOOM".
You are given$X$, the number of runs scored in the over.
If$X$is at least$7$, print
THALA
.
Otherwise, print
BOOM
.
Input Format
A single integer$X$, representing number of runs scored in an over.
Output Format
Print
THALA
if number of runs scored in the over is at least$7$, otherwise print
BOOM
.
You may print each character of the string in uppercase or lowercase (for example, the strings
thALa
,
thala
,
Thala
, and
thalA
will all be treated as identical).
Constraints$1 \leq X \leq 36$Sample 1:
Explanation:
Since the number of runs scored is at least$7$, the chef cheers out "THALA".
Sample 2:
Input
Output
4
BOOM
Explanation:
Since the number of runs scored is less than$7$, the chef cheers out "BOOM".

Sample Input:
7

Sample Output:
THALA

C++ solution:
#include <bits/stdc++.h>
using namespace std;

int main()
{
    int a;
    cin >> a;
    if(a >= 7)
    {
        cout << "THALA" << endl;
    }
    else
    {
        cout << "BOOM" << endl;
    }
    return 0;
}

Go solution:
package main
import "fmt"

func main(){
    var x int
    
    fmt.Scan(&x)
    
    if x >= 7 {
        fmt.Println("THALA")
    } else {
        fmt.Println("BOOM")
    }
}

Java solution:
import java.util.*;
import java.lang.*;
import java.io.*;

class Codechef
{
    public static void main (String[] args) throws java.lang.Exception
    {
        Scanner sc=new Scanner(System.in);
        int x=sc.nextInt();
        if(x>=7){
            System.out.println("THALA");
        }else{
            System.out.println("BOOM");
        }

    }
}

JavaScript solution:
// your code goes here
process.stdin.setEncoding("utf-8");
process.stdin.on("data", function(input){
    const x = input.trim();
    if (x < 7){
        console.log("Boom");
    }else{
        console.log("Thala");
    }
})

Python solution:
# cook your dish here
n = int(input())
if n>= 7:
    print("THALA")
else:
    print("BOOM")

Ruby solution:
#!/usr/bin/env ruby

def main
  # Read input safely with proper error handling
  input = ARGF.readline rescue nil
  x = input.to_s.chomp.to_i

  # Ensure output matches exactly what's expected
  if x >= 7
    puts "THALA"
  else
    puts "BOOM"
  end
end

main if __FILE__ == $0