Survival Match | CodeHive Contest | 2nd Question

Revision en2, by Madaraa_uchia, 2023-01-31 11:25:57

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++)
Tags jancontest, mathematics

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en2 English Madaraa_uchia 2023-01-31 11:25:57 18 Tiny change: 'per case) \nand if h' -> 'per case) <br/>\nand if h'
en1 English Madaraa_uchia 2023-01-31 11:19:20 3145 JAY SHREE RAM (published)