Madaraa_uchia's blog

By Madaraa_uchia, history, 21 month(s) ago, In English

Problem Link:

Contest
Question

Author & Testor: Sarvesh_Powar
Editorialist:Madara_Uchia

DIFFICULTY:

CAKEWALK

PREREQUISITES:

Basic Arithmatics

PROBLEM:

For the Survival of PANDORA planet, Pandora creatures have to play two football matches with Humans.

For that, you have given 4 integers A, B, C, and D.

In which A and B denotes the Score of PANDORA creatures and human respectively in match 1.

Similarly, C, and D denotes the Score of PANDORA creatures and human respectively in match 2.

You have to decide whether PANDORA creatures will survive in this domination or not.

EXPLANATION:

      In this problem, They are having 2 matches each and we are provided with their scores. A and C are the scores of PANDORA creatures whereas B and D are the scores of humans in matches 1 and 2 respectively.
      Therefore, Pandora creatures have to score more than humans to survive, i.e. A+C should be greater than B+D then the output should be "SURVIVED" (without the quotation marks and in upper case)
And if humans scored more than PANDORA creatures, i.e. B+D is greater than A+C then the output should be "NOT SURVIVED" (without the quotation marks and in upper case)
else both humans and creatures scored the same goals in both matches aggregately i.e. A + C == B + D, it'll be tied and the output should be "NA" (without the quotation marks and in upper case)

TIME COMPLEXITY:

O(1) per test case.

CODE:

Editorialist's Code(C++)
  • Vote: I like it
  • +1
  • Vote: I do not like it

| Write comment?