#include <bits/stdc++.h>
using namespace std;
long long z[1000][1000],k=99999999999999999,a,b,c,f=0,d,e,g=0,h,i;
double x,t=0.375;
int main()
{
cin>>a>>b>>c;
for(i=1;i<=a;i++){
for(d=1;d<=b;d++){
cin>>z[i][d];
k=min(k,z[i][d]);
if((f<=z[i][d]) && (z[i][d]<c) && (g==0)){
f=z[i][d];
}
if(z[i][d]>c){
g++;
}
}}
x=t;
i=1;
if(g==a*b){
while(t<=c+1){
t=t*i;
i++;
if(t<=c+1){
t=x;
}
}
cout<<i-2<<" "<<t-0.375;
return 0;
}
i=1;
h=f;
if(g==0){
while(f<c){
f=f*i;
i++;
if(f<c){
f=h;
}
}
cout<<i-1<<" "<<f;
return 0;
}
if(g!=0){
h=k;
while(k<c){
k=k*i;
i++;
if(k<c){
k=h;
}
}
cout<<i-1<<" "<<k;
return 0;
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
2 ms |
376 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |