Learn DSADSAContests
coding75 logo
LeetCode POTDPOTDSheets
coding75 Pro
coding75 logo
Dashboard
Learn DSA
Course RoadmapFlow
DSA Topic TreeNew 🚀
Contest SolutionsPractice
Practice Sheets
MasterclassesLive 👨🏻‍💻

coding75 ProPRO

Live Classes & Placement Guidance

coding75 logo

The premier developer platform for mastering Data Structures & Algorithms, exploring contest editorials, building ATS-ready resumes, and accelerating your tech career.

Connect & Community

DSA & Contests

  • Learn DSA
  • Contest Solutions
  • LeetCode POTDDaily
  • Practice Sheets
  • MasterclassesSoon

Interview Prep

  • Portfolio Projects
  • CS Fundamentals
  • System DesignSoon
  • Interview ExperiencesSoon
  • Mock InterviewsSoon

Career & Pro

  • Jobs & Internships
  • Resume BuilderATS
  • coding75 Pro
  • Submit Feedback
© 2026coding75•crackDSA™•Maa Lalita Edtech Private Limited. All Rights Reserved.
Privacy PolicyTerms & ConditionsContact Support
Registered Office: Kanpur 208021•Regional Office: Indiranagar, Bangalore, 560008
Maa Lalita Edtech Private Limited
Contests/CodeChef/Starters 125/50-50 Rule
PrevNext
CodeChefCodeChef
1 Star
Starters 125

50-50 Rule

Miscellaneous
Loading...
Solve on CodeChef

Problem Statement

Official algorithmic problem description and constraints.

Open on CodeChef

Schools of Chefland use the 50−50


50−50 rule to grade their students. As per the rule , students are awarded :

  • Z grade, if their attendance is strictly less than 50%
  • F grade, if they score strictly less than 50% given that their attendance is greater than or equal to 50%
  • A grade, otherwise.


You are given two integers, X andY, denoting the percentage of attendance and percentage of marks obtained by Alice. What grade will Alice get?


Input Format

  • The first line of input will contain a single integer T, denoting the number of test cases.
  • Each test case consists of two space-separated integers X and Y — the percentage of attendance and percentage of marks obtained by Alice.


Output Format

For each test case, output on a new line, the grade awarded to Alice.


Note that you may print the grade in lowercase or uppercase.

Solutions & Walkthrough

Detailed video explanations, mathematical intuition, and clean C++ implementation code.

Connecting secure classroom stream...
Back to Starters 125
Previous ProblemNext Problem