#include<bits/stdc++.h>
using namespace std;
int main()
{
int a, b, c, n, i, m, k, d;
cin >> d;
for(k=1; k<=d; k++)
{
cin >> n;
b = c = m = 0;
int r[n];
for(i=0; i<n; i++)
{
cin >> r[i];
if(i==0)
m = r[0];
if(m > r[i])
{
b++;
m = r[i];
}
else if(m < r[i])
{
c++;
m = r[i];
}
}
cout << "Case " << k << ": " << c << " " << b << endl;
}
return 0;
}
using namespace std;
int main()
{
int a, b, c, n, i, m, k, d;
cin >> d;
for(k=1; k<=d; k++)
{
cin >> n;
b = c = m = 0;
int r[n];
for(i=0; i<n; i++)
{
cin >> r[i];
if(i==0)
m = r[0];
if(m > r[i])
{
b++;
m = r[i];
}
else if(m < r[i])
{
c++;
m = r[i];
}
}
cout << "Case " << k << ": " << c << " " << b << endl;
}
return 0;
}
Comments
Post a Comment