# |
Author |
Problem |
Lang |
Verdict |
Time |
Memory |
Sent |
Judged |
|
47274112 |
Practice:
Toral |
758C
- 35
|
GNU C++11
|
Accepted
|
31 ms
|
84 KB
|
2018-12-19 21:18:20 |
2018-12-19 21:18:20 |
|
/*
__ ___ ____ ____ ____
____ _ / / ____ ____ ___ < // __ \ / __ \ / __ \
/ __ `// / / __ \ / __ \ / _ \ / // /_/ // /_/ // /_/ /
/ /_/ // /___/ /_/ // / / // __// / \__, / \__, / \__, /
\__,_//_____/\____//_/ /_/ \___//_/ /____/ /____/ /____/
*/
#include <iostream>
#include <bits/stdc++.h>
//#include <boost/math/common_factor.cpp>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define huge7 1000000007
#define huge9 1000000009
#define all(c) (c).begin(),(c).end()
#define tr(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define present(container, element) (container.find(element) != container.end()) //for other containers(i.e. set/map, etc.)
#define vpresent(container, element) (find(all(container),element) != container.end()) //for vectors
#define pb push_back
#define pob pop_back
#define MAX 1000001
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
typedef long long int ll;
using namespace std;
int main()
{
/**********/IOS/**********/
ll n,m,k,x,y;
cin >> n >> m >> k >> x >> y;
ll Time_per = (2*n-2)*m;
ll ans[101][101];
if(n==1){
Time_per=m;
}
ll full_cyc = k/Time_per;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
ans[i][j]=full_cyc;
if(i!=1 and i!=n){
ans[i][j]+=full_cyc;
}
}
}
k=k%Time_per;
for(int i=1;i<=n;i++){
for(int j=1;j<=m;j++){
if(k){
ans[i][j]++;
--k;
}
}
}
for(int i=n-1;i>=1;i--){
for(int j=1;j<=m;j++){
if(k){
ans[i][j]++;
--k;
}
}
}
ll _max=INT_MIN;
for(int i=1;i<=n;i++){
_max=max(_max,ans[i][1]);
}
cout << _max << " " << ans[n][m] << " " << ans[x][y] << endl;
}
Click to see test details