#pragma comment (linker, "/STACK:1000000000")
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <math.h>
#include <stack>
#include <memory.h>
#include <algorithm>

#define ll long long
#define mp make_pair
#define MAX 2005
#define mod 1000000007
using namespace std;

int main()
{
	double a, b, c;
	cin>>a>>b>>c;
	double d = b * b - 4 * a * c;
	d = sqrt(d);
	double res1 = -b + d; res1 /= (2 * a);
	double res2 = -b - d; res2 /= (2 * a);
	printf("%.10f\n", res1);
	printf("%.10f\n", res2);
	return 0;
}


#pragma comment (linker, "/STACK:1000000000")
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <queue>
#include <set>
#include <math.h>
#include <stack>
#include <memory.h>
#include <algorithm>

#define ll long long
#define mp make_pair
#define MAX 2005
#define mod 1000000007
using namespace std;

int main()
{
	double a, b, c;
	cin>>a>>b>>c;
	double d = b * b - 4 * a * c;
	d = sqrt(d);
	double res1 = -b + d; res1 /= (2 * a);
	double res2 = -b - d; res2 /= (2 * a);
	if (res1 < res2)
	{
		double temp = res1;
		res1 = res2;
		res2 = temp;
	}
	printf("%.10f\n", res1);
	printf("%.10f\n", res2);
	return 0;
}


#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <time.h>
#include <stdlib.h>
#include <random>
#include <stack>

using namespace std;

#define ll long long
#define pii pair<int,int>
#define mp make_pair
#define endl "\n"
#define pdd pair<double, double>
#define pll pair<ll, ll>
#define PI 3.14159265358979
#define mod 1000000007

int main()
{
	ios_base::sync_with_stdio(0);

	ll a, b, c;
	cin >> a >> b >> c;

	ll d = b * b - 4 * a * c;

	double s = sqrt(d + 0.0);
	cout.precision(12);
	cout << (-b + s) / (2 * a) << endl;
	cout << (-b - s) / (2 * a);

	return 0;
}


#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <vector>
#include <string>
#include <time.h>
#include <stdlib.h>
#include <random>
#include <stack>

using namespace std;

#define ll long long
#define pii pair<int,int>
#define mp make_pair
#define endl "\n"
#define pdd pair<double, double>
#define pll pair<ll, ll>
#define PI 3.14159265358979
#define mod 1000000007

int main()
{
	ios_base::sync_with_stdio(0);

	ll a, b, c;
	cin >> a >> b >> c;

	ll d = b * b - 4 * a * c;
	double s = sqrt(d + 0.0);
	cout.precision(12);
	double x = (-b + s) / (2 * a), y = (-b - s) / (2 * a);
	cout << max(x, y) << endl << min(x, y);

	return 0;
}


#include<stdio.h>
#include<algorithm>
#include<iostream>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#define LL __int64
using namespace std;
LL C(LL a,LL b)
{
    LL ans=1;
    LL i;
    while(b>a/2)
        b=a-b;
    for(i=1;i<=b;i++)
    {
        ans*=(a-i+1);
        ans/=i;
    }
    return ans;
}
int main()
{
    double a,b,c;
    //memset(dp,-1,sizeof(dp));
    while(scanf("%lf%lf%lf",&a,&b,&c)!=EOF)
    {
        double t=b*b-4*a*c;
        t=sqrt(t);
        printf("%lf\n",(-b+t)/(2*a));
        printf("%lf\n",(-b-t)/(2*a));
    }
}


#include<stdio.h>
#include<algorithm>
#include<iostream>
#include<stdlib.h>
#include<math.h>
#include<string.h>
#define LL __int64
using namespace std;
LL C(LL a,LL b)
{
    LL ans=1;
    LL i;
    while(b>a/2)
        b=a-b;
    for(i=1;i<=b;i++)
    {
        ans*=(a-i+1);
        ans/=i;
    }
    return ans;
}
int main()
{
    double a,b,c;
    //memset(dp,-1,sizeof(dp));
    while(scanf("%lf%lf%lf",&a,&b,&c)!=EOF)
    {
        double t=b*b-4*a*c;
        t=sqrt(t);
        double ans1=max((-b+t)/(2*a),(-b-t)/(2*a));
        double ans2=min((-b+t)/(2*a),(-b-t)/(2*a));
        printf("%lf\n",ans1);
        printf("%lf\n",ans2);
    }
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <math.h>

long long f(int k){
	long long f=1;
	for (int i=1; i<=k;i++)f*=i;
	return f;
}
int a[200];

int gcd(long long a, long long b){
	if (b>a){
		int k;
		k=b;
		b=a;
		a=k;
	}
	if (a%b==0)return b;
	else  gcd(b, a%b);
}

using namespace std;
int main()
{
	double a, b, c, x, y;
	cin >>a>>b>>c;
	x=(-b + sqrt(b*b - 4*a*c))/(2*a);
	y=(-b - sqrt(b*b - 4*a*c))/(2*a);
	if (x>y)
	printf("%.15lf\n%.15lf",x,y );
	else 	printf("%.15lf\n%.15lf",y, x );
}


#include <iostream>
#include <stdio.h>
#include <vector>
#include <string>
#include <math.h>

long long f(int k){
	long long f=1;
	for (int i=1; i<=k;i++)f*=i;
	return f;
}
int a[200];

int gcd(long long a, long long b){
	if (b>a){
		int k;
		k=b;
		b=a;
		a=k;
	}
	if (a%b==0)return b;
	else  gcd(b, a%b);
}

using namespace std;
int main()
{
	double a, b, c, x, y;
	cin >>a>>b>>c;
	x=(-b + sqrt(b*b - 4*a*c))/(2*a);
	y=(-b - sqrt(b*b - 4*a*c))/(2*a);
	printf("%.15lf\n%.15lf",x,y );
}


#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main()
{
    long double d;
    double a,b,c;
    cin >>a>>b>>c;
    d=(sqrt(b*b-4*a*c)-b)/(2*a);
    cout <<std::fixed<<setprecision(8)<<d<< endl;
    d=(-sqrt(b*b-4*a*c)-b)/(2*a);
    cout <<std::fixed<<setprecision(8)<<d;
return 0;
}


#include <iostream>
#include <iomanip>
#include <math.h>
using namespace std;
int main()
{
    long double d;
    double a,b,c;
    cin >>a>>b>>c;
    d=((a/fabs(a))*sqrt(b*b-4*a*c)-b)/(2*a);
    cout <<std::fixed<<setprecision(8)<<d<< endl;
    d=((a/fabs(a))*(-sqrt(b*b-4*a*c))-b)/(2*a);
    cout <<std::fixed<<setprecision(8)<<d;
return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include<map>
#include <list>
#include <typeinfo>
using namespace std;
#define REP(a,b) for(long long a = 0;a < b;++a)
int main() {
	double a, b, c;
	cin >> a >> b >> c;
	double hoge = b*b - 4 * a*c;
	cout.setf(ios::fixed);
	cout.precision(7);
	cout << (-1 * b + sqrt(hoge)) / (2 * a) << endl;
	cout << (-1 * b - sqrt(hoge)) / (2 * a) << endl;
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include<map>
#include <list>
#include <typeinfo>
using namespace std;
#define REP(a,b) for(long long a = 0;a < b;++a)
int main() {
	double a, b, c;
	cin >> a >> b >> c;
	double hoge = b*b - 4 * a*c;
	cout.setf(ios::fixed);
	cout.precision(7);
	cout << max((-1 * b + sqrt(hoge)) / (2 * a), (-1 * b - sqrt(hoge)) / (2 * a)) << endl;
	cout << min((-1 * b + sqrt(hoge))/(2*a),(-1 * b - sqrt(hoge)) / (2 * a)) << endl;
}


#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include<map>
#include <list>
#include <typeinfo>
using namespace std;
#define REP(a,b) for(long long a = 0;a < b;++a)
int main() {
	double a, b, c;
	cin >> a >> b >> c;
	cout.precision(7);
	cout.setf(ios::fixed);
	double answer_first =(-1*b+sqrt(b*b-4*a*c)) / 2 * a;
	double answer_second = (-1 * b - sqrt(b*b - 4 * a*c)) / 2*a;
	cout << max(answer_first, answer_second) << endl;
	cout << min(answer_first, answer_second) << endl;
}


// p,op.cpp: ���������� ����� ����� ��� ����������� ����������.
//

//#include "stdafx.h"
#include <conio.h>
#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	double x1,x2,d;
	d=b*b-4*a*c;
	x1 = ((-1)*b+pow(d,1.0/2.0))/2/a;
	x2 = ((-1)*b-pow(d,1.0/2.0))/2/a;
	if (x1>x2){

		std::cout
        << std::setiosflags( std::ios_base::fixed )
        << std::setprecision(15) << x1 << std::endl;
		std::cout
		 << std::setiosflags( std::ios_base::fixed )
		<< std::setprecision(15) << x2 << std::endl;
	}

	else {std::cout
		 << std::setiosflags( std::ios_base::fixed )
		<< std::setprecision(15) << x2 << std::endl;
	std::cout
		 << std::setiosflags( std::ios_base::fixed )
		<< std::setprecision(15) << x1 << std::endl;
	}

	//{cout<<(6,x2)<<'\n'<<(6,x1);}
	//getch();
	return 0;
}


// p,op.cpp: ���������� ����� ����� ��� ����������� ����������.
//

//#include "stdafx.h"
#include <conio.h>
#include <iostream>
#include <iomanip>
using namespace std;

int main()
{
	int a,b,c;
	cin>>a>>b>>c;
	double x1,x2,d;
	d=b*b-4*a*c;
	x1 = ((-1)*b+pow(d,1.0/2.0))/2/a;
	x2 = ((-1)*b-pow(d,1.0/2.0))/2/a;
	if (x1>x2){cout<<x1<<'\n'<<x2;}
	else {cout<<x2<<'\n'<<x1;};
/*
		std::cout
        << std::setiosflags( std::ios_base::fixed )
        << std::setprecision(15) << x1 << std::endl;
		std::cout
		 << std::setiosflags( std::ios_base::fixed )
		<< std::setprecision(15) << x2 << std::endl;
	}

	else {std::cout
		 << std::setiosflags( std::ios_base::fixed )
		<< std::setprecision(15) << x2 << std::endl;
	std::cout
		 << std::setiosflags( std::ios_base::fixed )
		<< std::setprecision(15) << x1 << std::endl;
	}
	*/

	//getch();
	return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
#include<algorithm>
#include<math.h>
using namespace std;
typedef long long ll;

int main()
{
    double a,b,c;
    cin>>a>>b>>c;
    printf("%.10f\n",(-b+sqrt(b*b-4.0*a*c))/(2.0*a));
    printf("%.10f\n",(-b-sqrt(b*b-4.0*a*c))/(2.0*a));
    return 0;
}


#include <iostream>
#include <stdio.h>
#include <stdlib.h>
#include<string.h>
#include<algorithm>
#include<math.h>
using namespace std;
typedef long long ll;

int main()
{
    double a,b,c;
    cin>>a>>b>>c;
    if(a>0)
    {
    printf("%.10f\n",(-b+sqrt(b*b-4.0*a*c))/(2.0*a));
    printf("%.10f\n",(-b-sqrt(b*b-4.0*a*c))/(2.0*a));
    }
    else
    {
    printf("%.10f\n",(-b-sqrt(b*b-4.0*a*c))/(2.0*a));
    printf("%.10f\n",(-b+sqrt(b*b-4.0*a*c))/(2.0*a));
    }

    return 0;
}


#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
    double a, b, c, x1, x2, d;
    cin>>a>>b>>c;
    d = b*b - 4*a*c;
    a = sqrt(d);
    x1 = (-b-d)/(2*a);
    x2 = (-b+d)/(2*a);
    cout<<fixed<<setprecision(6)<<(x1 > x2)?x1:x2<<"\n"<<fixed<<setprecision(6)<<(x1 < x2)?x1:x2;
    return 0;
}


#include <iostream>
#include <iomanip>
#include <cmath>
using namespace std;
int main()
{
    double a, b, c, x1, x2, d;
    cin>>a>>b>>c;
    d = b*b - 4*a*c;
    d = sqrt(d);
    x1 = (-b-d)/(2*a);
    x2 = (-b+d)/(2*a);
    if(x2>x1){
        swap(x1, x2);
    }
    cout<<fixed<<setprecision(6)<<x1<<"\n"<<x2;
    return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main()
{
	int a, b, c;
	double x, d, e;
	cin>>a>>b>>c;
	x=b*b-4*a*c;
	x=sqrt(x);
	d=(-b+x)/(2*a);
	e=(-b-x)/(2*a);
	if(d>e)
	{
	printf("%.7f", d);
	cout<<endl;
	printf("%.7f", e);
	}
	else
	{printf("%.7f", e);
	cout<<endl;
	printf("%.7f", d);
	}
	return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main()
{
	int a, b, c;
	double x, d, e;
	cin>>a>>b>>c;
	x=b*b-4*a*c;
	x=sqrt(x);
	d=(-b+x)/2;
	printf("%.7f", d);
	cout<<endl;
	e=(-b-x)/2;
	printf("%.7f", e);
	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
	long a,b,c;
	double x1,x2,d,k;
	cin>>a>>b>>c;
	k=b*b-4*a*c;
	d=sqrt(k);
	x1=(-b+d)/(2*a);
	x2=(-b-d)/(2*a);
	if(x1>x2)
	{
		cout<<x1<<" "<<x2<<endl;
//		std::cout << std::fixed << std::setprecision(10) << x1 << std::endl;
	//	std::cout << std::fixed << std::setprecision(10) << x2 << std::endl;
	}
	else
		{
			cout<<x2<<" "<<x1<<endl;
			//std::cout << std::fixed << std::setprecision(10) << x2 << std::endl;
			//std::cout << std::fixed << std::setprecision(10) << x1 << std::endl;
		}

	return 0;
}


#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
	long a,b,c,i,j;
	double x1,x2,d,k;
	cin>>a>>b>>c;
	k=b*b-4*a*c;
	d=sqrt(k);
	x1=(-b+d)/(2*a);
	x2=(-b-d)/(2*a);
	if(x1>x2)
	{
		std::cout << std::fixed << std::setprecision(10) << x1 << std::endl;
		std::cout << std::fixed << std::setprecision(10) << x2 << std::endl;
	}
	else
		{
			std::cout << std::fixed << std::setprecision(10) << x2 << std::endl;
			std::cout << std::fixed << std::setprecision(10) << x1 << std::endl;
		}

	return 0;
}


#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cmath>
#include <iomanip>
using namespace std;
int main()
{
	long a,b,c;
	double x1,x2,d,k;
	cin>>a>>b>>c;
	k=b*b-4*a*c;
	d=sqrt(k);
	x1=(-b+d)/(2*a);
	x2=(-b-d)/(2*a);
	if(x1>x2)
	{
				std::cout << std::fixed << std::setprecision(10) << x1 << std::endl;
		std::cout << std::fixed << std::setprecision(10) << x2 << std::endl;
	}
	else
		{
			std::cout << std::fixed << std::setprecision(10) << x2 << std::endl;
			std::cout << std::fixed << std::setprecision(10) << x1 << std::endl;
		}

	return 0;
}


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

int main()
{
    double a,b,c;
    cin>>a>>b>>c;

    double b2 = b*b;
    double re = (b2-(4*a*c));
    double sq = sqrt(re);
    double x = ((-b)+sq);
    double y = ((-b)-sq);
    cout <<(x/(2*a))<<endl;
    cout<<(y/(2*a))<<endl;
    return 0;
}


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

int main()
{
    long double a,b,c;
    cin>>a>>b>>c;

    long double b2 = b*b;
    long double re = (b2-(4*a*c));
    long double sq = sqrt(re);
    long double x = ((-b)+sq);
    long double y = ((-b)-sq);

    if((x/(2*a))>(y/(2*a)))
    {
    cout<< fixed <<setprecision(15)<<(x/(2*a))<<endl;
    cout<< fixed <<setprecision(15)<<(y/(2*a))<<endl;
    }
    else
    {
    cout<< fixed <<setprecision(15)<<(y/(2*a))<<endl;
    cout<< fixed <<setprecision(15)<<(x/(2*a))<<endl;
    }

    return 0;
}


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

int main()
{
    long double a,b,c;
    cin>>a>>b>>c;

    long double b2 = b*b;
    long double re = (b2-(4*a*c));
    long double sq = sqrt(re);
    long double x = ((-b)+sq);
    long double y = ((-b)-sq);
    cout<< fixed <<setprecision(15)<<(x/(2*a))<<endl;
    cout<< fixed <<setprecision(15)<<(y/(2*a))<<endl;
    return 0;
}


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

int main()
{
    long double a,b,c;
    cin>>a>>b>>c;

    long double b2 = b*b;
    long double re = (b2-(4*a*c));
    long double sq = sqrt(re);
    long double x = ((-b)+sq);
    long double y = ((-b)-sq);
    cout <<(x/(2*a))<<endl;
    cout<<(y/(2*a))<<endl;
    return 0;
}


#include<iostream>
#include<math.h>
#include<stack>
#include<algorithm>
#include<iomanip>
using namespace std;
typedef long long ll;

int main()

{

	double a,b,c;
	cin>>a>>b>>c;
	double otv=((-1*b)+sqrt(b*b-4*a*c))/(2*a);
	double otv2=((-1*b)-sqrt(b*b-4*a*c))/(2*a);

	cout<<setprecision(20)<<max(otv,otv2)<<endl;
	cout<<setprecision(20)<<min(otv,otv2);

}


#include<iostream>
#include<math.h>
#include<stack>
#include<algorithm>
#include<iomanip>
using namespace std;
typedef long long ll;

int main()

{

	double a,b,c;
	cin>>a>>b>>c;
	double otv=((-1*b)+sqrt(b*b-4*a*c))/(2*a);

	cout<<setprecision(20)<< otv<<endl;
	otv=((-1*b)-sqrt(b*b-4*a*c))/(2*a);
	cout<<setprecision(20)<<otv;

}


#include <iostream>
#include <math.h>
#include <iomanip>
using namespace std;
int main()
{
    double a,b,c;
    cin >> a >> b >> c;
    int r = abs(a)/a;
    a*=r;
    b*=r;
    c*=r;
    c = sqrt(b*b-4*a*c);
    cout <<std::fixed <<setprecision(8) << (-b + c)/2/a << endl;
    cout <<setprecision(8) << (-b - c)/2/a << endl;

    return 0;
}


#include <iostream>
#include <math.h>
using namespace std;
int main()
{
    double a,b,c;
    cin >> a >> b >> c;
    int r = abs(a)/a;
    a*=r;
    b*=r;
    c*=r;
    c = sqrt(b*b-4*a*c);
    cout << (-b + c)/2/a << endl;
    cout << (-b - c)/2/a << endl;

    return 0;
}


#include<iostream>
#include<iomanip>
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<math.h>
#include<algorithm>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>

using namespace std;

FILE *stream;

struct coord
{
	int x, y;
};

struct robot
{
	int f, s, l;
};

typedef unsigned long long ull;
typedef short int int16;
typedef long double ld;
typedef long long ll;

typedef set<int> setint;

//typedef queue <coord> quec;

typedef stack<long long> staint;

typedef pair<int, int> pint;

typedef int tlong[10000];

typedef map<int, pint> mapa;

typedef pair<int, pair<int, int> > mpair;

const long long INFL = ll(1e18);
const int INF = int(1e9 + 1);
const int SIZE = int(3e3 + 2);
const long double eps = 0.00001;
const double pi = 3.141592653;

void include_files();
void solution();
ll nsd(ll a, ll b);
ll POW(ll z, int step)
{
	if (step == 1)
		return z;
	ld cur = POW(z, step / 2);
	cur *= cur;
	if (step % 2)
		cur *= z;
	return cur;
}

//scanf("%d", &a);
struct rob
{
	int s, len;
};

void solution()
{
	ld a, b, c, D, z = 1;
	cin >> a >> b >> c;
	D = b * b - 4 * a * c;
	z = a / abs(a);
	ld x1 = (-b + sqrt(D)) / (2.0 * a);
	ld x2 = (-b - sqrt(D)) / (2.0 * a);
	cout << fixed << setprecision(8) << max(x1, x2) << endl;
	cout << fixed << setprecision(8) << min(x1, x2) << endl;
}

ll nsd(ll a, ll b)
{
	return (a != 0) ? nsd(b % a, a) : b;
}

void include_files()
{
	freopen_s(&stream, "input.txt", "r", stdin);
	//freopen_s(&stream, "output.txt", "w", stdout);
}

int main()
{
	//srand(time(0));
	//include_files();
	solution();
	std::cout << endl;
	return 0;
}


#include<iostream>
#include<iomanip>
#include<stdio.h>
#include<stdlib.h>
#include<cmath>
#include<math.h>
#include<algorithm>
#include<string>
#include<stack>
#include<queue>
#include<vector>
#include<set>
#include<map>

using namespace std;

FILE *stream;

struct coord
{
	int x, y;
};

struct robot
{
	int f, s, l;
};

typedef unsigned long long ull;
typedef short int int16;
typedef long double ld;
typedef long long ll;

typedef set<int> setint;

//typedef queue <coord> quec;

typedef stack<long long> staint;

typedef pair<int, int> pint;

typedef int tlong[10000];

typedef map<int, pint> mapa;

typedef pair<int, pair<int, int> > mpair;

const long long INFL = ll(1e18);
const int INF = int(1e9 + 1);
const int SIZE = int(3e3 + 2);
const long double eps = 0.00001;
const double pi = 3.141592653;

void include_files();
void solution();
ll nsd(ll a, ll b);
ll POW(ll z, int step)
{
	if (step == 1)
		return z;
	ld cur = POW(z, step / 2);
	cur *= cur;
	if (step % 2)
		cur *= z;
	return cur;
}

//scanf("%d", &a);
struct rob
{
	int s, len;
};

void solution()
{
	ld a, b, c, D, z = 1;
	cin >> a >> b >> c;
	D = b * b - 4 * a * c;
	z = a / abs(a);
	cout << fixed << setprecision(8) << z * (-b + sqrt(D)) / 2.0 / a << endl;
	cout << fixed << setprecision(8) << z * (-b - sqrt(D)) / 2.0 / a << endl;
}

ll nsd(ll a, ll b)
{
	return (a != 0) ? nsd(b % a, a) : b;
}

void include_files()
{
	freopen_s(&stream, "input.txt", "r", stdin);
	//freopen_s(&stream, "output.txt", "w", stdout);
}

int main()
{
	//srand(time(0));
	//include_files();
	solution();
	std::cout << endl;
	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>

using namespace std;
typedef long long li;

const int MN = 100000+1;

int main(){
	int a, b, c;
	scanf("%d%d%d", &a, &b, &c);
	double d = sqrt(double(b*b-4*a*c));
	double x1, x2;
	x1 = (-b+d)/(2.0*a);
	x2 = (-b-d)/(2.0*a);
	printf("%0.10f\n%0.10f\n", x1,x2);

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>

using namespace std;
typedef long long li;

const int MN = 100000+1;

int main(){
	int a, b, c;
	scanf("%d%d%d", &a, &b, &c);
	double d = sqrt(double(b*b-4*a*c));
	double x1, x2;
	x1 = (-b*1.0+d)/(2.0*a);
	x2 = (-b*1.0-d)/(2.0*a);
	printf("%0.20f\n%0.20f\n", x1,x2);

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>

using namespace std;
typedef long long li;
typedef long double ld;

const int MN = 100000+1;

int main(){
	int a, b, c;
	scanf("%d%d%d", &a, &b, &c);
	ld d = sqrtl(ld(b*b-4*a*c));
	ld x1, x2;
	x1 = (-b*1.0+d)/(2.0*a);
	x2 = (-b*1.0-d)/(2.0*a);
	if(x1<x2){
		swap(x1,x2);
	}
	printf("%0.20f\n%0.20f\n", x1,x2);

	return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;

#define ll long long
#define MP make_pair

const int MAX_VALUE = 1e9 + 7;

int main() {
    int a = 0;
    int b = 0;
    int c = 0;

    cin >> a >> b >> c;

    int d = b * b - 4 * a * c;
    double x1 = (-b + sqrt(1.0 * d)) / (2 * a);
    double x2 = (-b - sqrt(1.0 * d)) / (2 * a);

    if (x1 > x2) {
        printf("%.6f\n", x1);
        printf("%.6f\n", x2);
    } else {
        printf("%.6f\n", x2);
        printf("%.6f\n", x1);
    }

    return 0;
}


#include <iostream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <cstdio>
#include <algorithm>
#include <cmath>
using namespace std;

#define ll long long
#define MP make_pair

const int MAX_VALUE = 1e9 + 7;

int main() {
    int a = 0;
    int b = 0;
    int c = 0;

    cin >> a >> b >> c;

    int d = b * b - 4 * a * c;
    double x1 = (-b + sqrt(1.0 * d)) / 2;
    double x2 = (-b - sqrt(1.0 * d)) / 2;

    printf("%.6f\n", x1);
    printf("%.6f\n", x2);
    return 0;
}


//#define _USE_MATH_DEFINES
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <iomanip>

using namespace std;

typedef long long LL;
typedef pair<int, int> pair_ii;
typedef pair<long long, long long> pair_LL;

#define fori(i, s, n) for (int i = s; i < n; ++i)
#define pb push_back
#define mp make_pair

LL const modul = 1;

LL mod_sum(LL x, LL y) {
	return (x + y) % modul;
}

LL mod_sub(LL x, LL y) {
	if (x > y) {
		return (x - y) % modul;
	}
	else {
		return (x + modul - y) % modul;
	}
}

LL mod_mpl(LL x, LL y) {
	return (x * y) % modul;
}

LL bin_pow(LL x, LL e) {
	if (e == 0) {
		return 1;
	}
	if (e == 1) {
		return x;
	}
	LL y = bin_pow(x, e / 2);
	y = y * y;
	if (e % 2 == 0) {
		return y;
	}
	else {
		return y * x;
	}
}

LL mod_rev(LL x) {
	return bin_pow(x, modul - 2);
}

LL mod_div(LL x, LL y) {
	return mod_mpl(x, mod_rev(y));
}

LL c_n(LL n, LL k) {
	LL ans = 1;
	fori(i, 1, k + 1) {
		ans *= n - i + 1;
		ans /= i;
	}
	return ans;
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	LL n;
	double a;
	double b;
	double c;
	cin >> a >> b >> c;
	double D = b * b - 4.0 * a * c;
	double ls = 0 - b - sqrt(D);
	ls /= 2.0 * a;
	double mr = 0 - b + sqrt(D);
	mr /= 2.0 * a;
	cout << fixed;
	cout << setprecision(6);
	cout << mr << endl;
	cout << ls;
	return 0;
}


//#define _USE_MATH_DEFINES
#include <iostream>
#include <vector>
#include <string>
#include <math.h>
#include <algorithm>
#include <iomanip>

using namespace std;

typedef long long LL;
typedef pair<int, int> pair_ii;
typedef pair<long long, long long> pair_LL;

#define fori(i, s, n) for (int i = s; i < n; ++i)
#define pb push_back
#define mp make_pair

LL const modul = 1;

LL mod_sum(LL x, LL y) {
	return (x + y) % modul;
}

LL mod_sub(LL x, LL y) {
	if (x > y) {
		return (x - y) % modul;
	}
	else {
		return (x + modul - y) % modul;
	}
}

LL mod_mpl(LL x, LL y) {
	return (x * y) % modul;
}

LL bin_pow(LL x, LL e) {
	if (e == 0) {
		return 1;
	}
	if (e == 1) {
		return x;
	}
	LL y = bin_pow(x, e / 2);
	y = y * y;
	if (e % 2 == 0) {
		return y;
	}
	else {
		return y * x;
	}
}

LL mod_rev(LL x) {
	return bin_pow(x, modul - 2);
}

LL mod_div(LL x, LL y) {
	return mod_mpl(x, mod_rev(y));
}

LL c_n(LL n, LL k) {
	LL ans = 1;
	fori(i, 1, k + 1) {
		ans *= n - i + 1;
		ans /= i;
	}
	return ans;
}

int main() {
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	LL n;
	double a;
	double b;
	double c;
	cin >> a >> b >> c;
	if (a < 0) {
		a *= 0.0 - 1.0;
		b *= 0.0 - 1.0;
		c *= 0.0 - 1.0;
	}
	double D = b * b - 4.0 * a * c;
	double ls = 0 - b - sqrt(D);
	ls /= 2.0 * a;
	double mr = 0 - b + sqrt(D);
	mr /= 2.0 * a;
	cout << fixed;
	cout << setprecision(7);
	cout << mr << endl;
	cout << ls;
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <math.h>

using namespace std;

int main (void) {
	double a,b,c,D,x1,x2;
	scanf("%lf", &a);
	scanf("%lf", &b);
	scanf("%lf", &c);
	D = b*b-4*a*c;
	x2=((-1)*sqrt(D) -b)/(a*2);
	x1=(sqrt(D) -b)/(a*2);
	if (x1>x2) swap(x1,x2);
	printf("%0.10f\n%0.10f",x2,x1);
	return 0;
}


#include <stdio.h>
#include <stdlib.h>
#include <string>
#include <iostream>
#include <math.h>

using namespace std;

int main (void) {
	float a,b,c,D,x1,x2;
	scanf("%f", &a);
	scanf("%f", &b);
	scanf("%f", &c);
	D = b*b-4*a*c;
	x2=((-1)*sqrt(D) -b)/(a*2);
	x1=(sqrt(D) -b)/(a*2);
	if (x1>x2) swap(x1,x2);
	printf("%0.7f\n%0.7f",x2,x1);
	return 0;
}


#include<iostream>
#include<iomanip>
#include<cmath>
#include<math.h>
using namespace std;
int main(){
	long double a,b,c;
	freopen("a.in","r",stdin);
	cin>>a>>b>>c;
	cout<<fixed<<setprecision(6)<<(-b+sqrt(b*b-4*a*c))/(2*a)<<endl;
	cout<<fixed<<setprecision(6)<<(-b-sqrt(b*b-4*a*c))/(2*a)<<endl;
	return 0;
}


#include<iostream>
#include<iomanip>
using namespace std;
int main(){
	long double a,b,c;
	freopen("a.in","r",stdin);
	cin>>a>>b>>c;
	cout<<fixed<<setprecision(6)<<(-b+sqrt(b*b-4*a*c))/(2*a)<<endl;
	cout<<fixed<<setprecision(6)<<(-b-sqrt(b*b-4*a*c))/(2*a)<<endl;
	return 0;
}


#include<iostream>
#include<iomanip>
#include<cmath>
#include<math.h>
using namespace std;
int main(){
	long double a,b,c,x,y;
	cin>>a>>b>>c;
	x=(-b+sqrt(b*b-4*a*c))/(2*a);
	y=(-b-sqrt(b*b-4*a*c))/(2*a);
	cout<<fixed<<setprecision(6)<<((x>=y)?x:y)<<endl;
	cout<<fixed<<setprecision(6)<<(y>x?x:y)<<endl;
	return 0;
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<queue>
#include<vector>
#include<iostream>
#include<algorithm>
#include<bitset>
#include<functional>
using namespace std;
typedef unsigned long long ull;
typedef long long LL;
const int maxn = 105;
const int low(int x){ return x&-x; }
const double PI = acos(-1.0);
__int64 power(__int64 a, int n)
{
	__int64 ans = 1;
	while(n)
	{
		if(n & 1)
			ans = ans * a;
		n >>= 1;
		a = a * a;
	}
	return ans;
}
int main()
{
	double a, b, c;
	scanf("%lf%lf%lf", &a, &b, &c);
	double x1, x2;
	x1 = (-b - sqrt(b * b - 4 * a *c)) / (2 * a);
	x2 = (-b + sqrt(b * b - 4 * a *c)) / (2 * a);
	printf("%lf\n%lf\n", x2, x1);
}


#include<cstdio>
#include<cstring>
#include<cmath>
#include<queue>
#include<vector>
#include<iostream>
#include<algorithm>
#include<bitset>
#include<functional>
using namespace std;
typedef unsigned long long ull;
typedef long long LL;
const int maxn = 105;
const int low(int x){ return x&-x; }
const double PI = acos(-1.0);
__int64 power(__int64 a, int n)
{
	__int64 ans = 1;
	while(n)
	{
		if(n & 1)
			ans = ans * a;
		n >>= 1;
		a = a * a;
	}
	return ans;
}
int main()
{
	double a, b, c;
	scanf("%lf%lf%lf", &a, &b, &c);
	double x1, x2;
	x1 = (-b - sqrt(b * b - 4 * a *c)) / (2 * a);
	x2 = (-b + sqrt(b * b - 4 * a *c)) / (2 * a);
	printf("%lf\n%lf\n", max(x2, x1), min(x2, x1));
}


#pragma comment(linker, "/STACK:268435456")

#include<iostream>
#include<cstdio>

#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<deque>
#include<stack>

#include<iomanip>
#include<memory.h>
#include<algorithm>
#include<cstring>
#include<ctime>
#include<cmath>
#include<cassert>

using namespace std;

#define forn(i, n) for(int i = 0; i < (int)(n); ++i)
#define for1(i, n) for(int i = 1; i < (int)(n); ++i)
#define forr(i, n) for(int i = int(n) - 1; i >= 0; --i)
#define fore(i, a, b) for(int i = int(a); i <= int(b); ++i)
#define correct(x, y, n, m) (0 <= x && x < n && 0 <= y && y < m)
#define X first
#define Y second
#define all(a) a.begin(), a.end()
#define pb push_back
#define mp make_pair
#define sz(v) (int)(v.size())
#define hash archash
#define next arcnext
#define link arclink
#define y0 arcy0
#define y1 arcy1
#define log2 arclog2
//#define best arcbest

template<typename T> inline T abs(T a){ return ((a < 0) ? -a : a); }
template<typename T> inline T sqr(T a){ return a * a; }
template<class T> T gcd(T a, T b) { return a ? gcd (b % a, a) : b; }
template<class T> T lcm(T a, T b) { return a / gcd (a, b) * b; }
template<class T> T sign(T a) { return a > 0 ? 1 : (a < 0 ? -1 : 0); }

typedef long long li;
typedef unsigned long long uli;
typedef long double ld;
typedef pair <int, int> pt;
typedef vector <int> vi;
typedef vector <vector <int> > vvi;
typedef vector <pair <int, int> > vpt;

const int dx[] = {-1, 0, 1,  0};
const int dy[] = { 0, 1, 0, -1};
const int dxK[] = {-1, -1, 0, 1, 1,  1,  0, -1};
const int dyK[] = { 0,  1, 1, 1, 0, -1, -1, -1};
const int dxKn[] = {-2, -1, 1, 2,  2,  1, -1, -2};
const int dyKn[] = { 1,  2, 2, 1, -1, -2, -2, -1};

const int N = int(1e5) + 9;
const int M = int(3e3) + 9;
const int LOGN = 22;
const int SQN = 350;
const int MOD = int(1e9) + 7;
const int INF = 1e9 + 100;
const li INF64 = 2e18;
const ld PI = 3.1415926535897932384626433832795;
const ld EPS = 1e-9;

int a, b, c;

void solve(){
	cin >> a >> b >> c;
	ld d = b * b - 4 * a * c;
	assert(d > 0);
	cout << max((-b + sqrt(d)) / ld(2 * a), (-b - sqrt(d)) / ld(2 * a)) << ' ' << min((-b + sqrt(d)) / ld(2 * a), (-b - sqrt(d)) / ld(2 * a)) << endl;
}

int main(){
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

    srand(time(NULL));
    cout << setprecision(10) << fixed;
    cerr << setprecision(10) << fixed;
	ios_base::sync_with_stdio(0);

    solve();

    return 0;
}


#include <bits/stdc++.h>
using namespace std;
int t;
int main()
{
	cin>>t;
	while(t--)
	{
		int n,cnt=0;
		cin>>n;
		int v[150005];
		for(int i=0;i<n;i++)
			cin>>v[i];
		int minn=v[n-1];
		for(int i=n-1;i>=0;i--)
		{
			if (v[i]>minn)
				++cnt;
			else if (v[i]<minn)
				minn=v[i];
		}
		cout<<cnt<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
int t;
int main()
{
	cin>>t;
	while(t--)
	{
		int n,cnt=0;
		cin>>n;
		vector<int> v,p;
		for(int i=0;i<n;i++)
		{
			int a;
			cin>>a;
			v.push_back(a);
		}
		for(int i=0;i<n;i++)
		{
			p=v;
			sort(p.begin(),p.end());
			if (v[i]!=p[0])
				++cnt;
			v[i]=999999;
		}
		cout<<cnt<<endl;
	}
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
long long t;
int main()
{
	cin>>t;
	while(t--)
	{
		long long n,cnt=0;
		cin>>n;
		vector<long long> v,p;
		for(long long i=0;i<n;i++)
		{
			long long a;
			cin>>a;
			v.push_back(a);
		}
		for(int i=0;i<n;i++)
		{
			p=v;
			sort(p.begin(),p.end());
			if (v[i]!=p[0])
				++cnt;
			v[i]=999999;
		}
		cout<<cnt<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
using namespace std;
const int maxn=1e6;
int a[maxn];
int main()
{
	//ios::sync_with_stdio(false);
	int t;
    int ans;
	int n,k;
	scanf("%d",&t);
	while(t--)
	{
		ans=0;
		memset(a,0,sizeof(a));
		scanf("%d",&n);
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		k=a[n];
		for(int i=n;i>=1;i--)
		{
			k=min(k,a[i]);
			if(a[i]>k)
			 ans++;
		}
		printf("%d\n",ans);
	}
	return 0;
}


#include<bits/stdc++.h>
#include<cstdio>
#include<cstring>
using namespace std;
const int maxn=1e6;
int a[maxn];
int main()
{
	//ios::sync_with_stdio(false);
	int t;
    int ans;
	int n,k;
	scanf("%d",&t);
	while(t--)
	{
		ans=0;
		//memset(a,0,sizeof(a));
		scanf("%d",&n);
		for(int i=1;i<=n;i++)
		{
			scanf("%d",&a[i]);
		}
		k=a[n];
		for(int i=n;i>=1;i--)
		{
			k=min(k,a[i]);
			if(a[i]>k)
			 ans++;
		}
		printf("%d\n",ans);
	}
	return 0;
}


#include<bits/stdc++.h>
#include<cstring>
using namespace std;
const int maxn=1e6;
int a[maxn];
int main()
{
	ios::sync_with_stdio(false);
	int t;
    int ans;
	int n,k;
	cin>>t;
	while(t--)
	{
		ans=0;
		memset(a,0,sizeof(a));
		cin>>n;
		for(int i=1;i<=n;i++)
		{
			cin>>a[i];
		}
		k=a[n];
		for(int i=n-1;i>=1;i--)
		{
			k=min(k,a[i]);
			if(a[i]>k)
			 ans++;
		}
		cout<<ans<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
#include<cstring>
using namespace std;
const int maxn=1e6;
int a[maxn];
int main()
{
	ios::sync_with_stdio(false);
	int t;
    int ans;
	int n,k;
	cin>>t;
	while(t--)
	{
		ans=0;
		memset(a,0,sizeof(a));
		cin>>n;
		for(int i=1;i<=n;i++)
		{
			cin>>a[i];
		}
		k=a[n];
		for(int i=n;i>=1;i--)
		{
			k=min(k,a[i]);
			if(a[i]>k)
			 ans++;
		}
		cout<<ans<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
#include<cstring>
using namespace std;
const int maxn=1e6;
int a[maxn];
int main()
{
	int t;
    int ans;
	int n,k;
	cin>>t;
	while(t--)
	{
		ans=0;
		memset(a,0,sizeof(a));
		cin>>n;
		for(int i=1;i<=n;i++)
		{
			cin>>a[i];
		}
		k=a[n];
		for(int i=n-1;i>=1;i--)
		{
			k=min(k,a[i]);
			if(a[i]>k)
			 ans++;
		}
		cout<<ans<<endl;
	}
	return 0;
}


#include<bits/stdc++.h>
#include<cstring>
using namespace std;
const int maxn=1e5;
int a[maxn];
int main()
{
	int t;
    int ans;
	int n,k;
	cin>>t;
	while(t--)
	{
		ans=0;
		memset(a,0,sizeof(a));
		cin>>n;
		for(int i=1;i<=n;i++)
		{
			cin>>a[i];
		}
		k=a[n];
		for(int i=n-1;i>=1;i--)
		{
			k=min(k,a[i]);
			if(a[i]>k)
			 ans++;
		}
		cout<<ans<<endl;
	}
	return 0;
}


#include <iostream>
using namespace std;
int main(){
	long long t;
	cin >> t;
	for(long long j = 0; j < t; j++){
			long long n;
		cin >> n;
		long long a[n];
		for(long long i = 0; i < n; i++){
			cin >> a[i];
		}
		long long cnt=0;
		for(long long i = 0; i < n; i++){
			for(long long z = i; z < n; z++){
				if(a[i]>a[z]){
					cnt++;
					break;
				}
			}
		}
		cout<<cnt<<endl;
	}

}


#include <iostream>
using namespace std;
int main(){
	int t;
	cin >> t;
	for(int j = 0; j < t; j++){
			long long n;
		cin >> n;
		long long a[n];
		for(long long i = 0; i < n; i++){
			cin >> a[i];
		}
		int cnt=0;
		for(long long i = 0; i < n; i++){
			for(long long z = i; z < n; z++){
				if(a[i]>a[z]){
					cnt++;
					break;
				}
			}
		}
		cout<<cnt<<endl;
	}

}


#include <iostream>
using namespace std;
int main(){
	int t;
	cin >> t;
	for(int j = 0; j < t; j++){
			long long n;
		cin >> n;
		long long a[n];
		for(long long i = 0; i < n; i++){
			cin >> a[i];
		}
		long long cnt=0;
		for(long long i = 0; i < n; i++){
			for(long long z = i; z < n; z++){
				if(a[i]>a[z]){
					cnt++;
					break;
				}
			}
		}
		cout<<cnt<<endl;
	}

}


#include <iostream>
using namespace std;
int main(){
	int q;
	cin >> q;
	while(q--){
		int n;
		cin >> n;
		int a[n];
		for(int i = 0; i < n; i++){
			cin >> a[i];
		}
		int cnt=0;
		int min=a[n-1];
		for(int i = n-2; i >=0; i--){
			if(a[i]>min){
				cnt++;
				continue;
			}else{
				min=a[i];
			}
		}
		cout<<cnt<<endl;
	}
}


#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int T,n,a[150001],sum[1000010],m;
int lowbit(int x){
	return x&(-x);
}
void update(int i,int v){
	for (int k=i;k<=m;k+=lowbit(k)) sum[k]+=v;
}
int getsum(int i){
	int res = 0;
	for (int k=i;k>0;k-=lowbit(k)) res+=sum[k];
	return res;
}
int main(){

	scanf("%d",&T);
	while (T--){
		memset(sum,0,sizeof(sum));
		int ans = 0;
		m = 0;
		scanf("%d",&n);
		for (int i=1;i<=n;i++) scanf("%d",&a[i]),m=max(m,a[i]);
		for (int i=n;i>=1;i--){
			int k = getsum(a[i]);
			if (k>0) ans++;
			// cout<<a[i]<<" "<<k<<endl;
			update(a[i],1);
		}
		cout<<ans<<endl;
		// for (int i=1;i<=10;i++) cout<<sum[i]<<" ";
	}
}


#include<cstdio>
#include<algorithm>
using namespace std;
struct node{
	int rk,key;
}a[150010];
int T,n,v[150010];
bool cmp(node x,node y){
	return x.key<y.key;
}
int main(){
	scanf("%d",&T);
	while (T--){
		int ans = 0;
		scanf("%d",&n);
		for (int i=1;i<=n;i++) scanf("%d",&a[i].key),a[i].rk=i;
		sort(a+1,a+1+n,cmp);
		v[1] = a[1].rk;
		for (int i=2;i<=n;i++){
			v[i]= max(v[i-1],a[i].rk);
			if (v[i]>a[i].rk) ans++;
		}
		printf("%d\n",ans);
	}
}


#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int T,n,a[150001],sum[1000010],m;
int lowbit(int x){
	return x&(-x);
}
void update(int i,int v){
	for (int k=i;k<=m;k+=lowbit(k)) sum[k]+=v;
}
int getsum(int i){
	int res = 0;
	for (int k=i;k>0;k-=lowbit(k)) res+=sum[k];
	return res;
}
int main(){

	scanf("%d",&T);
	while (T--){
		memset(sum,0,sizeof(sum));
		int ans = 0;
		m = 0;
		scanf("%d",&n);
		for (int i=1;i<=n;i++) scanf("%d",&a[i]),m=max(m,a[i]);
		for (int i=n;i>=1;i--){
			int k = getsum(a[i]);
			if (k>0) ans++;
			// cout<<a[i]<<" "<<k<<endl;
			update(a[i],1);
		}
		// cout<<ans<<endl;
		printf("%d\n",ans);
		// for (int i=1;i<=10;i++) cout<<sum[i]<<" ";
	}
}


#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int T,n,a[150001],sum[1000010],m;
int lowbit(int x){
	return x&(-x);
}
void update(int i,int v){
	for (int k=i;k<=m;k+=lowbit(k)) sum[k]+=v;
}
bool getsum(int i){
	for (int k=i;k>0;k-=lowbit(k)) if (sum[k]) return true;
	return false;
}
int main(){

	scanf("%d",&T);
	while (T--){
		memset(sum,0,sizeof(sum));
		int ans = 0;
		m = 0;
		scanf("%d",&n);
		for (int i=1;i<=n;i++) scanf("%d",&a[i]),m=max(m,a[i]);
		for (int i=n;i>=1;i--){
			if (getsum(a[i])) ans++;
			// cout<<a[i]<<" "<<k<<endl;
			update(a[i],1);
		}
		// cout<<ans<<endl;
		printf("%d\n",ans);
		// for (int i=1;i<=10;i++) cout<<sum[i]<<" ";
	}
}


#include<cstdio>
#include<algorithm>
using namespace std;
struct node{
	int rk,key;
}a[150010];
int T,n,v[150010];
bool cmp(node x,node y){
	return x.key<y.key;
}
int main(){
	freopen("1.in","r",stdin);
	scanf("%d",&T);
	while (T--){
		int ans = 0;
		scanf("%d",&n);
		for (int i=1;i<=n;i++) scanf("%d",&a[i].key),a[i].rk=i;
		sort(a+1,a+1+n,cmp);
		v[1] = a[1].rk;
		for (int i=2;i<=n;i++){
			v[i]= max(v[i-1],a[i].rk);
			if (v[i]>a[i].rk) ans++;
		}
		printf("%d\n",ans);
	}
}


#include<iostream>
#include<cstring>
#include<cstdio>
using namespace std;
int T,n,a[150001],sum[1000010],m;
int lowbit(int x){
	return x&(-x);
}
void update(int i,int v){
	for (int k=i;k<=m;k+=lowbit(k)) sum[k]+=v;
}
int getsum(int i){
	int res = 0;
	for (int k=i;k>0;k-=lowbit(k)) res+=sum[k];
	return res;
}
int main(){
	freopen("1.in","r",stdin);
	scanf("%d",&T);
	while (T--){
		memset(sum,0,sizeof(sum));
		int ans = 0;
		m = 0;
		scanf("%d",&n);
		for (int i=1;i<=n;i++) scanf("%d",&a[i]),m=max(m,a[i]);
		for (int i=n;i>=1;i--){
			int k = getsum(a[i]);
			if (k>0) ans++;
			// cout<<a[i]<<" "<<k<<endl;
			update(a[i],1);
		}
		cout<<ans<<endl;
		// for (int i=1;i<=10;i++) cout<<sum[i]<<" ";
	}
}


#include <bits/stdc++.h>
using namespace std;
int a[150100];
int main(){
    int t;
    cin >> t;
    while(t--){
        int n;
        cin >> n;
        for(int i = 1; i <= n; i++) cin >> a[i];
        int m = a[n], cnt = 0;
        for(int i = n - 1; i; i--){
            if(a[i] > m) cnt++;
            if(a[i] < m) m = a[i];
        }
        cout << cnt << endl;
    }
    return 0;
}//2020-09-05 17:54:36.635


#include<iostream>
#include<algorithm>
using namespace std;
int str[150005];
int main()
{
    int k;
    cin>>k;
    while(k--)
    {
        int n;
        cin>>n;
        for(int a=0; a<n; a++)
        {
            cin>>str[a];
        }
        int ann=1000001,sum=0;
        for(int b=n-1; b>=0; b--)
        {
            if(str[b]<ann)
            {
                ann=str[b];
                sum++;
            }
            else if(str[b]==ann)
                sum--;
        }
        cout<<n-sum<<endl;
    }
}//2019-11-09 20:20:14.606


#include <iostream>

using namespace std;

int a[150005];

int main()
{
    int t;

    cin >> t;

    while(t--)
    {
        int n;

        cin >> n;

        for(int i = 0;i < n;i++)
        {
            cin >> a[i];
        }

        int x = a[n-1];
        int res = 0;

        for(int i=n-1;i>=0;i--)
        {
            if(x < a[i-1])
                res++;
            x = min(x,a[i-1]);
        }

        cout << res << endl;
    }

    return 0;
}
//2019-11-12 21:05:20.436


#include<bits/stdc++.h>
using namespace std;
int a[500005];
int main()
{
    int t;
    scanf("%d",&t);
    while(t--)
    {
        int n;
        scanf("%d",&n);
        for(int i=1;i<=n;i++)
            scanf("%d",&a[i]);
        int min=a[n],ans=0;
        for(int i=n-1;i>=1;i--)
        {
            if(a[i]>min)
                ans++;
            else
            {
                min=a[i];
            }
        }
        printf("%d\n",ans);
    }
    return 0;
}//2019-11-15 19:07:48.044


#include<bits/stdc++.h>
using namespace std;
long long t;
void solve()
{
    while(t--)
    {
        long long i,n,ans=0;
        scanf("%lld",&n);
        vector < long long > a(n),b(n);
        for (i=0;i<n;i++)
        {
            scanf("%lld",&a[i]);
            b[i]=a[i];
        }
        if (n==1) printf("0\n");
        else
        {
            for (i=n-2;i>=0;i--)
                b[i]=min(b[i],b[i+1]);
            for (i=0;i<n;i++)
                if (a[i]>b[i]) ans++;
            printf("%lld\n",ans);
        }
    }
}
int main()
{
    while(~scanf("%lld",&t))
        solve();
}//2019-12-31 17:18:37.112


#include <bits/stdc++.h>

using namespace std;

int main()
{

    int t;
    cin >> t;
    while(t--)
    {
        long long n;
        cin >> n;
        long long a[n];
        for(int i=0;i<n;i++)
            cin >> a[i];
        long long bad=0;
        for(int i=0;i<n-1;i++)
        {
            for(int j=i+1;j<n;j++)
            {
                if(a[j]<a[i])
                {
                    bad++;
                    break;
                }
            }
        }
        cout << bad <<endl;

    }
    return 0;


#include <bits/stdc++.h>

using namespace std;

int main()
{

    int t;
    cin >> t;
    while(t--)
    {
        long long n;
        cin >> n;
        long long a[n];
        for(int i=0;i<n;i++)
            cin >> a[i];
        long long ans=0;
        long long mn=INT_MAX;
        for(int i=n-1;i>=0;i--)
        {
            if(a[i]>mn)
            {
                ans++;
            }
            mn=min(mn,a[i]);
        }
        cout << ans<<endl;
    }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{

    int t;
    cin >> t;
    while(t--)
    {
        long long n;
        cin >> n;
        long long a[n];
        for(int i=0;i<n;i++)
            cin >> a[i];
        long long bad=0;
        for(int i=0;i<n-1;i++)
        {
            for(int j=i+1;j<n;j++)
            {
                if(a[j]<a[i])
                {
                    bad++;
                    break;
                }
            }
        }
        cout << bad <<endl;

    }
    return 0;
}


#include<iostream>
using namespace std;
int main(){

long long int  i,ar[100009]={0},t,v,n;
cin>>t;
while(t--)
{
    int r=0;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>ar[i];
    }
    v=ar[n-1];
    for(i=n-1;i>=0;i--)
    {
        if(v<ar[i])
        r++;
        else
        v=ar[i];
    }
    cout<<r<<endl;
}

}


#include<iostream>
using namespace std;
int main(){

long long int  i,ar[150009]={0},t,v,n;
cin>>t;
while(t--)
{
    int r=0;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>ar[i];
    }
    v=ar[n-1];
    for(i=n-1;i>=0;i--)
    {
        if(v<ar[i])
        r++;
        else
        v=ar[i];
    }
    cout<<r<<endl;
}

}


#include<iostream>
using namespace std;
int main(){

int  i,ar[100009]={0},t,v,n;
cin>>t;
while(t--)
{
    int r=0;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>ar[i];
    }
    v=ar[n-1];
    for(i=n-1;i>=0;i--)
    {
        if(v<ar[i])
        r++;
        else
        v=ar[i];
    }
    cout<<r<<endl;
}

}


///**********ALLAH IS ALMIGHTY************///
///AH Tonmoy
///Department of CSE
///Islamic University,Bangladesh
#include<iostream>
using namespace std;
int main(){

long long int  i,ar[150009]={0},t,v,n;
cin>>t;
while(t--)
{
    int r=0;
    cin>>n;
    for(i=0;i<n;i++)
    {
        cin>>ar[i];
    }
    v=ar[n-1];
    for(i=n-1;i>=0;i--)
    {
        if(v<ar[i])
        r++;
        else
        v=ar[i];
    }
    cout<<r<<endl;
}

}


#include <iostream>
#include <vector>
#include <stack>

using namespace std;
  vector <int> prices;
  stack <int> menor;
void Menor(int n)
{
    int men=prices[n-1];
    menor.push(n-1);
    for(int i=n-2;i>=0;--i)
    {
      if(men > prices[i])
      {
          men=prices[i];
          menor.push(i);
      }
    }
}

int main()
{
    int t,n,bp,pre;
    cin>>t;
    for(int i=0;i<t;++i)
    {
        bp=0;
        cin>>n;
        for(int j=0;j<n;++j)
        {
            cin>>pre;
            prices.push_back(pre);
        }
        Menor(n);
        for(int j=0;j<n;++j)
        {
        	if(!menor.empty())
        	{

    	        if(j>= menor.top())
       		    {
            	    menor.pop();
            	    --j;
                	continue;
            	}
            	if(prices[j]>prices[menor.top()])
            	{
            	    bp++;
            	}
            }
            else
            	break;
        }
        cout<<bp<<endl;
        prices.clear();
    }
    return 0;
}


#include <iostream>
#include <vector>

using namespace std;
vector <int> prices;
int N;
int Menor(int i)
{
    int men;
    int pos=i;
    if(i<N)
    	men=pole[i];
    else
    	return N-1;
    for(int j=i+1;j<N;++j)
    {
        if(men>prices[j])
        {
            men=prices[j];
            pos=j;
        }
    }
    return men;
}
int main()
{
    int t,men,bp;
    cin>>t;
    for(int i=0;i<t;++i)
    {
        bp=0;
        cin>>N;
        for(int j=0;j<N;++j)
        {
            cin>>men;
            prices.push_back(men);
        }
        men=Menor(0);
        for(int j=0;j<N;++j)
        {
            if(men==j)
                men=Menor(j+1);
            if(prices[j]>prices[men])
                ++bp;
        }
        cout<<bp<<endl;
        prices.clear();
    }
}


#include <iostream>
#include <vector>

using namespace std;

int N;
int Menor(int i,vector <int> prices)
{
    int men,pos;
    if(i<N)
    {
        pos=i;
        men=prices[i];
    }
    else
    	return N-1;
    for(int j=i+1;j<N;++j)
    {
        if(men>prices[j])
        {
            men=prices[j];
            pos=j;
        }
    }
    return pos;
}
int main()
{
    int t,men,bp;
    vector <int> prices;
    cin>>t;
    for(int i=0;i<t;++i)
    {
        bp=0;
        cin>>N;
        for(int j=0;j<N;++j)
        {
            cin>>men;
            prices.push_back(men);
        }
        men=Menor(0,prices);
        for(int j=0;j<N;++j)
        {
            if(men==j)
                men=Menor(j+1,prices);
            if(prices[j]>prices[men])
                ++bp;
        }
        cout<<bp<<endl;
        prices.clear();
    }
}


#include <iostream>
#include <vector>

using namespace std;
  vector <int> prices;
int Menor(int i,int n)
{
    int menor=prices[i];
    int pos=i;
    for(++i;i<n;++i)
    {
        if(prices[i]<menor)
        {
            menor=prices[i];
            pos=i;
        }
    }
    return pos;
}

int main()
{
    int t,n,bp,pre;
    int menor;
    cin>>t;
    for(int i=0;i<t;++i)
    {
        bp=0;
        cin>>n;
        for(int j=0;j<n;++j)
        {
            cin>>pre;
            prices.push_back(pre);
        }
        menor=Menor(0,n);
        for(int j=0;j<n;++j)
        {
            if(i>=menor)
                menor=Menor(j+1,n);
            if(prices[i]>prices[menor])
                ++bp;
        }
        cout<<bp<<endl;
        prices.clear();
    }
    return 0;
}


#include <iostream>
#include <vector>

using namespace std;
vector <int> prices;
int N;
int Menor(int i)
{
    int men=prices[i];
    int pos=i;
    for(int j=i+1;j<N;++j)
    {
        if(men>prices[j])
        {
            men=prices[j];
            pos=j;
        }
    }
    return men;
}
int main()
{
    int t,men,bp;
    cin>>t;
    for(int i=0;i<t;++i)
    {
        bp=0;
        cin>>N;
        for(int j=0;j<N;++j)
        {
            cin>>men;
            prices.push_back(men);
        }
        men=Menor(0);
        for(int j=0;j<N;++j)
        {
            if(men==j)
                men=Menor(j+1);
            if(prices[j]>prices[men])
                ++bp;
        }
        cout<<bp<<endl;
        prices.clear();
    }
}


#include <iostream>
#include <vector>

using namespace std;
vector <int> prices;
int N;
int Menor(int i)
{
    int men;
    int pos=i;
    if(i<N)
    	men=i;
    else
    	return N-1;
    for(int j=i+1;j<N;++j)
    {
        if(men>prices[j])
        {
            men=prices[j];
            pos=j;
        }
    }
    return men;
}
int main()
{
    int t,men,bp;
    cin>>t;
    for(int i=0;i<t;++i)
    {
        bp=0;
        cin>>N;
        for(int j=0;j<N;++j)
        {
            cin>>men;
            prices.push_back(men);
        }
        men=Menor(0);
        for(int j=0;j<N;++j)
        {
            if(men==j)
                men=Menor(j+1);
            if(prices[j]>prices[men])
                ++bp;
        }
        cout<<bp<<endl;
        prices.clear();
    }
}


#include <iostream>
#include <vector>

using namespace std;
int main()
{
    int t,n,bp,pre;
    vector <int> prices;
    cin>>t;
    for(int i=0;i<t;++i)
    {
        bp=0;
        cin>>n;
        for(int j=0;j<n;++j)
        {
            cin>>pre;
            prices.push_back(pre);
        }
        for(int j=0;j<n;++j)
        {
            for(int k=j+1;k<n;++k)
                if(prices[j]>prices[k])
                {
                    ++bp;
                    break;
                }
        }
        cout<<bp<<endl;
        prices.clear();
    }
    return 0;
}


#include <iostream>
#include <vector>

using namespace std;
vector <int> prices;
int N;
int Menor(int i)
{
    int men;
    int pos=i;
    if(i<N)
    	men=prices[i];
    else
    	return N-1;
    for(int j=i+1;j<N;++j)
    {
        if(men>prices[j])
        {
            men=prices[j];
            pos=j;
        }
    }
    return men;
}
int main()
{
    int t,men,bp;
    cin>>t;
    for(int i=0;i<t;++i)
    {
        bp=0;
        cin>>N;
        for(int j=0;j<N;++j)
        {
            cin>>men;
            prices.push_back(men);
        }
        men=Menor(0);
        for(int j=0;j<N;++j)
        {
            if(men==j)
                men=Menor(j+1);
            if(prices[j]>prices[men])
                ++bp;
        }
        cout<<bp<<endl;
        prices.clear();
    }
}


#include <iostream>
#include <vector>

using namespace std;
  vector <int> prices;
int Menor(int i,int n)
{
    int menor=prices[i];
    int pos=i;
    for(++i;i<n;++i)
    {
        if(prices[i]<menor)
        {
            menor=prices[i];
            pos=i;
        }
    }
    return pos;
}

int main()
{
    int t,n,bp,pre;
    int menor;
    cin>>t;
    for(int i=0;i<t;++i)
    {
        bp=0;
        cin>>n;
        for(int j=0;j<n;++j)
        {
            cin>>pre;
            prices.push_back(pre);
        }
        menor=Menor(0,n);
        for(int j=0;j<n;++j)
        {
            if(i>=menor)
                menor=Menor(i,n);
            if(prices[i]>prices[menor])
                ++bp;
        }
        cout<<bp<<endl;
        prices.clear();
    }
    return 0;
}


#include <iostream>
#include <vector>

using namespace std;
  vector <int> prices;
int Menor(int i,int n)
{
    int menor=prices[i];
    int pos=i;
    for(++i;i<n;++i)
    {
        if(prices.[i]<menor)
        {
            menor=prices.[i];
            pos=i;
        }
    }
    return pos;
}

int main()
{
    int t,n,bp,pre;
    int menor;
    cin>>t;
    for(int i=0;i<t;++i)
    {
        bp=0;
        cin>>n;
        for(int j=0;j<n;++j)
        {
            cin>>pre;
            prices.push_back(pre);
        }
        menor=Menor(0,n);
        for(int j=0;j<n;++j)
        {
            if(i=>menor)
                menor=Menor(i,n);
            if(prices[i]>prices[menor])
                ++bp;
        }
        cout<<bp<<endl;
        prices.clear();
    }
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define max_char 26
//#define endl '\n'
string remove_space(string str)
{
    std::string::iterator end_pos = std::remove(str.begin(), str.end(), ' ');
str.erase(end_pos, str.end());
return str;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin>>t;
    while(t--)
    {
        ll n;
        cin>>n;
        ll a[n],sum=0,ans=0;
        for(ll i=0;i<n;i++)
        {
            cin>>a[i];
        }
        int m=a[n-1];
        for(int i=n-1;i>0;i--)
        {
            if(a[i-1]<m)
            {
                m=a[i-1];
            }
            else
                ans++;
        }
        cout<<ans<<"\n";
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define max_char 26
//#define endl '\n'
string remove_space(string str)
{
    std::string::iterator end_pos = std::remove(str.begin(), str.end(), ' ');
str.erase(end_pos, str.end());
return str;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin>>t;
    while(t--)
    {
        ll n;
        cin>>n;
        ll a[n],sum=0,ans=0;
        for(ll i=0;i<n;i++)
        {
            cin>>a[i];
        }
        ll m=a[n-1];
        for(ll i=n-1;i>0;i--)
        {
            if(a[i-1]<m)
            {
                m=a[i-1];
            }
            else
                ans++;
        }
        cout<<ans<<"\n";
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define max_char 26
//#define endl '\n'
string remove_space(string str)
{
    std::string::iterator end_pos = std::remove(str.begin(), str.end(), ' ');
str.erase(end_pos, str.end());
return str;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin>>t;
    while(t--)
    {
        ll n;
        cin>>n;
        ll a[n],sum=0,first_mi,second_mi;
        for(ll i=1;i<=n;i++)
        {
            cin>>a[i];
        }
        int i=1;
        while(i<=n)
        {
            int j=i+1;
            while(j<=n)
            {
                if(a[i]>a[j]){
                    sum++;
                    break;
                }
                    j++;
            }
            i++;
        }
        cout<<sum<<"\n";
    }
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define max_char 26
//#define endl '\n'
string remove_space(string str)
{
    std::string::iterator end_pos = std::remove(str.begin(), str.end(), ' ');
str.erase(end_pos, str.end());
return str;
}
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    cin>>t;
    while(t--)
    {
        ll n;
        cin>>n;
        ll a[n],sum=0,ans=0;
        for(ll i=0;i<n;i++)
        {
            cin>>a[i];
        }
        ll m=a[n-1];
        for(ll i=n-1;i>0;i--)
        {
            if(a[i-1]<m)
            {
                m=a[i-1];
            }
            else if(a[i-1]>m)
                ans++;
        }
        cout<<ans<<"\n";
    }
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
   int a,b;
   cin>>a;
   for(int i=0;i<a;i++)
   {
       cin>>b;
       long int arr[b],arr1[b];
       for(int j=0;j<b;j++)
       {
           cin>>arr[j];
           arr1[j]=arr[j];
       }

       sort(arr1,arr1+b);

       int cont=0;
      if(b==1)
       cont=0;
       else
      {for(int k=0;k<b-1;k++)
       {
           int l=0,h=b-1;

           while(l<=h)
           {
               int m=(l+h)/2;
               if(arr1[m]==arr[k])
               {
                   arr1[m]=0;
                   break;
               }

               else if(arr1[m]>arr[k])
               {
                   h=m-1;
               }

               else if(arr1[m]<arr[k])
               {
                   l=m+1;
               }

           }

           sort(arr1,arr1+b);
           if(arr[k]>arr1[k+1])
            cont++;
       }
      }

       cout<<cont<<"\n";
   }

   return 0;
}


#include <bits/stdc++.h>
#include <map>

using namespace std;

int main()
{  map<int,int>mp;
   int a,b;
   cin>>a;
   for(int i=0;i<a;i++)
   {
       cin>>b;
       long int arr[b];
       for(int j=0;j<b;j++)
       {
           cin>>arr[j];
           mp.insert(make_pair(arr[j],j));

       }

       int cont=0;
      if(b==1)
       cont=0;
       else
      {for(int k=0;k<b-1;k++)
       {
          mp.erase(arr[k]);

          auto it=mp.begin();

          if(it->first<arr[k])
            cont++;

       }
      }

       cout<<cont<<"\n";
   }

   return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
   int a,b;
   cin>>a;
   for(int i=0;i<a;i++)
   {
       cin>>b;
       long int arr[b],arr1[b];
       for(int j=0;j<b;j++)
       {
           cin>>arr[j];
           arr1[j]=arr[j];
       }
      int cont=0;
       arr1[0]=0;
       sort(arr1,arr1+b);
       if(arr[0]>arr1[1])
        cont++;

       for(int k=1;k<b-1;k++)
       {
           int l=0,h=b-1;

           while(l<=h)
           {
               int m=(l+h)/2;
               if(arr1[m]==arr[k])
               {
                   arr1[m]=0;
                   break;
               }

               else if(arr1[m]>arr[k])
               {
                   h=m-1;
               }

               else if(arr1[m]<arr[k])
               {
                   l=m+1;
               }

           }

           sort(arr1,arr1+b);
           if(arr[k]>arr1[k+1])
            cont++;
       }

       cout<<cont<<"\n";
   }

   return 0;
}


#include <bits/stdc++.h>
#include <map>

using namespace std;

int main()
{  map<int,int>mp;
   int a,b;
   cin>>a;
   for(int i=0;i<a;i++)
   {
       cin>>b;
       long int arr[b];
       for(int j=0;j<b;j++)
        cin>>arr[j];

        int cont=0;
       long int maxex=LONG_MAX;
       for(int k=b-1;k>=0;k--)
       {
           if(arr[k]>maxex)
            cont++;

           maxex=min(maxex,arr[k]);
       }
    cout<<cont<<"\n";

    }

   return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main()
{
   int a,b;
   cin>>a;
   for(int i=0;i<a;i++)
   {
       cin>>b;
       long int arr[b];
       for(int j=0;j<b;j++)
       {
           cin>>arr[j];

       }

       int cont=0;
      if(b==1)
       cont=0;
       else
      {for(int k=0;k<b-1;k++)
       {
           for(int m=k+1;m<b;m++)
           {
               if(arr[k]>arr[m])
               {
                   cont++;
                   break;
               }
           }
       }
      }

       cout<<cont<<"\n";
   }

   return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
const int MAXN = 1e5 + 50050;
using namespace std;

int ans, N;

struct days{
	int num, pr;
}d[MAXN];

inline bool cmp(days a, days b) {
	return a.pr > b.pr;
}

inline void Find(int pos) {
	for (int i = pos + 1; i <= N; i++) {
		if (d[i].num > d[pos].num) {
			ans++;
			return;
		}
	}
}

int main() {
	int T;
	cin >> T;
	while (T--) {
		cin >> N;
		ans = 0;
		for (int i = 1; i <= N; i++) {
			cin >> d[i].pr;
			d[i].num = i;
		}
		sort(d + 1, d + N + 1, cmp);
		for (int i = 1; i <= N; i++) {
			Find(i);
		}
		cout << ans << endl;
	}
	return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#pragma GCC optimize(2)
const int MAXN = 1e5 + 50050;
using namespace std;

int ans, N;

struct days{
	int num, pr;
}d[MAXN];

inline bool cmp(days a, days b) {
	return a.pr > b.pr;
}

inline void Find(int pos) {
	for (int i = pos + 1; i <= N; i++) {
		if (d[i].pr < d[pos].pr) {
			ans++;
			return;
		}
	}
}

int main() {
	int T;
//	freopen("in.txt", "r", stdin);
	cin >> T;
	while (T--) {
		cin >> N;
		ans = 0;
		for (int i = 1; i <= N; i++) cin >> d[i].pr;
		for (int i = 1; i <= N; i++) {
			Find(i);
		}
		cout << ans << endl;
	}
	return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#pragma GCC optimize(2)
const int MAXN = 1e5 + 50050;
const int INF = 1e6 + 2333;
using namespace std;
int a[MAXN];
int main() {
	int T, N;
//	freopen("in.txt", "r", stdin);
	cin >> T;
	while (T--) {
		cin >> N;
		int ans = 0;
		for (int i = 1; i <= N; i++) cin >> a[i];
		int min_a = a[N];
		for (int i = N - 1; i >= 1; i--) {
			if (a[i] > min_a) ans++;
			min_a = min(min_a, a[i]);
		}
		cout << ans << endl;
	}
	return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
const int MAXN = 1e5 + 50050;
using namespace std;

int ans, N;

struct days{
	int num, pr;
}d[MAXN];

inline bool cmp(days a, days b) {
	return a.pr > b.pr;
}

inline void Find(int pos) {
	for (int i = pos + 1; i <= N; i++) {
		if (d[i].num > d[pos].num && d[i].pr != d[pos].pr) {
			ans++;
			return;
		}
	}
}

int main() {
	int T;
	//freopen("in.txt", "r", stdin);
	cin >> T;
	while (T--) {
		cin >> N;
		ans = 0;
		for (int i = 1; i <= N; i++) {
			cin >> d[i].pr;
			d[i].num = i;
		}
		sort(d + 1, d + N + 1, cmp);
		for (int i = 1; i <= N; i++) {
			Find(i);
		}
		cout << ans << endl;
	}
	return 0;
}


#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
#pragma GCC optimize(2)
const int MAXN = 1e5 + 50050;
const int INF = 1e6 + 2333;
using namespace std;
int a[MAXN];
int main() {
	int T, N;
	freopen("in.txt", "r", stdin);
	cin >> T;
	while (T--) {
		cin >> N;
		int ans = 0;
		for (int i = 1; i <= N; i++) cin >> a[i];
		int min_a = a[N];
		for (int i = N - 1; i >= 1; i--) {
			if (a[i] > min_a) ans++;
			min_a = min(min_a, a[i]);
		}
		cout << ans << endl;
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<iomanip>//�������,<<setiosflags(ios::fixed)<<setprecision(9)
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define PI 3.14159265358979323846
#define e  2.7182818284590452354
#define ln_2 0.69314718055994530942
#define ln_10 2.30258509299404568402
const int inf=0x3f3f3f3f;
int arr[150005];
bool vis[15005];
int main()
{
	int t,n,cnt,pre,now;
	cin>>t;
	while(t--)
	{
		cin>>n;
		cnt=0;
		memset(vis,0,sizeof(vis));
		for(int i=0;i<n;i++)
		{
			scanf("%d",&arr[i]);
		}
		for(int i=n-1;i>=0;i--)
		{
			for(int j=i-1;j>=0;j--)
			{
//				if(vis[j]&&arr[j]>arr[i])
//					break;
//				if(arr[j]<=arr[i])
//					break;
				if(!vis[j]&&arr[j]>arr[i])
				{
					vis[j]=1;
					cnt++;
				}
			}
		}
//		cout<<"ans=";
		cout<<cnt<<endl;
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<iomanip>//�������,<<setiosflags(ios::fixed)<<setprecision(9)
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define PI 3.14159265358979323846
#define e  2.7182818284590452354
#define ln_2 0.69314718055994530942
#define ln_10 2.30258509299404568402
const int inf=0x3f3f3f3f;
int arr[150005];
bool vis[15005];
int main()
{
	int t,n,cnt,pre,now,mini;
	cin>>t;
	while(t--)
	{
		cin>>n;
		cnt=0;
		mini=inf;
		memset(vis,0,sizeof(vis));
		for(int i=0;i<n;i++)
		{
			scanf("%d",&arr[i]);
		}
		for(int i=n-1;i>=0;i--)//������ڱ���С����,��Ҫ����
		{
			if(arr[i]>=mini)
				continue;
			else
				mini=arr[i];
			for(int j=i-1;j>=0;j--)
			{
				if(!vis[j]&&arr[j]>arr[i])
				{
					vis[j]=1;
					cnt++;
				}
			}
		}
//		cout<<"ans=";
		cout<<cnt<<endl;
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<iomanip>//�������,<<setiosflags(ios::fixed)<<setprecision(9)
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define PI 3.14159265358979323846
#define e  2.7182818284590452354
#define ln_2 0.69314718055994530942
#define ln_10 2.30258509299404568402
const int inf=0x3f3f3f3f;
int arr[150005];
bool vis[150005];
int read()//�����
{
    int x=0,f=1;
    char ss=getchar();
    while(ss<'0'||ss>'9'){if(ss=='-')f=-1;ss=getchar();}
    while(ss>='0'&&ss<='9'){x=x*10+ss-'0';ss=getchar();}
    return x*f;
}
int main()
{
	int t,n,cnt,pre,now,miniest,st,flag=0,stloc;
	cin>>t;
	while(t--)
	{
		scanf("%d",&n);
		cnt=0;
		miniest=inf;
//		memset(vis,0,sizeof(vis));
		for(int i=1;i<=n;i++)
		{
			if(i>1)
				pre=now;
			now=read();
			if(i==1||flag)//��һ����Ϊ���������Ŀ�ͷ
			{
				st=now;
				stloc=i;
				flag=0;
			}
			if(now<miniest)
			{
				cnt=i-1;
				miniest=now;
				flag=1;
			}
			else if(st>now)
			{
				cnt+=i-stloc;
				flag=1;
			}
//			printf("i=%d,cnt=%d\n",i,cnt);
		}
//		cout<<"ans=";
		printf("%d\n",cnt);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<iomanip>//�������,<<setiosflags(ios::fixed)<<setprecision(9)
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define PI 3.14159265358979323846
#define e  2.7182818284590452354
#define ln_2 0.69314718055994530942
#define ln_10 2.30258509299404568402
const int inf=0x3f3f3f3f;
int arr[150005];
bool vis[150005];
int main()
{
	int t,n,cnt,pre,now,mini,stop,loc;
	cin>>t;
	while(t--)
	{
		cin>>n;
		cnt=0;
		mini=inf;
		stop=inf;
		memset(vis,0,sizeof(vis));
		for(int i=0;i<n;i++)
		{
			scanf("%d",&arr[i]);
			if(arr[i]<stop)
			{
				stop=arr[i];
			}
		}
		for(int i=n-1;i>=0;i--)//������ڱ���С����,��Ҫ����
		{
			if(arr[i]>=mini)//֮ǰ�б�arr[i]С����ɨ��
				continue;
			else
				mini=arr[i];
			for(int j=i-1;j>=0;j--)
			{
				if(!vis[j]&&arr[j]>arr[i])
				{
					vis[j]=1;
					cnt++;
				}
			}
			if(mini==stop)
				break;
		}
//		cout<<"ans=";
		printf("%d\n",cnt);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<iomanip>//�������,<<setiosflags(ios::fixed)<<setprecision(9)
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define PI 3.14159265358979323846
#define e  2.7182818284590452354
#define ln_2 0.69314718055994530942
#define ln_10 2.30258509299404568402
const int inf=0x3f3f3f3f;
int arr[150005];
bool vis[150005];
int read()//�����
{
    int x=0,f=1;
    char ss=getchar();
    while(ss<'0'||ss>'9'){if(ss=='-')f=-1;ss=getchar();}
    while(ss>='0'&&ss<='9'){x=x*10+ss-'0';ss=getchar();}
    return x*f;
}
int main()
{
	int t,n,cnt,pre,now,mini,stop,loc;
	cin>>t;
	while(t--)
	{
		cin>>n;
		cnt=0;
		mini=inf;
		stop=inf;
		memset(vis,0,sizeof(vis));
		for(int i=0;i<n;i++)
		{
			arr[i]=read();
			if(arr[i]<stop)
			{
				stop=arr[i];
			}
		}
		for(int i=n-1;i>=0;i--)//������ڱ���С����,��Ҫ����
		{
			if(arr[i]>=mini)//֮ǰ�б�arr[i]С����ɨ��
				continue;
			else
				mini=arr[i];
			for(int j=i-1;j>=0;j--)
			{
				if(!vis[j]&&arr[j]>arr[i])
				{
					vis[j]=1;
					cnt++;
				}
			}
			if(mini==stop)
				break;
		}
//		cout<<"ans=";
		printf("%d\n",cnt);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<iomanip>//�������,<<setiosflags(ios::fixed)<<setprecision(9)
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define PI 3.14159265358979323846
#define e  2.7182818284590452354
#define ln_2 0.69314718055994530942
#define ln_10 2.30258509299404568402
const int inf=0x3f3f3f3f;
int arr[150005];
bool vis[150005];
int main()
{
	int t,n,cnt,pre,now,mini;
	cin>>t;
	while(t--)
	{
		cin>>n;
		cnt=0;
		mini=inf;
		memset(vis,0,sizeof(vis));
		for(int i=0;i<n;i++)
		{
			scanf("%d",&arr[i]);
		}
		for(int i=n-1;i>=0;i--)//������ڱ���С����,��Ҫ����
		{
			if(arr[i]>=mini)//֮ǰ�б�arr[i]С����ɨ��
				continue;
			else
				mini=arr[i];
			for(int j=i-1;j>=0;j--)
			{
				if(!vis[j]&&arr[j]>arr[i])
				{
					vis[j]=1;
					cnt++;
				}
			}
		}
//		cout<<"ans=";
		cout<<cnt<<endl;
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<iomanip>//�������,<<setiosflags(ios::fixed)<<setprecision(9)
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define PI 3.14159265358979323846
#define e  2.7182818284590452354
#define ln_2 0.69314718055994530942
#define ln_10 2.30258509299404568402
const int inf=0x3f3f3f3f;
int arr[150005];
bool vis[150005];
int read()//�����
{
    int x=0,f=1;
    char ss=getchar();
    while(ss<'0'||ss>'9'){if(ss=='-')f=-1;ss=getchar();}
    while(ss>='0'&&ss<='9'){x=x*10+ss-'0';ss=getchar();}
    return x*f;
}
int main()
{
	int t,n,cnt,pre,now,mini;
	cin>>t;
	while(t--)
	{
		cin>>n;
		cnt=0;
		mini=inf;
		memset(vis,0,sizeof(vis));
		for(int i=1;i<=n;i++)
		{
			if(i>1)
				pre=now;
			now=read();
			if(now<mini)
			{
				cnt=i-1;
				mini=now;
			}
			else if(now<pre)
				cnt++;
		}
//		cout<<"ans=";
		printf("%d\n",cnt);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<iomanip>//�������,<<setiosflags(ios::fixed)<<setprecision(9)
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define PI 3.14159265358979323846
#define e  2.7182818284590452354
#define ln_2 0.69314718055994530942
#define ln_10 2.30258509299404568402
const int inf=0x3f3f3f3f;
int arr[150005];
bool vis[150005];
int read()//�����
{
    int x=0,f=1;
    char ss=getchar();
    while(ss<'0'||ss>'9'){if(ss=='-')f=-1;ss=getchar();}
    while(ss>='0'&&ss<='9'){x=x*10+ss-'0';ss=getchar();}
    return x*f;
}
int main()
{
	int t,n,cnt,pre,now,miniest,st,flag=0,stloc;
	cin>>t;
	while(t--)
	{
		scanf("%d",&n);
		cnt=0;
		miniest=inf;
//		memset(vis,0,sizeof(vis));
		for(int i=1;i<=n;i++)
		{
			if(i>1)
				pre=now;
			scanf("%d",&now);
			if(i==1||flag)//��һ����Ϊ���������Ŀ�ͷ
			{
				st=now;
				stloc=i;
				flag=0;
			}
			if(now<miniest)
			{
				cnt=i-1;
				miniest=now;
				flag=1;
			}
			else if(st>now)
			{
				cnt+=i-stloc;
				flag=1;
			}
//			printf("i=%d,cnt=%d\n",i,cnt);
		}
//		cout<<"ans=";
		printf("%d\n",cnt);
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<iomanip>//�������,<<setiosflags(ios::fixed)<<setprecision(9)
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define PI 3.14159265358979323846
#define e  2.7182818284590452354
#define ln_2 0.69314718055994530942
#define ln_10 2.30258509299404568402
const int inf=0x3f3f3f3f;
int a[150005];
int main()
{
	int t,n;
	cin>>t;
	while(t--)
	{
		int cnt=0;
		scanf("%d",&n);
		for(int i=n-1;i>=0;i--)
			scanf("%d",&a[i]);//
		int mini=a[0];
		for(int i=1;i<n;i++)
		{
			if(a[i]>mini)
				cnt++;
			else
				mini=a[i];
		}
		cout<<cnt<<endl;
	}
	return 0;
}


#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<cmath>
#include<iomanip>//�������,<<setiosflags(ios::fixed)<<setprecision(9)
#include<string>
#include<vector>
#include<queue>
#include<stack>
#include<map>
using namespace std;
#define PI 3.14159265358979323846
#define e  2.7182818284590452354
#define ln_2 0.69314718055994530942
#define ln_10 2.30258509299404568402
const int inf=0x3f3f3f3f;
int arr[150005];
bool vis[15005];
int main()
{
	int t,n,cnt,pre,now;
	cin>>t;
	while(t--)
	{
		cin>>n;
		cnt=0;
		memset(vis,0,sizeof(vis));
		for(int i=0;i<n;i++)
		{
			scanf("%d",&arr[i]);
		}
		for(int i=n-1;i>=0;i--)
		{
			for(int j=i-1;j>=0;j--)
			{
				if(vis[j]&&arr[j]>arr[i])
					break;
				if(arr[j]<=arr[i])
					break;
				if(!vis[j]&&arr[j]>arr[i])
				{
					vis[j]=1;
					cnt++;
				}
			}
		}
		cout<<cnt<<endl;
	}
	return 0;
}


#include<bits\stdc++.h>
using namespace std;
int main(){
	int t,n;
	cin>>t;
	for(int i=0;i<t;i++)
	{int m=0;
		cin>>n;
		vector<int>v(n);
		for(int j=0;j<n;j++)
		cin>>v[j];
		for(int j=0;j<n;j++)
		for(int k=j+1;k<n;k++)
		{
			if(v[j]>v[k])
			{m++;
			break;
			}
		}
		cout<<m;
	}}


#include<bits\stdc++.h>
using namespace std;
int main(){
	int t,n,p;
	cin>>t;
       vector<int>v;
	for(int i=0;i<t;i++)
	{int m=0;

		cin>>n;

		v.clear();
                v.resize(n);
		for(int j=0;j<n;j++)
		cin>>v[j];
		for(int j=0;j<n-1;j++)
		for(int k=j+1;k<n;k++)
		{
			if(v[j]>v[k])
			{m++;
			break;
			}
		}
		cout<<m<<"\n";
	}}


#include<bits\stdc++.h>
using namespace std;
int main(){
	int t,n;
	cin>>t;
	for(int i=0;i<t;i++)
	{int m=0;

		cin>>n;
		vector<int>v(n);
		v.clear();
		for(int j=0;j<n;j++)
		cin>>v[j];
		for(int j=0;j<n-1;j++)
		for(int k=j+1;k<n;k++)
		{
			if(v[j]>v[k])
			{m++;
			break;
			}
		}
		cout<<m;
	}}


#include<bits\stdc++.h>
using namespace std;
int main(){
	int t,n;
	cin>>t;
	for(int i=0;i<t;i++)
	{int m=0;

		cin>>n;
		vector<int>v(n);
		for(int j=0;j<n;j++)
		cin>>v[j];
		int min=v[n-1];
		for(int j=n-2;j>=0;j--)
		{
			if(min<v[j])
			m++;
			else
			min=v[j];
		}
		cout<<m<<"\n";
	}}


#include<bits\stdc++.h>
using namespace std;
int main(){
	int t,n;
	cin>>t;
	for(int i=0;i<t;i++)
	{int m=0;
		cin>>n;
		vector<int>v(n);
		for(int j=0;j<n;j++)
		cin>>v[j];
		for(int j=0;j<n;j++)
		for(int k=j+1;k<n;k++)
		{
			if(v[j]>v[k])
			{m++;
			break;
			}
		}
		cout<<m<<"\n";
	}}


#include<bits\stdc++.h>
using namespace std;
int main(){
	int t,n;
	cin>>t;
	for(int i=0;i<t;i++)
	{int m=0;

		cin>>n;
		vector<int>v(n);
		v.clear();
		for(int j=0;j<n;j++)
		cin>>v[j];
		for(int j=0;j<n-1;j++)
		for(int k=j+1;k<n;k++)
		{
			if(v[j]>v[k])
			{m++;
			break;
			}
		}
		cout<<m<<"\n";
	}}


 #include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <ctime>
using namespace std;

#define FOR(i,a,b) for(int i = (a); i < (b); i++)

#define rep(i,n) FOR(i,0,n)
#define RFOR(i,b,a) for(int i = (b) - 1; i>= (a); i--)
#define ITER(it, a) for(typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a, value) memset(a, value, sizeof(a)

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef  long long LL;
typedef vector<int> VI;
typedef vector<bool>VB;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL)INF;

const double EPS = 1e-7;
const int MAX = 20 * 1000 + 47;
const int MOD = 1000 * 1000 * 1000 + 7 ;
const int MAS =1e5;

int gcd(int a, int b) {
    return b == 0 ? a : gcd(b, a % b);
}
int a [MAS];
int main()
{
int t;
cin >>t ;
rep(j,t)
{
    int ans = 0 ;
    int n;
    cin >> n;
    rep(i,n )
    {
        cin >> a[i] ;
    }
    int mn = 1e10;
    RFOR(i,n,0)
    {
     if( a[i] < mn )
     {
         mn = a[i] ;
         ans++;
     }

    }
    cout << ans<< endl;

}

}


 #include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <ctime>
using namespace std;

#define FOR(i,a,b) for(int i = (a); i < (b); i++)

#define rep(i,n) FOR(i,0,n)
#define RFOR(i,b,a) for(int i = (b) - 1; i>= (a); i--)
#define ITER(it, a) for(typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a, value) memset(a, value, sizeof(a)

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef  long long LL;
typedef vector<int> VI;
typedef vector<bool>VB;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL)INF;

const double EPS = 1e-7;
const int MAX = 20 * 1000 + 47;
const int MOD = 1000 * 1000 * 1000 + 7 ;
const int MAS =1e6;

int gcd(int a, int b) {
    return b == 0 ? a : gcd(b, a % b);
}
int a [MAS];
int main()
{
int t;
cin >>t ;
rep(j,t)
{
    int ans = 0 ;
    int n;
    cin >> n;

    rep(i,n )
    {
        cin >> a[i] ;
    }
        if(n == 1)
    {
        cout << 0 << endl;
        continue;
    }
    int mn = 1e10;
    RFOR(i,n,0)
    {
     if( a[i] > mn )
     {
         //mn = a[i] ;
         ans++;
     }
     else
     {
         mn = a[i];
     }

    }
    cout << ans<< endl;

}

}


 #include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <ctime>
using namespace std;

#define FOR(i,a,b) for(int i = (a); i < (b); i++)

#define rep(i,n) FOR(i,0,n)
#define RFOR(i,b,a) for(int i = (b) - 1; i>= (a); i--)
#define ITER(it, a) for(typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a, value) memset(a, value, sizeof(a)

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef  long long LL;
typedef vector<int> VI;
typedef vector<bool>VB;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL)INF;

const double EPS = 1e-7;
const int MAX = 20 * 1000 + 47;
const int MOD = 1000 * 1000 * 1000 + 7 ;
const int MAS =1e5;

int gcd(int a, int b) {
    return b == 0 ? a : gcd(b, a % b);
}
int a [MAS];
int main()
{
int t;
cin >>t ;
rep(j,t)
{
    int ans = 0 ;
    int n;
    cin >> n;

    rep(i,n )
    {
        cin >> a[i] ;
    }
        if(n == 1)
    {
        cout << 0 << endl;
        continue;
    }
    int mn = 1e10;
    RFOR(i,n,0)
    {
     if( a[i] > mn )
     {
         //mn = a[i] ;
         ans++;
     }
     else
     {
         mn = a[i];
     }

    }
    cout << ans<< endl;

}

}


 #include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <ctime>
using namespace std;

#define FOR(i,a,b) for(int i = (a); i < (b); i++)

#define rep(i,n) FOR(i,0,n)
#define RFOR(i,b,a) for(int i = (b) - 1; i>= (a); i--)
#define ITER(it, a) for(typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a, value) memset(a, value, sizeof(a)

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef  long long LL;
typedef vector<int> VI;
typedef vector<bool>VB;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL)INF;

const double EPS = 1e-7;
const int MAX = 20 * 1000 + 47;
const int MOD = 1000 * 1000 * 1000 + 7 ;
const int MAS =1e5;

int gcd(int a, int b) {
    return b == 0 ? a : gcd(b, a % b);
}
int a [MAS];
int main()
{
int t;
cin >>t ;
rep(j,t)
{
    int ans = 0 ;
    int n;
    cin >> n;

    rep(i,n )
    {
        cin >> a[i] ;
    }
        if(n == 1)
    {
        cout << 0 << endl;
        continue;
    }
    int mn = 1e10;
    RFOR(i,n,0)
    {
     if( a[i] < mn )
     {
         mn = a[i] ;
         ans++;
     }

    }
    cout << ans<< endl;

}

}


 #include <iostream>
#include <sstream>
#include <iomanip>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <iterator>
#include <bitset>
#include <ctime>
using namespace std;

#define FOR(i,a,b) for(int i = (a); i < (b); i++)

#define rep(i,n) FOR(i,0,n)
#define RFOR(i,b,a) for(int i = (b) - 1; i>= (a); i--)
#define ITER(it, a) for(typeof(a.begin()) it = a.begin(); it != a.end(); it++)
#define FILL(a, value) memset(a, value, sizeof(a)

#define SZ(a) (int)a.size()
#define ALL(a) a.begin(), a.end()
#define PB push_back
#define MP make_pair

typedef  long long LL;
typedef vector<int> VI;
typedef vector<bool>VB;
typedef pair<int, int> PII;

const double PI = acos(-1.0);
const int INF = 1000 * 1000 * 1000 + 7;
const LL LINF = INF * (LL)INF;

const double EPS = 1e-7;
const int MAX = 20 * 1000 + 47;
const int MOD = 1000 * 1000 * 1000 + 7 ;
const int MAS =1e5;

int gcd(int a, int b) {
    return b == 0 ? a : gcd(b, a % b);
}
int a [MAS];
int main()
{
int t;
cin >>t ;
rep(j,t)
{
    int ans = 0 ;
    int n;
    cin >> n;
    if(n == 1)
    {
        cout << 0 << endl;
        break;
    }
    rep(i,n )
    {
        cin >> a[i] ;
    }
    int mn = 1e10;
    RFOR(i,n,0)
    {
     if( a[i] < mn )
     {
         mn = a[i] ;
         ans++;
     }

    }
    cout << ans<< endl;

}

}


#include<cstdio>
using namespace std;
int str[1000005];
int main(void)
{
	int t;
	int n;
	scanf("%d",&t);
	for(int i=0;i<t;i++)
	{
		scanf("%d",&n);
		int cnt=0;
		for(int i1=0;i1<n;i1++)
		{
			scanf("%d",&str[i1]);
		}
		for(int i1=0;i1<n;i1++)
		{
			for(int j=i1+1;j<n;j++)
			{
				if(str[j]<str[i1])
				{
					cnt++;
					break;
				}
			}
		}
		printf("%d\n",cnt);
	}
	return 0;
}

//2020-09-05 20:56:27.663


#include<bits/stdc++.h>
using namespace std;
long long t;
void solve()
{
    while(t--)
    {
        long long i,n,ans=0;
        cin>>n;
        vector < long long > a(n),b(n);
        for (i=0;i<n;i++)
        {
            cin>>a[i];
            b[i]=a[i];
        }
        for (i=n-2;i>=0;i--)
            b[i]=min(b[i],b[i+1]);
        for (i=0;i<n;i++)
            if (a[i]>b[i]) ans++;
        cout<<ans<<endl;
    }
}
int main()
{
    while(cin>>t)
        solve();
}//2019-12-31 17:09:02.951


#pragma GCC optimize(2)
#include <iostream>
#define N 156156
#define ll long long
using namespace std;
int a[N];
int main()
{
	int t,n,ans;
	scanf("%d",&t);
	while(t--)
	{
		ans=0;
		cin>>n;
		for (int i=1;i<=n;i++) scanf("%d",&a[i]);
		int mid=a[n];
		for (int i=n;i>=1;i--)
		{
		    if (a[i]>mid) ans++;
		    else mid=a[i];
		}
		printf("%d\n",ans);
	}
	return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int t,n,a[2000000],b[150100];
void add(int x) { for(;x<=1000000;x+=x&-x) a[x]=1; }
int ask(int x)
{
	if(!x) return 0;
	for(;x;x-=x&-x)
		if(a[x]) return 1;
	return 0;
}
int read()
{
	int x=0;
	char c=getchar();
	while(c>'9'||c<'0') c=getchar();
	while(c>='0'&&c<='9') x=x*10+(c-'0'),c=getchar();
	return x;
}
int main()
{
	scanf("%d",&t);
	while(t--)
	{
		scanf("%d",&n);
		int ans=0;
		memset(a,0,sizeof a);
		for(int i=1;i<=n;i++)
			scanf("%d",&b[i]);
		for(int i=n;i>=1;i--)
		{
			if(ask(b[i]-1)) ans++;
			add(b[i]);
		}
		printf("%d\n",ans);
	}
}


#include<cstdio>
#include<cstring>
using namespace std;

int t,n,a[150010],b[150010],c[150010];

int min(int a,int b)
{
    return a<b?a:b;
}
int main(){
    scanf("%d",&t);
    while(t--){
        scanf("%d",&n);
        memset(a,0,sizeof(a));
        int ans=0;
        for(int i=1;i<=n;i++) scanf("%d",&a[i]);
        int minn=2147483647;
        for(int i=n;i;i--){
            if ( a[i] > minn ) ans++;
            minn = min(minn, a[i]);
        }
        printf("%d\n",ans);
    }
    return 0;
}


#include <bits/stdc++.h>
#define reg register

using namespace std;

typedef long long LL;

template < typename _T >
inline void Read(_T &Ass) {
  Ass = 0; _T neg = 1; char c = getchar();
  while (c < '0' || c > '9') { if (c == '-') neg = -1; c = getchar(); }
  while (c >= '0' && c <= '9') Ass = (Ass << 3) + (Ass << 1) + (c & 15), c = getchar();
  Ass *= neg;
}

template < typename T_ >
inline void print(T_ x) {
  if (x < 0) putchar('-'), x = -x;
  if (x < 10) putchar(x + 48);
  else print(x / 10), putchar(x % 10 + 48);
}

template < typename T_ >
inline void print(T_ a, char b) {
  print(a); putchar(b);
}

const int kN = 150000 + 10;

int T, N, Ans = 0, a[kN], mn[kN];

int main() {
  Read(T);
  while (T--) {
    memset(mn, 0x3f, sizeof(mn));
    Read(N);
    Ans = 0;
    for (reg int i = 1; i <= N; ++i) Read(a[i]);
    for (reg int i = N; i >= 1; --i)
      mn[i] = min(mn[i + 1], a[i]);
//  for (reg int i = 1; i <= N; ++i)
//    print(mn[i], ' ');putchar('\n');
    for (reg int i = 1; i < N; ++i)
      if (mn[i + 1] < a[i]) Ans++;
    print(Ans, '\n');
  }

  return 0;
}


#include<iostream>
#include<algorithm>
using namespace std;
int a[200000];
int main(){
	int t;
	scanf("%d",&t);
	for(int i=1;i<=t;i++){
		int n,cnt=0,min1=2000000;
		scanf("%d",&n);
		for(int j=0;j<n;j++){
			scanf("%d",&a[j]);
		}
        for(int i=n-1;i>=0;i--){
        	if(a[i]>min1){
        		cnt++;
			}
			min1=min(min1,a[i]);
		}
		printf("%d\n",cnt);
	}
	return 0;
}


#include <cstdio>
#include <cctype>
int T,n,a[150005];
inline int min(int a,int b){return a<b?a:b;}
inline int read(){
    int X=0,w=0; char ch=0;
    while(!isdigit(ch)) {w|=ch=='-';ch=getchar();}
    while(isdigit(ch)) X=(X<<3)+(X<<1)+(ch^48),ch=getchar();
    return w?-X:X;
}
int main(){
	T=read();
	while(T--){
		n=read();
		int cnt=0,mn=1e9;
		for(int i=1;i<=n;i++) a[i]=read();
		for(int i=n-1;i>=1;i--){
			mn=min(mn,a[i+1]);
			if(a[i]>mn) cnt++;
		}
		printf("%d\n",cnt);
	}
}


#include <cstdio>
#include <queue>
using namespace std;

int main()
{
    int T;
    scanf("%d", &T);
    while (T--) {
        int n;
        scanf("%d", &n);
        priority_queue<int> q;
        int ans = 0;
        for (int i = 1; i <= n; i++) {
            int x;
            scanf("%d", &x);
            while (!q.empty() && x < q.top())
                q.pop(), ans++;
            q.push(x);
        }
        printf("%d\n", ans);
    }
    return 0;
}


#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
int t,n,a[2000000],b[150100];
void add(int x) { for(;x<=1000000;x+=x&-x) a[x]=1; }
int ask(int x)
{
	if(!x) return 0;
	for(;x;x-=x&-x)
		if(a[x]) return 1;
	return 0;
}
int read()
{
	int x=0;
	char c=getchar();
	while(c>'9'||c<'0') c=getchar();
	while(c>='0'&&c<='9') x=x*10+(c-'0'),c=getchar();
	return x;
}
int main()
{
	scanf("%d",&t);
	while(t--)
	{
		n=read();
		int ans=0;
		memset(a,0,sizeof a);
		for(int i=1;i<=n;i++)
			b[i]=read();
		for(int i=n;i>=1;i--)
		{
			if(ask(b[i]-1)) ans++;
			add(b[i]);
		}
		printf("%d\n",ans);
	}
}


#include<iostream>
#include<algorithm>
#include<cstring>
using namespace std;
struct hlydl{
	int a;
	int h;
}t[200005];
bool cmp(hlydl x,hlydl y)
{
	return x.a<y.a;
}
int main()
{
	int tt;
	cin>>tt;
	for(int ii=1;ii<=tt;ii++)
	{
		memset(t,0,sizeof(t));
		int minn=999999999;
		int ans=0;
		int n;
		cin>>n;
		for(int i=1;i<=n;i++)
		cin>>t[i].a,t[i].h=i;
		for(int i=n;i>=1;i--)
		if(t[i].a<minn)
		minn=t[i].a,ans++;
		cout<<ans<<endl;
	}return 0;
}


#include <iostream>

using namespace std;

int main()
{
long k;
cin>>k;
    long n;

    long a[499999];
    for(int uu=0;uu<k;uu++)
    {
        cin>>n;

    for(long i=0;i<n;i++)
    {
        cin>>a[i];
    }
    long b=0;
    long c=0;

    for(long i=0;i<n-1;i++)
    {
        b=i+1;
        for(long b=n;0<b;b--)
        {
            if(a[b]<a[i])
                {c++;
                break;
                }
        }
    }
    cout<<c<<endl;
    }
}


#include <iostream>

using namespace std;

int main()
{
long k;
cin>>k;
    long n;

    long a[1000];
    for(int uu=0;uu<k;uu++)
    {
        cin>>n;

    for(long i=0;i<n;i++)
    {
        cin>>a[i];
    }
    long b=0;
    long c=0;

    for(long i=0;i<n-1;i++)
    {
        b=i+1;
        for(;b<n;b++)
        {
            if(a[b]<a[i])
                {c++;
                break;
                }
        }
    }
    cout<<c<<endl;
    }
}


#include <iostream>

using namespace std;

int main()
{

    long n;
    cin>>n;
    long a[n];
    for(long i=0;i<n;i++)
    {
        cin>>a[i];
    }
    long b=0;
    long c=0;

    for(long i=0;i<n-1;i++)
    {
        b=i+1;
        for(;b<n;b++)
        {
            if(a[b]<a[i])
                {c++;
                break;
                }
        }
    }
    cout<<c;
}


#include <iostream>

using namespace std;

int main()
{
long k;
cin>>k;
    long n;

    long a[1000];
    for(int uu=0;uu<k;uu++)
    {
        cin>>n;

    for(long i=0;i<n;i++)
    {
        cin>>a[i];
    }
    long b=0;
    long c=0;

    for(long i=0;i<n-1;i++)
    {
        b=i+1;
        for(;b<n;b++)
        {
            if(a[b]<a[i])
                {c++;
                break;
                }
        }
    }
    cout<<c;
    }
}


#include <iostream>
#include<bits/stdc++.h>

using namespace std;

int main()
{
long k;
cin>>k;
long n;
long j=0;
long a[150009];
long b[150009];
for(int i=0;i<k;i++)
{
    cin>>n;
    j=0;
    for(int y=0;y<n;y++)
    {
        cin>>a[y];
    }
    b[n-1]=a[n-1];
    for(int y=n-2;y>=0;y--)
    {
        if(a[y]<=b[y+1])
        {
            b[y]=a[y];
        }else
        {

        j++;
        b[y]=b[y+1];
        }
    }
    cout<<j<<endl;
}

}


#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<string.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<sstream>
using namespace std;
#define inf 2147483647//2^31
#define ll 9223372036854775807//2^64'
#define eps 1e-6
	/*ios_base::sync_with_stdio(false);
cin.tie(0);
 cout.tie(0);*/
struct cmp  //自定义比较规则
{
  bool operator() (const string& str1, const string& str2)
  {
    return str1 < str2;
  }
};
string a;
int vis[10240][4]={};
set<string,cmp>ans;
void re(int now,int n){
	if(vis[now][n]||now<=5){
	return;
	}
	vis[now][n]=1;
	string tmp=a.substr(now-2,2);
	if(now-2>=5&&tmp!=a.substr(now,n)){
		ans.insert(tmp);
		re(now-2,2);
	}
	tmp=a.substr(now-3,3);
	if(now-3>=5&&tmp!=a.substr(now,n)){
		ans.insert(tmp);
		re(now-3,3);
	}

}
int main()
{
	while(cin>>a){
		re(a.size(),0);
		cout<<ans.size()<<endl;
		for(set<string,cmp>::iterator j=ans.begin();j!=ans.end();j++){
		cout<<*j<<endl;
		}
}
return 0;
}


#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<string.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<sstream>
using namespace std;
#define inf 2147483647//2^31
#define ll 9223372036854775807//2^64'
#define eps 1e-6
	/*ios_base::sync_with_stdio(false);
cin.tie(0);
 cout.tie(0);*/
struct cmp  //自定义比较规则
{
  bool operator() (const string& str1, const string& str2)
  {
    return str1 < str2;
  }
};
string a;
int vis[10240][4]={};
set<string,cmp>ans;
void re(int now,int n){
	if(now<5){
	return;
	}
	vis[now][n]=1;
	string tmp=a.substr(now-2,2);
	if(now-2>=5&&tmp!=a.substr(now,n)){
		ans.insert(tmp);
		re(now-2,2);
	}
	tmp=a.substr(now-3,3);
	if(now-3>=5&&tmp!=a.substr(now,n)){
		ans.insert(tmp);
		re(now-3,3);
	}

}
int main()
{
	while(cin>>a){
		re(a.size(),0);
		cout<<ans.size()<<endl;
		for(set<string,cmp>::iterator j=ans.begin();j!=ans.end();j++){
		cout<<*j<<endl;
		}
}
return 0;
}


#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<string.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<sstream>
using namespace std;
#define inf 2147483647//2^31
#define ll 9223372036854775807//2^64'
#define eps 1e-6
	/*ios_base::sync_with_stdio(false);
cin.tie(0);
 cout.tie(0);*/
struct cmp  //自定义比较规则
{
  bool operator() (const string& str1, const string& str2)
  {
    return str1 < str2;
  }
};
string a;
int vis[10240][4]={};
set<string,cmp>ans;
void re(int now,int n){
	if(vis[now][n]||now<5){
	return;
	}
	vis[now][n]=1;
	string tmp=a.substr(now-2,2);
	if(now-2>=5&&tmp!=a.substr(now,n)){
		ans.insert(tmp);
		re(now-2,2);
	}
	tmp=a.substr(now-3,3);
	if(now-3>=5&&tmp!=a.substr(now,n)){
		ans.insert(tmp);
		re(now-3,3);
	}

}
int main()
{
	while(cin>>a){
		re(a.size(),0);
		cout<<ans.size()<<endl;
		for(set<string,cmp>::iterator j=ans.begin();j!=ans.end();j++){
		cout<<*j<<endl;
		}
}
return 0;
}


#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<string.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<sstream>
using namespace std;
#define inf 2147483647//2^31
#define ll 9223372036854775807//2^64'
#define eps 1e-6
	/*ios_base::sync_with_stdio(false);
cin.tie(0);
 cout.tie(0);*/
struct cmp  //自定义比较规则
{
  bool operator() (const string& str1, const string& str2)
  {
    return str1 < str2;
  }
};
char a[10240]={};
set<string,cmp>ans;
string num[10240][4]={};
set<string>tmp;
void re(int now,int n){
	if(now==strlen(a)){
		for(set<string>::iterator j=tmp.begin();j!=tmp.end();j++){
				ans.insert(*j);
			}
	return;
	}
	int flag=0;

	if(num[now][2]==""){
	if(now+2>strlen(a)){
		num[now-2][2]="";
		return;
	}

		string x="";
		x+=a[now];
		x+=a[now+1];
		if(x==num[now-2][2]){
			flag=1;
		}
		if(!flag){
			tmp.insert(x);
	num[now][2]=x;
	re(now+2,2);
	tmp.erase(x);
		}

	}
	else{
	re(now+2,2);
	}
	if(num[now][3]==""){
	flag=0;
		if(now+3>strlen(a)){
		num[now-3][3]="";
	return;
	}
		string x="";
		x+=a[now];
		x+=a[now+1];
		x+=a[now+2];
		if(x==num[now-3][3]){
		flag=1;
		}
		if(!flag){
			tmp.insert(x);
	num[now][3]=x;
	re(now+3,3);
	tmp.erase(x);
		}

	}
	else{
	re(now+3,3);
	}
}
int main()
{
	while(cin>>a){
		ans.clear();
		for(int i=5;a[i];i++){

				string x="";
				tmp.clear();
			if(i+2<=strlen(a)){
		x+=a[i];
		x+=a[i+1];
		tmp.insert(x);
		num[i][2]=x;
		re(i+2,2);
			}

			x="";
			tmp.clear();
			if(i+3<=strlen(a)){
			x+=a[i];
		x+=a[i+1];
		x+=a[i+2];
			tmp.insert(x);
		num[i][3]=x;
		re(i+3,3);
			}
		}

		cout<<ans.size()<<endl;
		for(set<string,cmp>::iterator j=ans.begin();j!=ans.end();j++){
		cout<<*j<<endl;
		}
}
return 0;
}


#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<string.h>
#include<vector>
#include<stack>
#include<queue>
#include<map>
#include<set>
#include<cstring>
#include<cstdlib>
#include<cstdio>
#include<sstream>
using namespace std;
#define inf 2147483647//2^31
#define ll 9223372036854775807//2^64'
#define eps 1e-6
	/*ios_base::sync_with_stdio(false);
cin.tie(0);
 cout.tie(0);*/
struct cmp  //自定义比较规则
{
  bool operator() (const string& str1, const string& str2)
  {
    return str1 < str2;
  }
};
char a[10240]={};
set<string,cmp>ans;
string num[10240][4]={};
set<string>tmp;
void re(int now,int n){
	if(now==strlen(a)){
		for(set<string>::iterator j=tmp.begin();j!=tmp.end();j++){
				ans.insert(*j);
			}
	return;
	}
	int flag=0;
	if(num[now][n]!=""){
	return;
	}
	if(now+2>strlen(a)){
	return;
	}
	else{
		string x="";
		x+=a[now];
		x+=a[now+1];
		if(x==num[now-2][2]){
			flag=1;
		}
		if(!flag){
			tmp.insert(x);
	num[now][2]=x;
	re(now+2,2);
	tmp.erase(x);
		}
	}
	flag=0;
	if(now+3>strlen(a)){
	return;
	}
	else{
		string x="";
		x+=a[now];
		x+=a[now+1];
		x+=a[now+2];
		if(x==num[now-3][3]){
		flag=1;
		}
		if(!flag){
			tmp.insert(x);
	num[now][3]=x;
	re(now+3,3);
	tmp.erase(x);
		}
	}

}
int main()
{
	while(cin>>a){
		ans.clear();
		for(int i=5;a[i];i++){

				string x="";
				tmp.clear();
			if(i+2<=strlen(a)){
		x+=a[i];
		x+=a[i+1];
		tmp.insert(x);
		num[i][2]=x;
		re(i+2,2);
			}

			x="";
			tmp.clear();
			if(i+3<=strlen(a)){
			x+=a[i];
		x+=a[i+1];
		x+=a[i+2];
			tmp.insert(x);
		num[i][3]=x;
		re(i+3,3);
			}
		}

		cout<<ans.size()<<endl;
		for(set<string,cmp>::iterator j=ans.begin();j!=ans.end();j++){
		cout<<*j<<endl;
		}
}
return 0;
}


#include <iostream>
#include <fstream>
#include <sstream>
#include <algorithm>
#include <vector>
#include <map>
#include <queue>
#include <list>
#include <set>
#include <utility>
#include <string>
#include <locale>
#include <algorithm>
#include <math.h>

#define M_PI           3.1415926535897932384626433832795  /* pi */
#define INT_MAX        2147483647

using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int, int> pi;
typedef queue<pi> qp;
typedef vector<pi> vp;
typedef vector<string> vs;
typedef map<int, int> mi;

int main()
{
	string s;
	cin >> s;

	int len = s.length();
	vs du(s.length(), "");
	vs tr(s.length(), "");
	set<string> res;

	for (int i = s.length() - 1; i >= 5; i--)
	{
		string dob = s.substr(i, 2);
		string tri = s.substr(i, 3);

		if (dob.length() == 2)
		{
			if (i + 2 == len)
			{
				res.insert(dob);
				du[i] = dob;
			}
			else if (i + 2 < len && ((dob != du[i + 2] && du[i + 2] != "") || (tr[i + 2] != "")))
			{
				res.insert(dob);
				du[i] = dob;
			}
		}

		if (tri.length() == 3)
		{
			if (i + 3 == len)
			{
				res.insert(tri);
				tr[i] = tri;
			}
			else if (i + 3 < len && ((tri != tr[i + 3] && tr[i + 3] != "") || (du[i + 3] != "")))
			{
				res.insert(tri);
				tr[i] = tri;
			}
		}
	}

	cout << res.size() << endl;
	for (auto i = res.begin(); i != res.end(); i++)
		cout << *i << endl;

	return 0;
}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
using namespace std;
const int N = (int) 1e5 + 113;

string s;
set <string> st;
bool used[N][4];
int n;
int main() {
	//freopen("input.txt", "r", stdin);

	cin >> s;
	n = s.size();

	used[n][2] = used[n][3] = 1;

	for (int i = n - 1; i > 4; i--) {
		for (int sz = 2; sz < 4; sz++) {
			for (int lastSz = 2; lastSz < 4; lastSz++) {
				if (!used[i + sz][lastSz])
					continue;

				if (sz != lastSz || ((i + sz) == n)) {
						st.insert(s.substr(i, sz));
						used[i][sz] = 1;
						break;
				}

				if (s.substr(i, sz) != s.substr(i + sz, lastSz)) {
					st.insert(s.substr(i, sz));
					used[i][sz] = 1;
					break;
				}
			}

		}
	}

	cout << st.size() << endl;

	for (set <string> ::iterator it = st.begin(); it != st.end(); it++) {
		cout << (*it) << endl;
	}

}


#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <math.h>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <set>
using namespace std;
const int N = (int) 1e5 + 113;

string s;
set <string> st;
bool used[N];
int n;
int main() {
	//freopen("input.txt", "r", stdin);

	cin >> s;
	n = s.size();

	used[n] = 1;

	for (int i = n - 1; i > 4; i--) {
		for (int sz = 2; sz < 4; sz++) {
			if (!used[i + sz])
				continue;

			st.insert(s.substr(i, sz));
			used[i] = 1;
		}
	}

	cout << st.size() << endl;

	for (set <string> ::iterator it = st.begin(); it != st.end(); it++) {
		cout << (*it) << endl;
	}

}