SIMPROB - Editorial

PROBLEM LINK:

Contest

Author: thvardhan

Tester: thvardhan

DIFFICULTY:

CakeWalk

PREREQUISITES:

Sridhar Acharya Rule

PROBLEM:

You are given A,B,C of a quadratic equation you have to find its roots.

QUICK EXPLANATION:

We just take input and use SridharAcharya Rule.

EXPLANATION:

We take input using scanner or bufferedreader. then we calculate sqrt(b^2-4ac) if its negative we print “No Roots” else we then do (-b+d)/2a and print it. and which is the positive root. we then print (-b-d)/2a which is negative root.

AUTHOR’S SOLUTION:

author’s solution can be found here