Not able to solve this problem

Given coefficients of a quadratic equation , you need to print the nature of the roots (Real and Distinct , Real and Equal or Imaginary) and the roots.
If Real and Distinct , print the roots in increasing order.
If Real and Equal , print the same repeating root twice
If Imaginary , no need to print the roots.

Note : Print only the integer part of the roots.

Input Format
First line contains three integer coefficients a,b,c for the equation ax^2 + bx + c = 0.

Constraints
-100 <= a, b, c <= 100

Output Format
Output contains one/two lines. First line contains nature of the roots .The next line contains roots(in non-decreasing order) separated by a space if they exist. If roots are imaginary do not print the roots. Output the integer values for the roots.

Sample Input

hi @discobot,

#include<iostream>
#include<cmath>
using namespace std;

int main() {
	int a,b,c,x1,x2;
	double d;
	cin>>a>>b>>c;
	d=b*b-4*a*c;

	if(d>0) {
          x1=((-b)+sqrt(b*b-4*a*c))/2*a;
		  x2=((-b)-sqrt(b*b-4*a*c))/2*a;
		  cout<<"Real and Distinct"<<endl;
		  cout<<min(x1,x2)<<" "<<max(x1,x2)<<" ";
	}
    else if(d==0){
		x1=(-b/2*a);
	    x2 = x1;
		cout<<"Real and Equal"<<endl;
		cout<<x1<<" "<<x2;
	}
	else{
		cout<<"Imaginary";
	}
	return 0;
}

Hi! To find out what I can do, say @discobot display help.