Polynomial equation(Contest)
Polynomial equation easy Time Limit: 2 sec Memory Limit: 128000 kB
Last updated
Polynomial equation easy Time Limit: 2 sec Memory Limit: 128000 kB
Last updated
Problem Statement :
Given a function f(x) = ax2 + bx + c and an integer K. Find the minimum non - negative integer value of t such that f(t) >= K. Input First line contains four positive integers a, b, c, K.
Constraints 1 <= a, b, c <=100 0 <= K <= 10^16 Output Print the value of t. Example Sample Input 1: 1 1 1 1
Output 0
Explanation: f(0) = (0 + 0 + 1) >= 1
Sample Input 2: 1 1 1 2
Output 1
Explanation: f(0) = 1 < 2 f(1) = 3 >=2
link: