2 条题解
-
0
可以直接求平均值
#include<iostream> using namespace std; int main(){ int t; cin>>t; while(t--){ int n,m,k; cin>>n>>m>>k; if(k<=n*((m+1)/2)){ cout<<"1"<<'\n'; }else{ int a; //求可以坐几列,未满一列算一列 if(k%n==0){ a=k/n; }else{ a=k/n+1; } int b=a/((m-a)+1); //(m-a)是剩的列 if(a%((m-a)+1)==0){ //求平均 cout<<b<<'\n'; } else{ cout<<b+1<<'\n'; } } } return 0; }
- 1
信息
- ID
- 1162
- 时间
- 1000ms
- 内存
- 256MiB
- 难度
- 10
- 标签
- 递交数
- 9
- 已通过
- 3
- 上传者
