A sample Python Program for Reference work ( Life Universe Everything )

  1. def main():
  2. while True:
  3. w=input()
  4. if w==42:
  5. break
  6. else :
  7. print w
  8. main()
-----------------------------------------------------------------------------------------=============================================================================================

I. Yet another A + B codeforces

def main():

            a=int(input())
            b=int(input())
            c=int(input())
           

            if a+b == c:
                print("YES")
            elif a+a == c:
                print("YES")
            elif b+b == c:
                print("YES")
            elif 2*c == b:
                print("YES")
            elif 2*a == b:
                print("YES")
            elif a+c == b:
                print("YES")
            elif 2*c == a:
                print("YES")
            elif 2*b == a:
                print("YES")
            elif c+b == a:
                print("YES")
            else:
                print("NO")

main()

Comments

Popular posts from this blog

Getting Started With MEAN App Development with AngularJs , ExpressJs , NodeJs and MongoDB.

B. Dreamoon and WiFi :calculate no. of ways : recursive solution (branch and bound )

A. Dreamoon and Stairs : minimum steps to reach : recursion solution.