Saturday, August 25, 2018

SITA OUT

  • Problem Description

    Ms. Sita, the faculty handling programming lab for you is very strict. Your seniors have told you that she will not allow you to enter the week's lab if you have not completed atleast half the number of problems given last week. 

    Many of you didn't understand this statement and so they requested the good programmers from your batch to write a program to find whether a student will be allowed into a week's lab given the number of problems given last week and the number of problems solved by the student in that week.

    Can you help in writing this program?

    Input Format:

    Input consists of 2 integers. The first integer corresponds to the number of problems given and the second integer corresponds to the number of problems solved.


    Output Format:

    Output consists of the string IN or OUT.

    Refer sample input and output for further formatting specifications.
  • CODING ARENA
  • #include <stdio.h>
    int main()
    {
      int a,b,c;
      scanf("%d",&a);
      scanf("%d",&b);
      c=a/2;
      if(b>=c)
      {
        printf("IN");
      }
      else
      {
        printf("OUT");
      }
      return 0;
    }
  • Test Case 1

    Input (stdin)
    8 3
    
    
    Expected Output
    OUT
  • Test Case 2

    Input (stdin)
    8 4
    
    
    Expected Output
    IN

No comments:

Post a Comment