Algorithm
Problem Name: beecrowd | 2930
Problem Link: https://www.beecrowd.com.br/judge/en/problems/view/2930
Final Thesis of Christmas Depression
By Igor Gomes, UVA Brazil
Timelimit: 1
Larissa is a very intelligent and studious scholar, so she is engaged in various activities. The end of the year, the month of hers final presentation, has arrived. She, very busy, needs to know if she can perform her presentation before Christmas! But prior to her presentation she must undergo a check with her oriental counselor, Prof. Takanada
Input
The input is composed of an E (0 < E < 25) value representing the day the final thesis was delivered for verification. A value D (0 < D < 25) representing the end date to be submitted for verification.
Output
Show, for each test case, whether the scholar will make the presentation or not. The only possibility of delivery not to be performed on the date is due to lack of guidance from Takanada. If it is not possible, print "Eu odeio a professora!". If it is delivered within 3 days before the deadline, print "Muito bem! Apresenta antes do Natal!", Otherwise, being very close to the deadline, print "Parece o trabalho do meu filho!", In the latter case, it is added plus two days for corrections, and if the end date is shorter than the day before Christmas (24), it can be presented, and "TCC Apresentado!"" should be printed, otherwise print "Fail! Entao eh nataaaaal!".
Input Sample | Output Sample |
13 19 |
Muito bem! Apresenta antes do Natal! |
22 23 |
Parece o trabalho do meu filho! |
21 22 |
Parece o trabalho do meu filho! |
Code Examples
#1 Code Example with C++ Programming
Code -
C++ Programming
#include <iostream<
using namespace std;
int main()
{
int e, d;
cin >> e >> d;
if (e>d)
cout << "Eu odeio a professora!" << endl;
else if (d-e >= 3)
cout << "Muito bem! Apresenta antes do Natal!" << endl;
else
{
cout << "Parece o trabalho do meu filho!" << endl;
if (e+2 < 24)
cout << "TCC Apresentado!" << endl;
else
cout << "Fail! Entao eh nataaaaal!" << endl;
}
return 0;
}
Copy The Code &
Try With Live Editor
Input
Output
#2 Code Example with Java Programming
Code -
Java Programming
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Scanner leitor = new Scanner(System.in);
int e = leitor.nextInt();
int d = leitor.nextInt();
if (e > d) {
System.out.println("Eu odeio a professora!");
} else if ((d - e) >= 3) {
System.out.println("Muito bem! Apresenta antes do Natal!");
} else if ((e + 2) < 24) {
System.out.println("Parece o trabalho do meu filho!\nTCC Apresentado!");
} else {
System.out.println("Parece o trabalho do meu filho!\nFail! Entao eh nataaaaal!");
}
}
}
Copy The Code &
Try With Live Editor
Input
Output
#3 Code Example with Javascript Programming
Code -
Javascript Programming
const { readFileSync } = require("fs")
const [E, D] = readFileSync("/dev/stdin", "utf8")
.split(" ", 2)
.map((date) => Number.parseInt(date, 10))
if (E > D) {
console.log("Eu odeio a professora!")
} else if (E <= D - 3) {
console.log("Muito bem! Apresenta antes do Natal!")
} else {
console.log("Parece o trabalho do meu filho!")
if (E + 2 < 24) console.log("TCC Apresentado!")
else console.log("Fail! Entao eh nataaaaal!")
}
Copy The Code &
Try With Live Editor
Input
Output
#4 Code Example with Python Programming
Code -
Python Programming
n,m=map(int,input().split())
if m-n>=3:print("Muito bem! Apresenta antes do Natal!")
elif m-n<0:print("Eu odeio a professora!")
elif m-n<3:
print("Parece o trabalho do meu filho!")
m+=2
if m<=24:print("TCC Apresentado!")
else:print("Fail! Entao eh nataaaaal!")
Copy The Code &
Try With Live Editor
Input
Output