#include <iostream>
#include <conio.h>
#include <math.h>
using namespace std;
main() {
int j,s,d,m,i;
double x,f=0,fm=0;
cout<<"Wlcome to best project for solve\n";
cout<<"Enter x max degree\n";
cin>>m;
cout<<"Enter x min degree\n";
cin>>s;
d=m-s;
cout<<"Enter a guess for x it help us to find answer in short time\n";
cin>>x;
int a[d];
for (j=d;j>=0;j--)
{
cout<<"Enter coefficien of x^"<<j<<"\n";
cin>>a[j];
}
for (i=0;i<=20;i++)
{
for(j=0;j<=d;j++){
f=f+a[j]*pow(x,s+j);
fm=fm+(s+j)*a[j]*pow(x,s+j-1);
}
x=x-(f/fm);
f=fm=0;
}
cout<<x;
getch();
}