#include <iostream>
#include <vector>
using namespace std;
#define fore(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
typedef long long ll;
vector<ll>v;
ll n,m,k;

int main(){
    cin>>n>>m>>k;
    fore(i,1,m){ll x;scanf("%lld",&x);v.push_back(x);}
    ll now=0,ans=0;
    while(v.size()){
        ll str=v[0]/k;
        int i=0;
        while(i<v.size() && v[i]/k==str) i++;
        fore(j,0,i-1) v.erase(v.begin());
        ans++;
    }
    cout<<ans;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define fore(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
typedef long long ll;
vector<ll>v;
ll n,m,k;

int main(){
    cin>>n>>m>>k;
    fore(i,1,m){ll x;scanf("%lld",&x);v.push_back(x);}
    reverse(v.begin(),v.end());
    ll now=0,ans=0;
    while(v.size()){
        ll str=(v[v.size()-1]-now-1)/k;
        int tmp=0;
        while(v.size() && (v[v.size()-1]-now-1)/k==str) tmp++,v.pop_back();
        ans++;
        now+=tmp;
    }
    cout<<ans;
    return 0;
}


#include <iostream>
#include <vector>
using namespace std;
#define fore(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
typedef long long ll;
vector<ll>v;
ll n,m,k;

int main(){
    cin>>n>>m>>k;
    fore(i,1,m){ll x;scanf("%lld",&x);v.push_back(x);}
    ll now=0,ans=0;
    for(ll i=k;i<=n;i+=k){
        bool flag=true;
        while(flag){
            int j=0;
            while(j<(int)v.size() && v[j]-now<=i) j++;
            fore(k,0,j-1) {/* cout<<v[0]-now<<" "; */v.erase(v.begin());}
            now+=j;
            /* cout<<"\n"; */
            if(j!=0) flag=true,ans++;
            else flag=false;
        }
        if(!v.size()) break;
        else i=((v[0]-now)/k)*k;
    }
    cout<<ans;
    return 0;
}


#include <iostream>
#include <vector>
using namespace std;
#define fore(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
typedef long long ll;
vector<ll>v;
ll n,m,k;

int main(){
    cin>>n>>m>>k;
    fore(i,1,m){ll x;scanf("%lld",&x);v.push_back(x);}
    ll now=0,ans=0;
    while(v.size()){
        ll str=(v[0]-1)/k;
        int i=0;
        while(i<v.size() && (v[i]-1)/k==str) i++;
        fore(j,0,i-1) v.erase(v.begin());
        ans++;
    }
    cout<<ans;
    return 0;
}


#include <iostream>
#include <vector>
using namespace std;
#define fore(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
vector<int>v;
int n,m,k;

int main(){
    cin>>n>>m>>k;
    fore(i,1,m){int x;scanf("%d",&x);v.push_back(x);}
    int now=0,ans=0;
    for(int i=k;i<=n;i+=k){
        bool flag=true;
        while(flag){
            int j=0;
            while(j<(int)v.size() && v[j]-now<=i) j++;
            fore(k,0,j-1) {/* cout<<v[0]-now<<" "; */v.erase(v.begin());}
            now+=j;
            /* cout<<"\n"; */
            if(j!=0) flag=true,ans++;
            else flag=false;
        }
    }
    cout<<ans;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[m];
	rep(i, m) cin >> p[i];
	sort(p, p + m);
	ll start = p[0] / k - (p[0] % k == 0);
	start *= k;
	start += 1;
	ll end = start + k - 1;
	ll cnt = 0;
	ll res = 1;
	ll lastcnt = 0;
	rep(i, m){
		if(p[i] - lastcnt <= end) cnt++;
		else{
			res++;
			lastcnt = cnt;
			p[i] -= lastcnt;
			ll start = p[i] / k - (p[i] % k == 0);
			start *= k;
			start += 1;
			ll end = start + k - 1;
			cnt++;
		}

	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[n];
	rep(i, m) cin >> p[i];
	ll start = p[0] / (k + 1) * k;
	ll end = start + k;
	int cnt = 0;
	int res = 1;
	int lastcnt = 0;
	rep(i, m){
		if(p[i] - lastcnt <= end) cnt++;
		else{
			res++;
			lastcnt = cnt;
			p[i] -= lastcnt;
			start = p[i] / (k + 1) * k;
			end = start + k;
		}

	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[n];
	rep(i, m) cin >> p[i];
	ll start = p[0] / (k + 1) * k;
	ll end = start + k;
	int cnt = 0;
	int res = 1;
	int lastcnt = 0;
	rep(i, m){
		if(p[i] - lastcnt <= end) cnt++;
		else{
			cout << start << " " << end << endl;
			res++;
			lastcnt = cnt;
			p[i] -= lastcnt;
			start = p[i] / (k + 1) * k;
			end = start + k;
		}

	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[m];
	rep(i, m) cin >> p[i];
	sort(p, p + m);
	ll start = (p[0] / k - (p[0] % k == 0))  * k + 1;
	ll end = start + k - 1;
	ll res = 1, cnt = 0, lastcnt = 0;
	rep(i, m){
		if(p[i] - lastcnt <= end) cnt++;
		else{
			res++;
			lastcnt = cnt;
			p[i] -= lastcnt;
			start = (p[i] / k - (p[i] % k == 0)) * k + 1;
			end = start + k - 1;
			cnt++;
		}
	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[m];
	rep(i, m) cin >> p[i], p[i]--;
	sort(p, p + m);
	ll start = p[0] / k * k;
	ll end = start + k - 1;
	ll res = 1, cnt = 0, lastcnt = 0;
	cerr << start << " " << end << endl;
	rep(i, m){
		if(p[i] - lastcnt <= end) cnt++;
		else{
			res++;
			lastcnt = cnt;
			p[i] -= lastcnt;

		ll start = p[i] / k * k;
		ll end = start + k - 1;
	cerr << start << " " << end << endl;
			cnt++;
		}

	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[m];
	rep(i, m) cin >> p[i];
	sort(p, p + m);
	ll start = p[0] / k * k + 1;
	ll end = start + k - 1;
	ll res = 1, cnt = 0, lastcnt = 0;
	rep(i, m){
		if(p[i] - lastcnt <= end) cnt++;
		else{
			res++;
			lastcnt = cnt;
			p[i] -= lastcnt;
			ll start = p[i] / k * k + 1;
			ll end = start + k - 1;
		cnt++;
		}
	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[m];
	rep(i, m) cin >> p[i], p[i]--;
	sort(p, p + m);
	ll start = p[0] / (k) * k;
	ll end = start + k;
	end = min(end, n);
	ll cnt = 0;
	ll res = 1;
	ll lastcnt = 0;
	rep(i, m){
		if(p[i] - lastcnt <= end) cnt++;
		else{
			res++;
			lastcnt = cnt;
			p[i] -= lastcnt;
			start = p[i] / (k) * k;
			end = start + k;
			end = min(end, n);
			cnt++;
		}

	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[m];
	rep(i, m) cin >> p[i];
	sort(p, p + m);
	ll start = (p[0] - 1) / k * k + 1;
	ll end = start + k - 1;
	ll res = 1, cnt = 0, lastcnt = 0;
	rep(i, m){
		if(p[i] - lastcnt <= end) cnt++;
		else{
			res++;
			lastcnt = cnt;
			p[i] -= lastcnt;
			ll start = (p[i] - 1) / k * k + 1;
			ll end = start + k - 1;
				cnt++;
		}
	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[n];
	rep(i, m) cin >> p[i];
	ll start = p[0] / (k + 1) * k;
	ll end = start + k;
	int cnt = 0;
	int res = 1;
	int lastcnt = 0;
	rep(i, m){
		if(p[i] - lastcnt <= end) cnt++;
		else{
			res++;
			lastcnt = cnt;
			p[i] -= lastcnt;
			start = p[i] / (k + 1) * k;
			end = start + k;
			cnt++;
		}

	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[n];
	rep(i, m) cin >> p[i];
	ll start = p[0] / (k + 1) * k;
	ll end = start + k;
	llt cnt = 0;
	ll res = 1;
	ll lastcnt = 0;
	rep(i, m){
		if(p[i] - lastcnt <= end) cnt++;
		else{
			res++;
			lastcnt = cnt;
			p[i] -= lastcnt;
			start = p[i] / (k + 1) * k;
			end = start + k;
			cnt++;
		}

	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[m];
	rep(i, m) cin >> p[i];
	sort(p, p + m);
	ll start = (p[0] / k - (p[0] % k == 0))  * k + 1;
	ll end = start + k - 1;
	ll res = 1, cnt = 0, lastcnt = 0;
	rep(i, m){
		if(p[i] - lastcnt <= end) cnt++;
		else{
			res++;
			lastcnt = cnt;
			p[i] -= lastcnt;
			ll start = (p[i] / k - (p[i] % k == 0)) * k + 1;
			ll end = start + k - 1;
			cnt++;
		}
	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[m];
	rep(i, m) cin >> p[i];
	sort(p, p + m);
	ll start = p[0] / (k + 1) * k + 1;
	ll end = start + k - 1;
	ll cnt = 0;
	ll res = 1;
	ll lastcnt = 0;
	rep(i, m){
		if(p[i] - lastcnt <= end) cnt++;
		else{
			res++;
			lastcnt = cnt;
			p[i] -= lastcnt;
			start = p[i] / (k + 1) * k + 1;
			end = start + k - 1;
			cnt++;
		}

	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(int i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[n];
	rep(i, m) cin >> p[i];
	ll start = p[0] / (k + 1) * k;
	ll end = start + k;
	ll cnt = 0;
	ll res = 1;
	ll lastcnt = 0;
	rep(i, m){
		if(p[i] - lastcnt <= end) cnt++;
		else{
			res++;
			lastcnt = cnt;
			p[i] -= lastcnt;
			start = p[i] / (k + 1) * k;
			end = start + k;
			cnt++;
		}

	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[m];
	rep(i, m) cin >> p[i];
	sort(p, p + m);
	ll start = p[0] / k - (p[0] % k == 0);
	start *= k;
	start += 1;
	ll end = start + k - 1;
	cout << start << " " << end << endl;
	ll cnt = 0;
	ll res = 1;
	ll lastcnt = 0;
	rep(i, m){
		if(p[i] - lastcnt <= end) cnt++;
		else{
			res++;
			lastcnt = cnt;
			p[i] -= lastcnt;
			ll start = p[i] / k - (p[i] % k == 0);
			start *= k;
			start += 1;
			ll end = start + k - 1;
			cnt++;
		}

	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[m];
	rep(i, m) cin >> p[i];
	sort(p, p + m);
	ll start = (p[0] / k - (p[0] % k == 0))  * k + 1;
	ll end = start + k - 1;
	ll res = 1, cnt = 0, lastcnt = 0;
	rep(i, m){
		p[i] -= lastcnt;
		if(p[i] <= end) cnt++;
		else{
			res++;
			lastcnt = cnt;
			ll start = (p[i] / k - (p[i] % k == 0)) * k + 1;
			ll end = start + k - 1;
			cnt++;
		}
	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include <bits/stdc++.h>
using namespace std;
template<class T> void ckmin(T &a, T b) { a = min(a, b); }
template<class T> void ckmax(T &a, T b) { a = max(a, b); }
#define pb push_back
#define mp make_pair
#define Red ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define F first
#define S second
#define sz(x) (int)x.size()
#define all(x) (x).begin(), (x).end()
#define rep(i, n) for(ll i = 0; i < n; ++i)
#define repr(i,n) for(int i = n - 1; i >= 0; --i)
#define Rep(i, a, n) for(int i = (a); i <=(n); ++i)
#define repst(i, n) for(auto it = n.begin(); it != n.end(); ++it)
#define Repr(i, a, n) for(int i = (n); i >= (a); --i)
typedef long long ll;

const int inf = int(1e9);
const int mod = inf + 7;
const int N = 5e5 + 555;
void solve()
{
	ll n, m, k;
	cin >> n >> m >> k;
	ll p[m];
	rep(i, m) cin >> p[i];
	sort(p, p + m);
	ll start = p[0] / (k + 1) * k;
	ll end = start + k;
	ll cnt = 0;
	ll res = 1;
	ll lastcnt = 0;
	rep(i, m){
		if(p[i] - lastcnt <= end) cnt++;
		else{
			res++;
			lastcnt = cnt;
			p[i] -= lastcnt;
			start = p[i] / (k + 1) * k;
			end = start + k;
			cnt++;
		}

	}
	cout << res;

}
int main()
{
	Red;
	solve();
	return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
long long n, m , k;
long long a[maxn];
int main(){
    cin >> n >> m >> k;
    for(int i = 1; i <= m ; i++) cin >> a[i];
        long long same = 0;long long sum = 0;
        long long ans = 0;long long temp = 0;
        for(int i = 1; i <= n + 1; ){

            if(ceil((1.0 *a[i] - 1.0 * temp) /( 1.0 *k))  == same){
                sum ++,i++;
                //i++
            }

            else{
                ///me ++;
                //cout << a[i] << endl;
                if(sum - temp) ans ++;
                temp = sum;
                same = ceil((1.0 *a[i] - 1.0 * temp) / (1.0 *k)) ;
               //cout << ceil (1.1111111) << endl;
            }
        }
        //if(sum - temp) ans ++;
        cout << ans << endl;
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
long long n, m , k,p,num=0,pp,b,c,ans=0,f=0;
long long a[maxn];
int main(){
    cin >> n >> m >> k;
    for(int i=0;i<m;i++){
        cin>>a[i];
    }
    for(int i=0;i<m;i++){
        if((a[i]-num)%k){
            c=(a[i]-num)/k+1;
        }
        else c=(a[i]-num)/k;
        for(int j=1;j<=k;j++){
            if((a[i+j]-num)%k){
                b=(a[i+j]-num)/k+1;
            }
            else b=(a[i+j]-num)/k;
            //printf("%lld %d %d %lld %lld %lld\n",a[i+j]-num,i,j,num,b,c);
            if(c!=b)i+=j-1,ans++,num+=j,f=1;
            if(num>=m||f==1){
                    if(i+1==m-1)ans++;
                    break;
            }
        }
        //if(f==1)break;
    }
    cout << ans << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
long long n, m , k,p,num=0,pp,b,c,ans=0,f=0;
long long a[maxn];
int main(){
    cin >> n >> m >> k;
    for(int i=0;i<m;i++){
        cin>>a[i];
    }
    for(int i=0;i<m;i++){
        if((a[i]-num)%k){
            c=(a[i]-num)/k+1;
        }
        else c=(a[i]-num)/k;
        for(int j=1;j<=k;j++){
            if((a[i+j]-num)%k){
                b=(a[i+j]-num)/k+1;
            }
            else b=(a[i+j]-num)/k;
            if(c!=b)i+=j-1,ans++,num+=j;
            if(num>=m){
                    f=1;break;
            }
        }
        if(f==1)break;
    }
    cout << ans << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5 + 7;
long long n, m , k;
long long a[maxn];
int main(){
    cin >> n >> m >> k;
    for(int i = 1; i <= m ; i++) cin >> a[i];
        long long same = 0;long long sum = 0;
        long long ans = 0;long long temp = 0;
        for(int i = 1; i <= n + 1; ){

            if(ceil((1.0 *a[i] - 1.0 * temp) /( 1.0 *k))  == same){
                sum ++,i++;
                //i++
            }

            else{
                ///me ++;
                //cout << a[i] << endl;
                if(sum - temp) ans ++;
                temp = sum;
                same = ceil((1.0 *a[i] - 1.0 * temp) / (1.0 *k)) ;
               //cout << ceil (1.1111111) << endl;
            }
        }
        //if(sum - temp) ans ++;
        cout << ans << endl;
        return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
long long n, m , k,p,num=0,pp,b,c,ans=0;
long long a[maxn];
int main(){
    cin >> n >> m >> k;
    if(n%k){
        p=n/k+1;
    }
    else p=n/k;

    for(int i=0;i<m;i++){
        cin>>a[i];
    }
    for(int i=0;i<m;i++){
        if((a[i]-num)%k){
            c=(a[i]-num)/k+1;
        }
        else c=(a[i]-num)/k;
        for(int j=1;j<k;j++){
            if((a[i+j]-num)%k){
                b=(a[i+j]-num)/k+1;
            }
            else b=(a[i+j]-num)/k;
            if(c!=b)i+=j-1,ans++,num+=j;
            if(num>=m)break;
        }
    }
    cout << ans << endl;
        return 0;
}


#include<bits/stdc++.h>
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define fuck(x) cout << '[' << #x << ' ' << x << ']' << endl;
using namespace std;
typedef long long ll;

const int MX = 1e5 + 5;
ll mx[MX << 2], lz[MX << 2], a[MX];

void PushUP (int rt) {
    mx[rt] = max (mx[rt << 1], mx[rt << 1 | 1]);
}
void PushDown (int rt) {
    if (lz[rt]) {
        mx[rt << 1] += lz[rt], mx[rt << 1 | 1] += lz[rt];
        lz[rt << 1] += lz[rt], lz[rt << 1 | 1] += lz[rt];
        lz[rt] = 0;
    }
}
void build (int l, int r, int rt) {
    if (l == r) {
        scanf ("%d", &mx[rt]);
        mx[rt]--;
        a[l] = mx[rt];
        return;
    }
    int m = (l + r) >> 1;
    build (lson), build (rson);
    PushUP (rt);
}
void update (int L, int R, int x, int l, int r, int rt) {
    if (L <= l && R >= r) {
        mx[rt] -= x;
        lz[rt] -= x;
        return;
    }
    PushDown (rt);
    int m = (l + r) >> 1;
    if (L <= m) update (L, R, x, lson);
    if (R > m) update (L, R, x, rson);
    PushUP (rt);
}
int query (int L, int R, ll x, int l, int r, int rt) {
    if (l == r) return l;
    PushDown (rt);
    int m = (l + r) >> 1;
    if (L <= m && R > m) {
        if (mx[rt << 1] < x) return query (L, R, x, rson);
        return query (L, R, x, lson);
    }
    if (L <= m) return query (L, R, x, lson);
    return query (L, R, x, rson);
}
ll find (int p, int l, int r, int rt) {
    if (l == r) return mx[rt];
    PushDown (rt);
    int m = (l + r) >> 1;
    if (p <= m) return find (p, lson);
    return find (p, rson);
}

int main() {
#ifdef LOCAL
    freopen ("in.txt", "r", stdin);
#endif // LOCAL
    ll n, k;
    int m;
    cin >> n >> m >> k;
    build (1, m, 1);
    int cnt = 0, idx = 1;
    while (idx <= n) {
        cnt++;
        ll pag = find (idx, 1, m, 1) / k;
        int r = query (idx, m, (pag + 1) * k - 1, 1, m, 1);
        if (r == m) break;
        update (idx, m, r - idx + 1, 1, m, 1);
        idx = r + 1;
    }
    printf ("%d\n", cnt);
    return 0;
}


#include<bits/stdc++.h>
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define fuck(x) cout << '[' << #x << ' ' << x << ']' << endl;
using namespace std;
typedef long long ll;

const int MX = 1e5 + 5;
ll mx[MX << 2], lz[MX << 2], a[MX];

void PushUP (int rt) {
    mx[rt] = max (mx[rt << 1], mx[rt << 1 | 1]);
}
void PushDown (int rt) {
    if (lz[rt]) {
        mx[rt << 1] += lz[rt], mx[rt << 1 | 1] += lz[rt];
        lz[rt << 1] += lz[rt], lz[rt << 1 | 1] += lz[rt];
        lz[rt] = 0;
    }
}
void build (int l, int r, int rt) {
    if (l == r) {
        scanf ("%d", &mx[rt]);
        mx[rt]--;
        a[l] = mx[rt];
        return;
    }
    int m = (l + r) >> 1;
    build (lson), build (rson);
    PushUP (rt);
}
void update (int L, int R, int x, int l, int r, int rt) {
    if (L <= l && R >= r) {
        mx[rt] -= x;
        lz[rt] -= x;
        return;
    }
    PushDown (rt);
    int m = (l + r) >> 1;
    if (L <= m) update (L, R, x, lson);
    if (R > m) update (L, R, x, rson);
    PushUP (rt);
}
int query (int L, int R, ll x, int l, int r, int rt) {
    if (l == r) return l;
    PushDown (rt);
    int m = (l + r) >> 1;
    if (L <= m && R > m) {
        if (mx[rt << 1] < x) return query (L, R, x, rson);
        return query (L, R, x, lson);
    }
    if (L <= m) return query (L, R, x, lson);
    return query (L, R, x, rson);
}
ll find (int p, int l, int r, int rt) {
    if (l == r) return mx[rt];
    PushDown (rt);
    int m = (l + r) >> 1;
    if (p <= m) return find (p, lson);
    return find (p, rson);
}

int main() {
#ifdef LOCAL
    freopen ("in.txt", "r", stdin);
#endif // LOCAL
    ll n, k;
    int m;
    cin >> n >> m >> k;
    build (1, m, 1);
    int cnt = 0, idx = 1;
    for (;idx <= n;) {
        cnt++;
        ll pag = find (idx, 1, m, 1) / k;
        int r = query (idx, m, (pag + 1) * k - 1, 1, m, 1);
        if (r == m) break;
        update (idx, m, r - idx + 1, 1, m, 1);
        idx = r + 1;
    }
    printf ("%d\n", cnt);
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
long long n, m , k,p,num=0,pp,b,c,ans=0;
long long a[maxn];
int main(){
    cin >> n >> m >> k;
    for(int i=0;i<m;i++){
        cin>>a[i];
    }
    for(int i=0;i<m;i++){
        if((a[i]-num)%k){
            c=(a[i]-num)/k+1;
        }
        else c=(a[i]-num)/k;
        for(int j=1;j<k;j++){
            if((a[i+j]-num)%k){
                b=(a[i+j]-num)/k+1;
            }
            else b=(a[i+j]-num)/k;
            if(c!=b)i+=j-1,ans++,num+=j-1;
            if(num>=m)break;
        }
    }
    cout << ans << endl;
    return 0;
}


#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e6 + 7;
long long n, m , k,p,num=0,pp,b,c,ans=0,f=0;
long long a[maxn];
int main(){
    cin >> n >> m >> k;
    for(int i=0;i<m;i++){
        cin>>a[i];
    }
    if(n%k){
        b=n/k+1;

    }
    else b=n/k;
    for(int i=0;i<m;i++){
        if((a[i]-num)%k){
            c=(a[i]-num)/k+1;
        }
        else c=(a[i]-num)/k;
        if(i==m-1){
             ans++;
                cout << ans << endl;
                return 0;
        }
        for(int j=1;j<=k;j++){

            if((a[i+j]-num)%k){
                b=(a[i+j]-num)/k+1;

            }
            else b=(a[i+j]-num)/k;
            //printf("%lld %lld %d %d %lld %lld %lld\n",a[i]-num,a[i+j]-num,i,j,num,b,c);
            if(c!=b){
                    i+=j-1,ans++,num+=j,f=1;
                    break;
            }
            if(i+j>=m-1){
                ans++;
                cout << ans << endl;
                return 0;
            }

            /*if(num>=m||f==1){
                    if(i+1==m-1)ans++;
                    f=0;
                    break;
            }*/
        }
        //if(f==1)break;
    }
    cout << ans << endl;
    return 0;
}


#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define ff first
#define ss second
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<db, db> pdd;
typedef vector<int> vi;
#define m1 make_pair
#define in insert
#define pb push_back
#define IOS                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define endl "\n"
inline ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
inline ll power(ll a, ll n, ll m)
{
    if (n == 0)
        return 1;
    ll p = power(a, n / 2, m);
    p = (p * p) % m;
    if (n % 2)
        return (p * a) % m;
    else
        return p;
}
const ll MOD = 998244353;
const int N = int(3e5) + 999;
#define int long long int

int32_t main()
{
    IOS;
    int n, m, k;
    cin >> n >> m >> k;
    int arr[m];
    for (int i = 0; i < m; i++)
        cin >> arr[i];
    int offset = 0;
    int tot = 0;
    int del = 0;
    vector<int> st;
    int ans = 0;
    for (int i = 0; i < m; i++)
    {
        tot = arr[i] - del - offset;
       // cout<<offset<<" "<<i<<" "<<arr[i]<<" " <<tot<<endl;
        assert(tot>=0);
        if (tot == k)
        {
            ans++;
            del+=st.size()+1;
            st.clear();
        }
        else if (tot < k)
        {
            st.pb(arr[i]);
        }
        else
        {
            if (tot - k <= st.size())
            {
                if (st.size())
                    ans++;
                del += st.size();
                st.clear();
                i--;
            }
            else
            {
                if (st.size())
                    ans++;
                del+=st.size();
                offset = k * ((tot - st.size()) / k);
                st.clear();
               // del = 0;
                i--;
            }
        }
    }
    if (st.size())
        ans++;
    cout << ans;
}


#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define ff first
#define ss second
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<db, db> pdd;
typedef vector<int> vi;
#define m1 make_pair
#define in insert
#define pb push_back
#define IOS                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define endl "\n"
inline ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
inline ll power(ll a, ll n, ll m)
{
    if (n == 0)
        return 1;
    ll p = power(a, n / 2, m);
    p = (p * p) % m;
    if (n % 2)
        return (p * a) % m;
    else
        return p;
}
const ll MOD = 998244353;
const int N = int(3e5) + 999;
#define int long long int

int32_t main()
{
    IOS;
    int n, m, k;
    cin >> n >> m >> k;
    int arr[m];
    for (int i = 0; i < m; i++)
        cin >> arr[i];
    int offset = 0;
    int tot = 0;
    int del = 0;
    vector<int> st;
    int ans = 0;
    for (int i = 0; i < m; i++)
    {
        tot = arr[i] - del - offset;
        //cout<<offset<<" "<<i<<" "<<arr[i]<<" " <<tot<<endl;
        //assert(tot>=0);
        if (tot == k)
        {
            ans++;
            del+=st.size()+1;
            st.clear();
        }
        else if (tot < k)
        {
            st.pb(arr[i]);
        }
        else
        {
            if (tot - k <= st.size())
            {
                if (st.size())
                    ans++;
                del += st.size();
                st.clear();
                i--;
            }
            else
            {
                if (st.size())
                    ans++;
                del+=st.size();
                offset = k * ((arr[i] - del -1)/ k);
                st.clear();
                // del = 0;
                i--;
            }
        }
    }
    if (st.size())
        ans++;
    cout << ans;
}


#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define ff first
#define ss second
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<db, db> pdd;
typedef vector<int> vi;
#define m1 make_pair
#define in insert
#define pb push_back
#define IOS                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define endl "\n"
inline ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
inline ll power(ll a, ll n, ll m)
{
    if (n == 0)
        return 1;
    ll p = power(a, n / 2, m);
    p = (p * p) % m;
    if (n % 2)
        return (p * a) % m;
    else
        return p;
}
const ll MOD = 998244353;
const int N = int(3e5) + 999;
#define int long long int

int32_t main()
{
    IOS;
    int n, m, k;
    cin >> n >> m >> k;
    int arr[m];
    for (int i = 0; i < m; i++)
        cin >> arr[i];
    int offset = 0;
    int tot = 0;
    int del = 0;
    vector<int> st;
    int ans = 0;
    for (int i = 0; i < m; i++)
    {
        tot = arr[i] - del - offset;
        cout<<offset<<" "<<i<<" "<<arr[i]<<" " <<tot<<endl;
        //assert(tot>=0);
        if (tot == k)
        {
            ans++;
            del+=st.size()+1;
            st.clear();
        }
        else if (tot < k)
        {
            st.pb(arr[i]);
        }
        else
        {
            if (tot - k <= st.size())
            {
                if (st.size())
                    ans++;
                del += st.size();
                st.clear();
                i--;
            }
            else
            {
                if (st.size())
                    ans++;
                del+=st.size();
                offset = k * ((arr[i] - del -1)/ k);
                st.clear();
                // del = 0;
                i--;
            }
        }
    }
    if (st.size())
        ans++;
    cout << ans;
}


#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define ff first
#define ss second
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<db, db> pdd;
typedef vector<int> vi;
#define m1 make_pair
#define in insert
#define pb push_back
#define IOS                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define endl "\n"
inline ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
inline ll power(ll a, ll n, ll m)
{
    if (n == 0)
        return 1;
    ll p = power(a, n / 2, m);
    p = (p * p) % m;
    if (n % 2)
        return (p * a) % m;
    else
        return p;
}
const ll MOD = 998244353;
const int N = int(3e5) + 999;
#define int long long int

int32_t main()
{
    IOS;
    int n, m, k;
    cin >> n >> m >> k;
    int arr[m];
    for (int i = 0; i < m; i++)
        cin >> arr[i];
    int offset = 0;
    int tot = 0;
    int del = 0;
    vector<int> st;
    int ans = 0;
    for (int i = 0; i < m; i++)
    {
        tot = arr[i] - del - offset;
       // cout<<offset<<" "<<i<<" "<<arr[i]<<" " <<tot<<endl;
        assert(tot>=0);
        if (tot == k)
        {
            ans++;
            del+=st.size()+1;
            st.clear();
        }
        else if (tot < k)
        {
            st.pb(arr[i]);
        }
        else
        {
            if (tot - k <= st.size())
            {
                if (st.size())
                    ans++;
                del += st.size();
                st.clear();
                i--;
            }
            else
            {
                if (st.size())
                    ans++;
                del+=st.size();
                offset = k * ((arr[i] - del )/ k);
                st.clear();
               // del = 0;
                i--;
            }
        }
    }
    if (st.size())
        ans++;
    cout << ans;
}


#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define ff first
#define ss second
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<db, db> pdd;
typedef vector<int> vi;
#define m1 make_pair
#define in insert
#define pb push_back
#define IOS                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define endl "\n"
inline ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
inline ll power(ll a, ll n, ll m)
{
    if (n == 0)
        return 1;
    ll p = power(a, n / 2, m);
    p = (p * p) % m;
    if (n % 2)
        return (p * a) % m;
    else
        return p;
}
const ll MOD = 998244353;
const int N = int(3e5) + 999;
#define int long long int

int32_t main()
{
    IOS;
    int n, m, k;
    cin >> n >> m >> k;
    int arr[m];
    for (int i = 0; i < m; i++)
        cin >> arr[i];
    int offset = 0;
    int tot = 0;
    int del = 0;
    vector<int> st;
    int ans = 0;
    for (int i = 0; i < m; i++)
    {
        tot = arr[i] - del - offset;
       // cout<<offset<<" "<<i<<" "<<arr[i]<<" " <<tot<<endl;
        assert(tot>=0);
        if (tot == k)
        {
            ans++;
            del+=st.size()+1;
            st.clear();
        }
        else if (tot < k)
        {
            st.pb(arr[i]);
        }
        else
        {
            if (tot - k <= st.size())
            {
                if (st.size())
                    ans++;
                del += st.size();
                st.clear();
                i--;
            }
            else
            {
                if (st.size())
                    ans++;
                del+=st.size();
                offset += k * ((tot - st.size()) / k);
                st.clear();
               // del = 0;
                i--;
            }
        }
    }
    if (st.size())
        ans++;
    cout << ans;
}


#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define ff first
#define ss second
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<db, db> pdd;
typedef vector<int> vi;
#define m1 make_pair
#define in insert
#define pb push_back
#define IOS                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define endl "\n"
inline ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
inline ll power(ll a, ll n, ll m)
{
    if (n == 0)
        return 1;
    ll p = power(a, n / 2, m);
    p = (p * p) % m;
    if (n % 2)
        return (p * a) % m;
    else
        return p;
}
const ll MOD = 998244353;
const int N = int(3e5) + 999;
#define int long long int

int32_t main()
{
    IOS;
    int n, m, k;
    cin >> n >> m >> k;
    int arr[m];
    for (int i = 0; i < m; i++)
        cin >> arr[i];
    int offset = 0;
    int tot = 0;
    int del = 0;
    stack<int> st;
    int ans = 0;
    for (int i = 0; i < m; i++)
    {
        tot = arr[i] - del - offset;
        if (tot == k)
        {
            ans++;
            st.push(arr[i]);
            while (!st.empty())
            {
                st.pop();
                del++;
            }
        }
        else if (tot < k)
        {
            st.push(arr[i]);
        }
        else
        {
            if (tot <= st.size())
            {
                if (st.size())
                    ans++;
                while (!st.empty())
                {
                    st.pop();
                    del++;
                }
                del = 0;
                i--;
            }
            else
            {
                if (st.size())
                    ans++;
                while (!st.empty())
                {
                    st.pop();
                    del++;
                }
                del = 0;
                offset = k * ((tot - del) / k);
                i--;
            }
        }
    }
    if (st.size())
        ans++;
    cout << ans;
}


#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define ff first
#define ss second
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<db, db> pdd;
typedef vector<int> vi;
#define m1 make_pair
#define in insert
#define pb push_back
#define IOS                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define endl "\n"
inline ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
inline ll power(ll a, ll n, ll m)
{
    if (n == 0)
        return 1;
    ll p = power(a, n / 2, m);
    p = (p * p) % m;
    if (n % 2)
        return (p * a) % m;
    else
        return p;
}
const ll MOD = 998244353;
const int N = int(3e5) + 999;
#define int long long int

int32_t main()
{
    IOS;
    int n, m, k;
    cin >> n >> m >> k;
    int arr[m];
    for (int i = 0; i < m; i++)
        cin >> arr[i];
    int offset = 0;
    int tot = 0;
    int del = 0;
    vector<int> st;
    int ans = 0;
    for (int i = 0; i < m; i++)
    {
        tot = arr[i] - del - offset;
        //cout<<offset<<" "<<i<<" "<<arr[i]<<" " <<tot<<endl;
        assert(tot>=0);
        if (tot == k)
        {
            ans++;
            del+=st.size()+1;
            st.clear();
        }
        else if (tot < k)
        {
            st.pb(arr[i]);
        }
        else
        {
            if (tot - k <= st.size())
            {
                if (st.size())
                    ans++;
                del += st.size();
                st.clear();
                i--;
            }
            else
            {
                if (st.size())
                    ans++;
                del+=st.size();
                offset = k * ((tot - st.size()) / k);
                st.clear();
                del = 0;
                i--;
            }
        }
    }
    if (st.size())
        ans++;
    cout << ans;
}


#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define ff first
#define ss second
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<db, db> pdd;
typedef vector<int> vi;
#define m1 make_pair
#define in insert
#define pb push_back
#define IOS                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define endl "\n"
inline ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
inline ll power(ll a, ll n, ll m)
{
    if (n == 0)
        return 1;
    ll p = power(a, n / 2, m);
    p = (p * p) % m;
    if (n % 2)
        return (p * a) % m;
    else
        return p;
}
const ll MOD = 998244353;
const int N = int(3e5) + 999;
#define int long long int

int32_t main()
{
    IOS;
    int n, m, k;
    cin >> n >> m >> k;
    int arr[m];
    for (int i = 0; i < m; i++)
        cin >> arr[i];
    int offset = 0;
    int tot = 0;
    int del = 0;
    vector<int> st;
    int ans = 0;
    for (int i = 0; i < m; i++)
    {
        tot = arr[i] - del - offset;
        if (tot == k)
        {
            ans++;
            del+=st.size()+1;
            st.clear();
        }
        else if (tot < k)
        {
            st.pb(arr[i]);
        }
        else
        {
            if (tot <= st.size())
            {
                if (st.size())
                    ans++;
                del += st.size();
                st.clear();
                i--;
            }
            else
            {
                if (st.size())
                    ans++;
                del+=st.size();
                st.clear();
                offset = k * ((tot - del) / k);
                del = 0;
                i--;
            }
        }
    }
    if (st.size())
        ans++;
    cout << ans;
}


#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define ff first
#define ss second
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<db, db> pdd;
typedef vector<int> vi;
#define m1 make_pair
#define in insert
#define pb push_back
#define IOS                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define endl "\n"
inline ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
inline ll power(ll a, ll n, ll m)
{
    if (n == 0)
        return 1;
    ll p = power(a, n / 2, m);
    p = (p * p) % m;
    if (n % 2)
        return (p * a) % m;
    else
        return p;
}
const ll MOD = 998244353;
const int N = int(3e5) + 999;
#define int long long int

int32_t main()
{
    IOS;
    int n, m, k;
    cin >> n >> m >> k;
    int arr[m];
    for (int i = 0; i < m; i++)
        cin >> arr[i];
    int offset = 0;
    int tot = 0;
    int del = 0;
    vector<int> st;
    int ans = 0;
    for (int i = 0; i < m; i++)
    {
        tot = arr[i] - del - offset;
        if (tot == k)
        {
            ans++;
            del+=st.size()+1;
            st.clear();
        }
        else if (tot < k)
        {
            st.pb(arr[i]);
        }
        else
        {
            if (tot - k <= st.size())
            {
                if (st.size())
                    ans++;
                del += st.size();
                st.clear();
                i--;
            }
            else
            {
                if (st.size())
                    ans++;
                del+=st.size();
                st.clear();
                offset = k * ((tot - del) / k);
                del = 0;
                i--;
            }
        }
    }
    if (st.size())
        ans++;
    cout << ans;
}


#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define ff first
#define ss second
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<db, db> pdd;
typedef vector<int> vi;
#define m1 make_pair
#define in insert
#define pb push_back
#define IOS                           \
    std::ios::sync_with_stdio(false); \
    cin.tie(NULL);                    \
    cout.tie(NULL);
#define endl "\n"
inline ll gcd(ll a, ll b)
{
    if (a == 0)
        return b;
    return gcd(b % a, a);
}
inline ll power(ll a, ll n, ll m)
{
    if (n == 0)
        return 1;
    ll p = power(a, n / 2, m);
    p = (p * p) % m;
    if (n % 2)
        return (p * a) % m;
    else
        return p;
}
const ll MOD = 998244353;
const int N = int(3e5) + 999;
#define int long long int

int32_t main()
{
    IOS;
    int n, m, k;
    cin >> n >> m >> k;
    int arr[m];
    for (int i = 0; i < m; i++)
        cin >> arr[i];
    int offset = 0;
    int tot = 0;
    int del = 0;
    vector<int> st;
    int ans = 0;
    for (int i = 0; i < m; i++)
    {
        tot = arr[i] - del - offset;
       // cout<<offset<<" "<<i<<" "<<arr[i]<<" " <<tot<<endl;
        assert(tot>=0);
        if (tot == k)
        {
            ans++;
            del+=st.size()+1;
            st.clear();
        }
        else if (tot < k)
        {
            st.pb(arr[i]);
        }
        else
        {
            if (tot - k <= st.size())
            {
                if (st.size())
                    ans++;
                del += st.size();
                st.clear();
                i--;
            }
            else
            {
                if (st.size())
                    ans++;
                del+=st.size();
                offset = k * ((arr[i] - del / k);
                st.clear();
               // del = 0;
                i--;
            }
        }
    }
    if (st.size())
        ans++;
    cout << ans;
}


#include <bits/stdc++.h>

using namespace std;

int main(void)
{
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);

	long long n, k;
	long long m;
	cin >> n >> m >> k;
	vector<long long> p(m);
	for (int i = 0; i < m; i++) {
		cin >> p[i];
	}
	long long res = 1;
	long long sk = 0;
	long long cn = 0;
	bool g = true;
	long long curr = p[0] / k;
	long long start = 0;
	while (g) {
		bool first = true;
		for (int i = start; i < p.size(); i++) {
			if (p[i] - sk > curr * k) {
				if (i == start) {
					curr = (p[i] - sk) / k;
				}
				break;
			}
			first = false;
			cn++;
			start++;
		}
		if (start >= p.size()) {
			break;
		}
		curr++;
		if (!first) {
			res++;
			curr--;
		}
		sk = cn;
	}
	cout << res << '\n';

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(void)
{
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);

	long long n, k;
	long long m;
	cin >> n >> m >> k;
	vector<long long> p(m);
	for (int i = 0; i < m; i++) {
		cin >> p[i];
	}
	long long res = 1;
	long long sk = 0;
	long long cn = 0;
	bool g = true;
	long long curr = p[0] / k;
	long long start = 0;
	while (g) {
		bool first = true;
		for (int i = start; i < p.size(); i++) {
			if (p[i] - sk > curr * k) {
				if (i == start) {
					curr = p[i] / k;
				}
				break;
			}
			first = false;
			cn++;
			start++;
		}
		if (start >= p.size()) {
			break;
		}
		curr++;
		if (!first) {
			res++;
			curr--;
		}
		sk = cn;
	}
	cout << res << '\n';

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(void)
{
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);

	long long n, k;
	int m;
	cin >> n >> m >> k;
	vector<int> p(m);
	for (int i = 0; i < m; i++) {
		cin >> p[i];
	}
	long long res = 1;
	int sk = 0;
	int cn = 0;
	bool g = true;
	int curr = 0;
	while (g) {
		bool first = true;
		for (int l : p) {
			if (l - sk > curr * k) {
				break;
			}
			first = false;
			cn++;
		}
		for (int i = 0; i < cn - sk; i++) {
			p.erase(p.begin());
		}
		if (p.empty()) {
			break;
		}
		curr++;
		if (!first) {
			res++;
			curr--;
		}
		sk = cn;
	}
	cout << res << '\n';

	return 0;
}


#include <bits/stdc++.h>

using namespace std;

int main(void)
{
	ios_base::sync_with_stdio(0);
	cin.tie(NULL);

	long long n, k;
	int m;
	cin >> n >> m >> k;
	vector<int> p(m);
	for (int i = 0; i < m; i++) {
		cin >> p[i];
	}
	long long res = 1;
	int sk = 0;
	int cn = 0;
	bool g = true;
	int curr = 0;
	int start = 0;
	while (g) {
		bool first = true;
		for (int i = start; i < p.size(); i++) {
			if (p[i] - sk > curr * k) {
				break;
			}
			first = false;
			cn++;
		}
		start += cn - sk;
		if (start >= p.size()) {
			break;
		}
		curr++;
		if (!first) {
			res++;
			curr--;
		}
		sk = cn;
	}
	cout << res << '\n';

	return 0;
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) x.begin(),x.end()
const int N =1e5;
bool srt(pair<long double,int> p1,pair<long double,int> p2)
{
  if(p1.first != p2.first)
    return p1.first > p2.first;
  else
    return p1.second < p2.second;
}
int main()
{
  #ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  #else
  #endif
  vector<pair<long double,int>> v;
  long double t1,t2,k,a,b,s1,s2;
  int n;
  cin>>n>>t1>>t2>>k;
  for(int i=0;i<n;i++)
  {
    cin>>a>>b;
    s1 = a*t1*(100L-k)/100.0L +(t2*b),s2=b*t1*(100L-k)/100.0L + (t2*a);
    if(s2>s1)
      swap(s2,s1);
    //cout <<s1<<" "<<s2<<endl;
    v.push_back({s1,i+1});
  }
  sort(all(v),srt);
  for(auto x : v)
   printf("%d %0.2Lf\n",x.second,x.first);
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) x.begin(),x.end()
const int N =1e5;
int main()
{
  #ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  #else
  #endif
  vector<pair<long double,int>> v;
  long double t1,t2,k,a,b,s1,s2;
  int n;
  cin>>n>>t1>>t2>>k;
  for(int i=0;i<n;i++)
  {
    cin>>a>>b;
    s1 = a*t1*(100L-k)/100.0L +(t2*b),s2=b*t1*(100L-k)/100.0L + (t2*a);
    if(s2>s1)
      swap(s2,s1);
    v.push_back({-s1,i+1});
  }
  sort(all(v));
  for(auto x : v)
   printf("%d %0.2Lf\n",x.second,-x.first);
}


#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) x.begin(),x.end()
const int N =1e5;
bool srt(pair<long double,int> p1,pair<long double,int> p2)
{
  if(p1.first - p2.first> 1e-3)
    return p1.first - p2.first;
  else
    return p1.second < p2.second;
}
int main()
{
  #ifndef ONLINE_JUDGE
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
  #else
  #endif
  vector<pair<long double,int>> v;
  long double t1,t2,k,a,b,s1,s2;
  int n;
  cin>>n>>t1>>t2>>k;
  for(int i=0;i<n;i++)
  {
    cin>>a>>b;
    s1 = a*t1 + (1.0L/100.0L *(100.0L-k)*t2*b),s2=b*t1 + (1.0L/100.0L*(100.0L-k)*t2*a);
    if(s2>s1)
      swap(s2,s1);
    //cout <<s1<<" "<<s2<<endl;
    v.push_back({s1,i+1});
  }
  sort(all(v),srt);
  for(auto x : v)
   printf("%d %0.2Lf\n",x.second,x.first);
}


#include <bits/stdc++.h>
double maxx(double a,double b)
{return (a>b)?a:b;

}
using namespace std;
bool ar(const pair<int, int>&a,const pair<int, int>&b)
{
    if(a.second>b.second)
    return true;
    else if(a.second==b.second)
    {
        if(a.first<b.first)
            return true;
        else
            return false;
    }
    else return false;
}
int main()
{
int n,t1,t2,k;
   cin>>n>>t1>>t2>>k;
    vector<pair<int,double>> p;
    for(int i=0;i<n;i++)
    {
        int a,b;
        cin>>a>>b;
        double ans=a*t1*((double)(100-k)/(double)100)+b*t2;
        ans=maxx(ans,b*t1*((double)(100-k)/(double)100)+a*t2);
            p.push_back(make_pair(i+1,ans));

    }
     sort(p.begin(),p.end(),ar);
    for(int i=0;i<p.size();i++)
        {
            cout<<p[i].first<<" "<<fixed<<setprecision(2)<<p[i].second<<endl;
        }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
bool ar(const pair<int, int>&a,const pair<int, int>&b)
{
    return a.second>b.second;
}
int main()
{
int n,t1,t2,k;
   cin>>n>>t1>>t2>>k;
    vector<pair<int,double>> p;
    for(int i=0;i<n;i++)
    {
        int a,b;
        cin>>a>>b;
        double ans=a*t1*((double)(100-k)/(double)100)+b*t2;
        ans=max(ans,b*t1*((double)(100-k)/(double)100)+a*t2);
            p.push_back(make_pair(i+1,ans));

    }
     sort(p.begin(),p.end(),ar);
    for(int i=0;i<p.size();i++)
        {
            cout<<p[i].first<<" "<<fixed<<setprecision(2)<<p[i].second<<endl;
        }
    return 0;
}


#include <bits/stdc++.h>

using namespace std;
bool ar(const pair<int, int>&a,const pair<int, int>&b)
{
    return a.second>b.second;
}
int main()
{
int n,t1,t2,k;
   cin>>n>>t1>>t2>>k;
    vector<pair<int,double>> p;
    for(int i=0;i<n;i++)
    {
        int a,b;
        cin>>a>>b;
        double ans=a*t1*((double)(100-k)/(double)100)+b*t2;
        ans=max(ans,b*t1*((double)(100-k)/(double)100)+a*t2);
            p.push_back(make_pair(i+1,ans));

    }
     sort(p.begin(),p.end(),ar);
    for(int i=0;i<p.size();i++)
        {
            cout<<p[i].first<<" "<<fixed<<setprecision(6)<<p[i].second<<endl;
        }
    return 0;
}


#include <bits/stdc++.h>
double maxx(double a,double b)
{return (a>b)?a:b;

}
using namespace std;
bool ar(const pair<int, double>&a,const pair<int, double>&b)
{
    if(a.second>b.second)
    return true;
    else if(a.second==b.second)
    {
        if(a.first<b.first)
            return true;
        else
            return false;
    }
    else return false;
}
int main()
{
int n,t1,t2,k;
   cin>>n>>t1>>t2>>k;
    vector<pair<int,double>> p;
    for(int i=0;i<n;i++)
    {
        int a,b;
        cin>>a>>b;
        double ans=a*t1*((double)(100-k)/(double)100)+(double)b*t2;
        ans=maxx(ans,b*t1*((double)(100-k)/(double)100)+(double)a*t2);
            p.push_back(make_pair(i+1,ans));

    }
     sort(p.begin(),p.end(),ar);
    for(int i=0;i<p.size();i++)
        {
            cout<<p[i].first<<" "<<fixed<<setprecision(2)<<p[i].second<<endl;
        }
    return 0;
}


#include <bits/stdc++.h>
double maxx(double a,double b)
{return (a>b)?a:b;

}
using namespace std;
bool ar(const pair<int, int>&a,const pair<int, int>&b)
{
    return a.second>b.second;
}
int main()
{
int n,t1,t2,k;
   cin>>n>>t1>>t2>>k;
    vector<pair<int,double>> p;
    for(int i=0;i<n;i++)
    {
        int a,b;
        cin>>a>>b;
        double ans=a*t1*((double)(100-k)/(double)100)+b*t2;
        ans=maxx(ans,b*t1*((double)(100-k)/(double)100)+a*t2);
            p.push_back(make_pair(i+1,ans));

    }
     sort(p.begin(),p.end(),ar);
    for(int i=0;i<p.size();i++)
        {
            cout<<p[i].first<<" "<<fixed<<setprecision(2)<<p[i].second<<endl;
        }
    return 0;
}


/*
   problem  - 186B
   13/01/19
   by ahmed_drawy
   sheet
   technique  : greedy - choose the bigger one in 2 cases and max on it
   self notes :
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;

//#define push_back               pb;
//#define make_pair               mp;
#define lp(i,start , end)       for(int i = start ; i<end ; ++i)
#define lllp(i,start , end)       for(ll i = start ; i<end ; ++i)
#define inN(arr ,  n) for(int i = 0 ; i< n ; ++i)  cin>>arr[i];
#define Rlp(i,start , end)      for(int i = start ; i>end ; --i)
#define all(v)                   ((v).begin(),(v).end())
#define sz(v)                  (int)((v).size())
#define clr(v,d)                memset(v , d , sizeof(v))
#define isOn(S, j) (S & (1 << j))
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define lowBit(S) (S & (-S))
#define setAll(S, n) (S = (1 << n) - 1)

#define modulo(S, N) ((S) & (N - 1))   // returns S % N, where N is a power of 2 *haven't understood this yet
#define isPowerOfTwo(S) (!(S & (S - 1)))            // done

#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))  // TBD
#define turnOffLastBit(S) ((S) & (S - 1))       // turn off last unset bit from right
#define turnOnLastZero(S) ((S) | (S + 1))       //turn on last unset bit from right
#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))
typedef long long               ll;
typedef vector<int>             vi;
typedef vector  <ll>            vll;
typedef vector<vector<int> >    adj;
typedef pair<int ,int>          pii;
const double EPS =1e-7;
const int OO = 1e6;
bool sortpair( const pair<int , int> & x, const pair<int , int> & y){
    return  x.first != y.first ? x.first < y.first : x.second > y.second ;
}
int dcomp(double x , double y){
    return fabs(x-y) <= EPS? 0: x>y?1:-1;
}
void smile(){
        ios_base::sync_with_stdio(0);
        cin.tie(NULL);
        cout.tie(NULL);
}
struct cmpPAIR{
    bool sortpair( const pair<int , int> & x, const pair<int , int> & y){
        return  x.first != y.first ? x.first > y.first : x.second < y.second ;
}
};

int main(){
	smile();
// 	freopen("in.txt", "r" , stdin);
	auto cmp = []( const pair<int , int> & x, const pair<int , int> & y){
        return  x.first != y.first ? x.first > y.first : x.second < y.second ;
    };///declaring function to sort the set with the criteria i want

    set<pair<double ,int> ,decltype(cmp) >mset(cmp);
    int n , t1 , t2  , a ,b ;
    double k ;
    cin >>n>>t1>>t2>>k;
    lp(i,0,n){
       cin>>a>>b;
        mset.insert({max((a- a*(k)/100 )*t1+ b*t2 , (b -b*(k)/100)*t1 + a*t2) , i+1});

    }
    cout<<fixed<<setprecision(2);
    for(auto it = mset.begin() ; it != mset.end() ; ++it){
        cout<<it->second << " "<<it->first<<'\n';
    }
}


/*
   problem  - 186B
   13/01/19
   by ahmed_drawy
   sheet
   technique  : greedy - choose the bigger one in 2 cases and max on it
   self notes :
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;

//#define push_back               pb;
//#define make_pair               mp;
#define lp(i,start , end)       for(int i = start ; i<end ; ++i)
#define lllp(i,start , end)       for(ll i = start ; i<end ; ++i)
#define inN(arr ,  n) for(int i = 0 ; i< n ; ++i)  cin>>arr[i];
#define Rlp(i,start , end)      for(int i = start ; i>end ; --i)
#define all(v)                   ((v).begin(),(v).end())
#define sz(v)                  (int)((v).size())
#define clr(v,d)                memset(v , d , sizeof(v))
#define isOn(S, j) (S & (1 << j))
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define lowBit(S) (S & (-S))
#define setAll(S, n) (S = (1 << n) - 1)

#define modulo(S, N) ((S) & (N - 1))   // returns S % N, where N is a power of 2 *haven't understood this yet
#define isPowerOfTwo(S) (!(S & (S - 1)))            // done

#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))  // TBD
#define turnOffLastBit(S) ((S) & (S - 1))       // turn off last unset bit from right
#define turnOnLastZero(S) ((S) | (S + 1))       //turn on last unset bit from right
#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))
typedef long long               ll;
typedef vector<int>             vi;
typedef vector  <ll>            vll;
typedef vector<vector<int> >    adj;
typedef pair<int ,int>          pii;
const double EPS =1e-7;
const int OO = 1e6;
bool sortpair( const pair<int , int> & x, const pair<int , int> & y){
    return  x.first != y.first ? x.first < y.first : x.second > y.second ;
}
int dcomp(double x , double y){
    return fabs(x-y) <= EPS? 0: x>y?1:-1;
}
void smile(){
        ios_base::sync_with_stdio(0);
        cin.tie(NULL);
        cout.tie(NULL);
}
struct cmpPAIR{
    bool sortpair( const pair<int , int> & x, const pair<int , int> & y){
        return  x.first != y.first ? x.first > y.first : x.second < y.second ;
}
};

int main(){
	smile();
// 	freopen("in.txt", "r" , stdin);
	auto cmp = []( const pair<int , int> & x, const pair<int , int> & y){
        return  x.first != y.first ? x.first > y.first : x.second < y.second ;
    };///declaring function to sort the set with the criteria i want

    set<pair<double ,int> ,decltype(cmp) >mset(cmp);
    int n , t1 , t2  , a ,b ;
    double k ;
    cin >>n>>t1>>t2>>k;
    lp(i,0,n){
       cin>>a>>b;
        mset.insert({max((a- a*(k)/100 )*t1+ b*t2 , (b -b*(k)/100)*t1 + a*t2) , i+1});

    }
    cout<<fixed;
    for(auto it = mset.begin() ; it != mset.end() ; ++it){
        cout<<it->second << " "<<it->first<<'\n';
    }
}


/*
   problem  - 186B
   13/01/19
   by ahmed_drawy
   sheet
   technique  : greedy - choose the bigger one in 2 cases and max on it
   self notes :
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;

//#define push_back               pb;
//#define make_pair               mp;
#define lp(i,start , end)       for(int i = start ; i<end ; ++i)
#define lllp(i,start , end)       for(ll i = start ; i<end ; ++i)
#define inN(arr ,  n) for(int i = 0 ; i< n ; ++i)  cin>>arr[i];
#define Rlp(i,start , end)      for(int i = start ; i>end ; --i)
#define all(v)                   ((v).begin(),(v).end())
#define sz(v)                  (int)((v).size())
#define clr(v,d)                memset(v , d , sizeof(v))
#define isOn(S, j) (S & (1 << j))
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define lowBit(S) (S & (-S))
#define setAll(S, n) (S = (1 << n) - 1)

#define modulo(S, N) ((S) & (N - 1))   // returns S % N, where N is a power of 2 *haven't understood this yet
#define isPowerOfTwo(S) (!(S & (S - 1)))            // done

#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))  // TBD
#define turnOffLastBit(S) ((S) & (S - 1))       // turn off last unset bit from right
#define turnOnLastZero(S) ((S) | (S + 1))       //turn on last unset bit from right
#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))
typedef long long               ll;
typedef vector<int>             vi;
typedef vector  <ll>            vll;
typedef vector<vector<int> >    adj;
typedef pair<int ,int>          pii;
const double EPS =1e-7;
const int OO = 1e6;
bool sortpair( const pair<int , int> & x, const pair<int , int> & y){
    return  x.first != y.first ? x.first < y.first : x.second > y.second ;
}
int dcomp(double x , double y){
    return fabs(x-y) <= EPS? 0: x>y?1:-1;
}
void smile(){
        ios_base::sync_with_stdio(0);
        cin.tie(NULL);
        cout.tie(NULL);
}

int main(){
	smile();
// 	freopen("in.txt", "r" , stdin);
    set<pair<double ,int> >mset;
    int n , t1 , t2  , a ,b ;
    double k ;
    cin >>n>>t1>>t2>>k;
    lp(i,0,n){
       cin>>a>>b;
        mset.insert({max((a- a*(k)/100 )*t1+ b*t2 , (b -b*(k)/100)*t1 + a*t2) , i+1});

    }
    cout<<fixed;
    for(auto it = mset.rbegin() ; it != mset.rend() ; ++it){
        cout<<it->second << " "<<it->first<<'\n';
    }
}


/*
   problem  - 186B
   13/01/19
   by ahmed_drawy
   sheet
   technique  : greedy - choose the bigger one in 2 cases and max on it
   self notes :
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;

//#define push_back               pb;
//#define make_pair               mp;
#define lp(i,start , end)       for(int i = start ; i<end ; ++i)
#define lllp(i,start , end)       for(ll i = start ; i<end ; ++i)
#define inN(arr ,  n) for(int i = 0 ; i< n ; ++i)  cin>>arr[i];
#define Rlp(i,start , end)      for(int i = start ; i>end ; --i)
#define all(v)                   ((v).begin(),(v).end())
#define sz(v)                  (int)((v).size())
#define clr(v,d)                memset(v , d , sizeof(v))
#define isOn(S, j) (S & (1 << j))
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define lowBit(S) (S & (-S))
#define setAll(S, n) (S = (1 << n) - 1)

#define modulo(S, N) ((S) & (N - 1))   // returns S % N, where N is a power of 2 *haven't understood this yet
#define isPowerOfTwo(S) (!(S & (S - 1)))            // done

#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))  // TBD
#define turnOffLastBit(S) ((S) & (S - 1))       // turn off last unset bit from right
#define turnOnLastZero(S) ((S) | (S + 1))       //turn on last unset bit from right
#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))
typedef long long               ll;
typedef vector<int>             vi;
typedef vector  <ll>            vll;
typedef vector<vector<int> >    adj;
typedef pair<int ,int>          pii;
const double EPS =1e-7;
const int OO = 1e6;
bool sortpair( const pair<int , int> & x, const pair<int , int> & y){
    return  x.first != y.first ? x.first < y.first : x.second > y.second ;
}
int dcomp(double x , double y){
    return fabs(x-y) <= EPS? 0: x>y?1:-1;
}
void smile(){
        ios_base::sync_with_stdio(0);
        cin.tie(NULL);
        cout.tie(NULL);
}
struct cmpPAIR{
    bool sortpair( const pair<int , int> & x, const pair<int , int> & y){
        return  x.first != y.first ? x.first > y.first : x.second < y.second ;
}
};

int main(){
	smile();
//  	freopen("in.txt", "r" , stdin);
	auto cmp = []( const pair<int , int> & x, const pair<int , int> & y){
        return  x.first != y.first ? x.first > y.first : x.second < y.second ;
    };///declaring function to sort the set with the criteria i want

    set<pair<double ,int> ,decltype(cmp) >mset(cmp);
    int n , t1 , t2  , a ,b ;
    double k ;
    cin >>n>>t1>>t2>>k;
    lp(i,0,n){
       cin>>a>>b;
        mset.insert({max((a- a*(k/100) )*t1+ b*t2 , (b -b*(k/100))*t1 + a*t2) , i+1});

    }
    cout<<fixed<<setprecision(2);
    for(auto it = mset.begin() ; it != mset.end() ; ++it){
        cout<<it->second << " "<<it->first<<'\n';
    }
}


/*
   problem  - 186B
   13/01/19
   by ahmed_drawy
   sheet
   technique  : greedy - choose the bigger one in 2 cases and max on it
   self notes :
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;

//#define push_back               pb;
//#define make_pair               mp;
#define lp(i,start , end)       for(int i = start ; i<end ; ++i)
#define lllp(i,start , end)       for(ll i = start ; i<end ; ++i)
#define inN(arr ,  n) for(int i = 0 ; i< n ; ++i)  cin>>arr[i];
#define Rlp(i,start , end)      for(int i = start ; i>end ; --i)
#define all(v)                   ((v).begin(),(v).end())
#define sz(v)                  (int)((v).size())
#define clr(v,d)                memset(v , d , sizeof(v))
#define isOn(S, j) (S & (1 << j))
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define lowBit(S) (S & (-S))
#define setAll(S, n) (S = (1 << n) - 1)

#define modulo(S, N) ((S) & (N - 1))   // returns S % N, where N is a power of 2 *haven't understood this yet
#define isPowerOfTwo(S) (!(S & (S - 1)))            // done

#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))  // TBD
#define turnOffLastBit(S) ((S) & (S - 1))       // turn off last unset bit from right
#define turnOnLastZero(S) ((S) | (S + 1))       //turn on last unset bit from right
#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))
typedef long long               ll;
typedef vector<int>             vi;
typedef vector  <ll>            vll;
typedef vector<vector<int> >    adj;
typedef pair<int ,int>          pii;
const double EPS =1e-7;
const int OO = 1e6;
bool sortpair( const pair<int , int> & x, const pair<int , int> & y){
    return  x.first != y.first ? x.first < y.first : x.second > y.second ;
}
int dcomp(double x , double y){
    return fabs(x-y) <= EPS? 0: x>y?1:-1;
}
void smile(){
        ios_base::sync_with_stdio(0);
        cin.tie(NULL);
        cout.tie(NULL);
}
struct cmpPAIR{
    bool sortpair( const pair<int , int> & x, const pair<int , int> & y){
        return  x.first != y.first ? x.first > y.first : x.second < y.second ;
}
};

int main(){
	smile();
//  	freopen("in.txt", "r" , stdin);
	auto cmp = []( const pair<double , int> & x, const pair<double , int> & y){
	    return fabs(x.first - y.first)<=1e-3?x.second <y.second : x.first>y.first;
//        return  x.first != y.first ? x.first > y.first : x.second < y.second ;
    };///declaring function to sort the set with the criteria i want

    set<pair<double ,int> ,decltype(cmp) >mset(cmp);
    int n , t1 , t2 , a ,b ;
    double k ;
    cin >>n>>t1>>t2>>k;
    lp(i,0,n){
       cin>>a>>b;
        mset.insert({max((a- a*(k/100) )*t1+ b*t2 , (b -b*(k/100))*t1 + a*t2) , i+1});

    }
    cout<<fixed<<setprecision(2);
    for(auto it = mset.begin() ; it != mset.end() ; ++it){

        cout<<it->second << " "<<it->first<<'\n';
    }
}


/*
   problem  - 186B
   13/01/19
   by ahmed_drawy
   sheet
   technique  : greedy - choose the bigger one in 2 cases and max on it
   self notes :
*/

#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;

//#define push_back               pb;
//#define make_pair               mp;
#define lp(i,start , end)       for(int i = start ; i<end ; ++i)
#define lllp(i,start , end)       for(ll i = start ; i<end ; ++i)
#define inN(arr ,  n) for(int i = 0 ; i< n ; ++i)  cin>>arr[i];
#define Rlp(i,start , end)      for(int i = start ; i>end ; --i)
#define all(v)                   ((v).begin(),(v).end())
#define sz(v)                  (int)((v).size())
#define clr(v,d)                memset(v , d , sizeof(v))
#define isOn(S, j) (S & (1 << j))
#define setBit(S, j) (S |= (1 << j))
#define clearBit(S, j) (S &= ~(1 << j))
#define toggleBit(S, j) (S ^= (1 << j))
#define lowBit(S) (S & (-S))
#define setAll(S, n) (S = (1 << n) - 1)

#define modulo(S, N) ((S) & (N - 1))   // returns S % N, where N is a power of 2 *haven't understood this yet
#define isPowerOfTwo(S) (!(S & (S - 1)))            // done

#define nearestPowerOfTwo(S) ((int)pow(2.0, (int)((log((double)S) / log(2.0)) + 0.5)))  // TBD
#define turnOffLastBit(S) ((S) & (S - 1))       // turn off last unset bit from right
#define turnOnLastZero(S) ((S) | (S + 1))       //turn on last unset bit from right
#define turnOffLastConsecutiveBits(S) ((S) & (S + 1))
#define turnOnLastConsecutiveZeroes(S) ((S) | (S - 1))
typedef long long               ll;
typedef vector<int>             vi;
typedef vector  <ll>            vll;
typedef vector<vector<int> >    adj;
typedef pair<int ,int>          pii;
const double EPS =1e-7;
const int OO = 1e6;
bool sortpair( const pair<int , int> & x, const pair<int , int> & y){
    return  x.first != y.first ? x.first < y.first : x.second > y.second ;
}
int dcomp(double x , double y){
    return fabs(x-y) <= EPS? 0: x>y?1:-1;
}
void smile(){
        ios_base::sync_with_stdio(0);
        cin.tie(NULL);
        cout.tie(NULL);
}
struct cmpPAIR{
    bool sortpair( const pair<int , int> & x, const pair<int , int> & y){
        return  x.first != y.first ? x.first > y.first : x.second < y.second ;
}
};

int main(){
	smile();
//  	freopen("in.txt", "r" , stdin);
	auto cmp = []( const pair<double , int> & x, const pair<int , int> & y){
        return  x.first != y.first ? x.first > y.first : x.second < y.second ;
    };///declaring function to sort the set with the criteria i want

    set<pair<double ,int> ,decltype(cmp) >mset(cmp);
    int n , t1 , t2 ;double a ,b ;
    double k ;
    cin >>n>>t1>>t2>>k;
    lp(i,0,n){
       cin>>a>>b;
        mset.insert({max((a- a*(k/100) )*t1+ b*t2 , (b -b*(k/100))*t1 + a*t2) , i+1});

    }
    cout<<fixed<<setprecision(2);
    for(auto it = mset.begin() ; it != mset.end() ; ++it){
        cout<<it->second << " "<<it->first<<'\n';
    }
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    double n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<int, int> > c;
    for(int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        c.push_back(make_pair(a, b));
    }
    t1 *= 1-(k/100);
    for(int i = 0; i < n; i++)
        if((t1>t2&&c[i].first<c[i].second)||(t1<t2&&c[i].first>c[i].second))
            swap(c[i].first, c[i].second);
    vector<pair<int, double> > r;
    for(int i = 1; i <= n; i++)
        r.push_back(make_pair(i, round((c[i-1].first*t1 + c[i-1].second*t2)*100)/100));
    sort(r.begin(), r.end(), [](const std::pair<int,double> &left, const std::pair<int,double> &right) {return left.second > right.second;});
    for(int i = 0; i < n; i++)
        cout << r[i].first << " " << r[i].second << endl;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    double n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<int, int> > c;
    for(int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        c.push_back(make_pair(a, b));
    }
    t1 *= 1-(k/100);
    for(int i = 0; i < n; i++)
        if((t1>t2&&c[i].first<c[i].second)||(t1<t2&&c[i].first>c[i].second))
            swap(c[i].first, c[i].second);
    vector<pair<int, double> > r;
    for(int i = 1; i <= n; i++)
        r.push_back(make_pair(i, c[i-1].first*t1 + c[i-1].second*t2));
    sort(r.begin(), r.end(), [](const std::pair<int,double> &left, const std::pair<int,double> &right) {return left.second > right.second;});
    for(int i = 0; i < n; i++)
        cout << r[i].first << " " << r[i].second << endl;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    double n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<int, int> > c;
    for(int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        c.push_back(make_pair(a, b));
    }
    t1 *= 1-(k/100);
    for(int i = 0; i < n; i++)
        if((t1>t2&&c[i].first<c[i].second)||(t1<t2&&c[i].first>c[i].second))
            swap(c[i].first, c[i].second);
    vector<pair<int, double> > r;
    for(int i = 1; i <= n; i++)
        r.push_back(make_pair(i, round((c[i-1].first*t1 + c[i-1].second*t2)*100)/100));
    sort(r.begin(), r.end(), [](const std::pair<int,double> &left, const std::pair<int,double> &right) {return left.second > right.second;});
    for(int i = 0; i < n; i++)
        cout << r[i].first << " " << std::fixed << std::setprecision(2) << r[i].second << endl;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    double n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<int, int> > c;
    for(int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        c.push_back(make_pair(a, b));
    }
    t1 *= 1-(k/100);
    for(int i = 0; i < n; i++)
        if((t1>t2&&c[i].first<c[i].second)||(t1<t2&&c[i].first>c[i].second))
            swap(c[i].first, c[i].second);
    vector<pair<int, double> > r;
    for(int i = 1; i <= n; i++)
        r.push_back(make_pair(i, round((c[i-1].first*t1 + c[i-1].second*t2)*100)/100));
    sort(r.begin(), r.end(), [](const std::pair<int,double> &left, const std::pair<int,double> &right) {return left.second > right.second;});
    for(int i = 0; i < n; i++)
        cout << r[i].first << " " << fixed << setprecision(2) << r[i].second << endl;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    float n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<int, int> > c;
    for(int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        c.push_back(make_pair(a, b));
    }
    t1 *= 1-(k/100);
    for(int i = 0; i < n; i++)
        if((t1>t2&&c[i].first<c[i].second)||(t1<t2&&c[i].first>c[i].second))
            swap(c[i].first, c[i].second);
    vector<pair<int, float> > r;
    for(int i = 1; i <= n; i++)
        r.push_back(make_pair(i, roundf((c[i-1].first*t1 + c[i-1].second*t2)*100)/100));
    sort(r.begin(), r.end(), [](const std::pair<int,float> &left, const std::pair<int,float> &right) {return left.second > right.second;});
    for(int i = 0; i < n; i++)
        cout << r[i].first << " " << std::fixed << std::setprecision(2) << r[i].second << endl;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    double n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<int, int> > c;
    for(int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        c.push_back(make_pair(a, b));
    }
    t1 *= 1-(k/100);
    for(int i = 0; i < n; i++)
        if((t1>t2&&c[i].first<c[i].second)||(t1<t2&&c[i].first>c[i].second))
            swap(c[i].first, c[i].second);
    vector<pair<int, double> > r;
    for(int i = 1; i <= n; i++)
        r.push_back(make_pair(i, c[i-1].first*t1 + c[i-1].second*t2));
    sort(r.begin(), r.end(), [](const std::pair<int,double> &left, const std::pair<int,double> &right) {return left.second > right.second;});
    for(int i = 0; i < n; i++)
        cout << r[i].first << " " << std::fixed << std::setprecision(2) << r[i].second << endl;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    double n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<int, int> > c;
    for(int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        c.push_back(make_pair(a, b));
    }

//    vector<pair<int,int> > V;
//    for (int i = 0; i < n; i++) {
//        int b = max( c[i].first * t1 * (100 - k) + c[i].second * t2 * 100, c[i].first * t2 * 100 + c[i].second * t1 * (100 - k));
//        V.push_back(make_pair(-b, i+1));
//    }
//    sort(V.begin(), V.end());
//    for (int i = 0; i < V.size(); i++) {
//        int k = -V[i].first;
//        printf("%d %d.%02d\n", V[i].second, k/100, k%100);
//    }
    t1 *= 1-(k/100);
    for(int i = 0; i < n; i++)
        if((t1>t2&&c[i].first<c[i].second)||(t1<t2&&c[i].first>c[i].second))
            swap(c[i].first, c[i].second);
    vector<pair<double, int> > r;
    for(int i = 1; i <= n; i++)
        r.push_back(make_pair(-round((c[i-1].first*t1 + c[i-1].second*t2)*100)/100, i));
//    sort(r.begin(), r.end(), [](const std::pair<int,double> &left, const std::pair<int,double> &right) {return left.second > right.second;});
    sort(r.begin(), r.end());
    for(int i = 0; i < n; i++)
        cout << r[i].second << " " << fixed << setprecision(2) << -r[i].first << endl;
}


#include <bits/stdc++.h>
using namespace std;

int main()
{
    double n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<int, int> > c;
    for(int i = 0; i < n; i++) {
        int a, b;
        cin >> a >> b;
        c.push_back(make_pair(a, b));
    }
    t1 *= 1-(k/100);
    for(int i = 0; i < n; i++)
        if((t1>t2&&c[i].first<c[i].second)||(t1<t2&&c[i].first>c[i].second))
            swap(c[i].first, c[i].second);
    vector<pair<int, double> > r;
    for(int i = 1; i <= n; i++)
        r.push_back(make_pair(i, roundf((c[i-1].first*t1 + c[i-1].second*t2)*100)/100));
    sort(r.begin(), r.end(), [](const std::pair<int,double> &left, const std::pair<int,double> &right) {return left.second > right.second;});
    for(int i = 0; i < n; i++)
        cout << r[i].first << " " << std::fixed << std::setprecision(2) << r[i].second << endl;
}


//RIYA DEB
#include"bits/stdc++.h"
using namespace std;

///:M' too lazy

#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define mp make_pair
#define sp setprecision
#define pd(x) printf("%d", x)
#define pdn(x) printf("%d\n", x)
#define plld(x) printf("%I64d", x)
#define plldn(x) printf("%I64d\n", x)
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y);
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z); ///spaces should not be there to avoid tle
#define slld(x) scanf("%I64d",&x)
#define mod 1000000007

bool sortbysec(const pair <int,int>&a,const pair <int,int>&b)
{
    if(a.second!=b.second)
        return (a.second>b.second);
    else
        return (a.first<b.first);
}
int main(){

#define int long long
fast_io
int n,t1,t2,k,a,b;
double l1,l2,maxl;
vector<pair<int,double> >p;
cin>>n>>t1>>t2>>k;
for(int i=1;i<=n;i++)
{
    cin>>a>>b;
    l1=(a*t1*(100-k))/100.00+(b*t2);
    l2=(b*t1*(100-k))/100.00+(a*t2);
    maxl=max(l1,l2);
    p.pb(mp(i,maxl));
}
sort(p.begin(),p.end(),sortbysec);
for(int i=0;i<n;i++)
{
    cout<<p[i].first<<" "<<p[i].second<<endl;
}
return 0;}


//RIYA DEB
#include"bits/stdc++.h"
using namespace std;

///:M' too lazy

#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define mp make_pair
#define sp setprecision
#define pd(x) printf("%d", x)
#define pdn(x) printf("%d\n", x)
#define plld(x) printf("%I64d", x)
#define plldn(x) printf("%I64d\n", x)
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y);
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z); ///spaces should not be there to avoid tle
#define slld(x) scanf("%I64d",&x)
#define mod 1000000007

bool sortbysec(const pair <int,int>&a,const pair <int,int>&b)
{
    if(a.second!=b.second)
        return (a.second>b.second);
    else
        return (a.first<b.first);
}
int main(){

#define int long long
//fast_io
int n;
double l1,l2,maxl,t1,t2,k,a,b;
vector<pair<int,double> >p;
cin>>n>>t1>>t2>>k;
for(int i=1;i<=n;i++)
{
    cin>>a>>b;
    l1=(double)(a*t1*(100-k))/100.00+(b*t2);
    l2=(double)(b*t1*(100-k))/100.00+(a*t2);
    maxl=max(l1,l2);
    p.pb(mp(i,maxl));
}
sort(p.begin(),p.end(),sortbysec);
for(int i=0;i<n;i++)
{
    printf("%d ",p[i].first);
    printf("%.2f\n",p[i].second);
    //cout<<endl;
}
return 0;}


//RIYA DEB
#include"bits/stdc++.h"
using namespace std;

///:M' too lazy

#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define mp make_pair
#define sp setprecision
#define pd(x) printf("%d", x)
#define pdn(x) printf("%d\n", x)
#define plld(x) printf("%I64d", x)
#define plldn(x) printf("%I64d\n", x)
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y);
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z); ///spaces should not be there to avoid tle
#define slld(x) scanf("%I64d",&x)
#define mod 1000000007

bool sortbysec(const pair <int,double>&a,const pair <int,double>&b)
{
    if(a.second!=b.second)
        return (a.second>b.second);
    else
        return (a.first<b.first);
}
int main(){

#define int long long
//fast_io
int n;
double l1,l2,maxl,t1,t2,k,a,b;
vector<pair<int,double> >p;
cin>>n>>t1>>t2>>k;
for(int i=1;i<=n;i++)
{
    cin>>a>>b;
    l1=(double)(a*t1*(100-k))/100.00+(b*t2);
    l2=(double)(b*t1*(100-k))/100.00+(a*t2);
    maxl=max(l1,l2);
    p.pb(mp(i,maxl));
}
sort(p.begin(),p.end(),sortbysec);
for(int i=0;i<n;i++)
{
    printf("%d ",p[i].first);
    printf("%.2f\n",p[i].second);
    //cout<<endl;
}
return 0;}


//RIYA DEB
#include"bits/stdc++.h"
using namespace std;

///:M' too lazy

#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define mp make_pair
#define sp setprecision
#define pd(x) printf("%d", x)
#define pdn(x) printf("%d\n", x)
#define plld(x) printf("%I64d", x)
#define plldn(x) printf("%I64d\n", x)
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y);
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z); ///spaces should not be there to avoid tle
#define slld(x) scanf("%I64d",&x)
#define mod 1000000007

bool sortbysec(const pair <int,int>&a,const pair <int,int>&b)
{
    if(a.second!=b.second)
        return (a.second>b.second);
    else
        return (a.first<b.first);
}
int main(){

#define int long long
fast_io
int n;
double l1,l2,maxl,t1,t2,k,a,b;
vector<pair<int,double> >p;
cin>>n>>t1>>t2>>k;
for(int i=1;i<=n;i++)
{
    cin>>a>>b;
    l1=(double)(a*t1*(100-k))/100.00+(b*t2);
    l2=(double)(b*t1*(100-k))/100.00+(a*t2);
    maxl=max(l1,l2);
    p.pb(mp(i,maxl));
}
sort(p.begin(),p.end(),sortbysec);
for(int i=0;i<n;i++)
{
    printf("%d ",p[i].first);
    printf("%.2f",p[i].second);
    cout<<endl;
}
return 0;}


//RIYA DEB
#include"bits/stdc++.h"
using namespace std;

///:M' too lazy

#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define pb push_back
#define mp make_pair
#define sp setprecision
#define pd(x) printf("%d", x)
#define pdn(x) printf("%d\n", x)
#define plld(x) printf("%I64d", x)
#define plldn(x) printf("%I64d\n", x)
#define sd(x) scanf("%d",&x)
#define sd2(x,y) scanf("%d%d",&x,&y);
#define sd3(x,y,z) scanf("%d%d%d",&x,&y,&z); ///spaces should not be there to avoid tle
#define slld(x) scanf("%I64d",&x)
#define mod 1000000007

bool sortbysec(const pair <int,int>&a,const pair <int,int>&b)
{
    if(a.second!=b.second)
        return (a.second>b.second);
    else
        return (a.first<b.first);
}
int main(){

#define int long long
fast_io
int n;
double l1,l2,maxl,t1,t2,k,a,b;
vector<pair<int,double> >p;
cin>>n>>t1>>t2>>k;
for(int i=1;i<=n;i++)
{
    cin>>a>>b;
    l1=(double)(a*t1*(100-k))/100.00+(b*t2);
    l2=(double)(b*t1*(100-k))/100.00+(a*t2);
    maxl=max(l1,l2);
    p.pb(mp(i,maxl));
}
sort(p.begin(),p.end(),sortbysec);
for(int i=0;i<n;i++)
{
    printf("%d ",p[i].first);
    printf("%.2f\n",p[i].second);
    //cout<<endl;
}
return 0;}


#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
struct Comp{
    bool operator()(const std::pair<float,int>&a, const std::pair<float,int>&b){
        if(a.first!=b.first){
            return a.first>b.first;
        }
        return a.second<b.second;
    }
};
int main()
{
    int n;
    float t1,t2,k;
    cin>>n>>t1>>t2>>k;
    vector<pair<float,int> >ans;
    ans.push_back(make_pair(0,0));
    for(int i=0;i<n;i++){
        float a,b;
        cin>>a>>b;
        float x=max( (1-k*0.01)*a*t1+b*t2,(1-k*0.01)*b*t1+a*t2);
        ans.push_back(make_pair(x,i+1));
    }
    Comp comp_functor;
    sort(ans.begin()+1,ans.end(),comp_functor);
    for(int i=1;i<=n;i++){
        printf("%d %0.2f\n",ans[i].second,ans[i].first);
    }
}


#include<iostream>
#include<utility>
#include<algorithm>
using namespace std;
int main()
{
    int n;
    float t1,t2,k;
    cin>>n>>t1>>t2>>k;
    pair<float,int>ans[n+1];
    ans[0].first=0;
    ans[0].second=0;
    for(int i=0;i<n;i++){
        float a,b;
        cin>>a>>b;
        float x=max( (1-k*0.01)*a*t1+b*t2,(1-k*0.01)*b*t1+a*t2 );
        ans[i+1].first=x;
        ans[i+1].second=i+1;
    }
    sort(ans,ans+n+1);
    for(int i=n;i>=1;i--){
        printf("%d %0.2f\n",ans[i].second,ans[i].first);
    }
}


#include<bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false);cin.tie(0)
#define pb push_back
#define digit(x) floor(log10(x))+1
#define mod 1000000007
typedef long long ll;
typedef long double ld;
typedef vector<vector<ll>> matrix;
typedef vector<ll> arr;
typedef vector<string> vs;
typedef vector<pair<ll,ll>> pv;
#define in1(x) scanf("%lld",&x)
#define in2(x,y) scanf("%lld %lld",&x,&y)
#define in3(x,y,z) scanf("%lld %lld %lld",&x,&y,&z)
#define all(x) x.begin(),x.end()
#define debug(x) cerr << #x << " is " << x << endl;
bool fun(pair<double,ll>x,pair<double,ll>y){
    if(x.first>y.first){
        return true;
    }else if(x.first<y.first){
        return false;
    }else{
        return x.second<y.second;
    }
}
int main(){
    fast;
    ll n,t1,t2,k;
    ll a,b;
    cin>>n>>t1>>t2>>k;
    pv z;
    k=100-k;
    for(int i=0;i<n;i++){
        cin>>a>>b;
        z.pb(make_pair(min(a,b),max(a,b)));
    }
    vector<pair<double,ll>>d;
   // map<ll,double>e;
    for(int i=0;i<n;i++){
        ll x=z[i].first,y=z[i].second;
        double f=(float(x)*float(t1)*(float(k)/100))+float(y)*float(t2);
        double s=(float(y)*float(t1)*(float(k)/100))+float(x)*float(t2);
        d.pb(make_pair(max(f,s),i+1));
    }
    sort(all(d),fun);
    for(int i=0;i<n;i++){
        cout<<fixed<<setprecision(2)<<d[i].second<<" "<<d[i].first<<endl;
    }
    return 0;
}


#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
struct Comp{
    bool operator()(const std::pair<float,int>&a, const std::pair<float,int>&b){
        if(a.first!=b.first){
            return a.first>b.first;
        }
        return a.second<b.second;
    }
};
int main()
{
    int n,t1,t2,k;
    cin>>n>>t1>>t2>>k;
    vector<pair<float,int> >ans;
    ans.push_back(make_pair(0,0));
    for(int i=0;i<n;i++){
        int a,b;
        cin>>a>>b;
        double x=max( (1-float(k)*0.01)*float(a)*float(t1)+float(b)*float(t2),(1-float(k)*0.01)*float(b)*float(t1)+float(a)*float(t2) );
        ans.push_back(make_pair(x,i+1));
    }
    Comp comp_functor;
    sort(ans.begin()+1,ans.end(),comp_functor);
    for(int i=1;i<=n;i++){
        printf("%d %0.2f\n",ans[i].second,ans[i].first);
    }
}


#include<bits/stdc++.h>
using namespace std;
bool helper(pair<double, double> a, pair<double, double> b){
    if(a.first == a.second){
        return a.second < b.second;
    }
    return a.first > b.first;
}
int main(){
    double n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<double, double> > speed(n);
    for(int i = 0; i < n; i++){
        cin >> speed[i].first >> speed[i].second;
    }
    vector<pair<double, int> > answer;
    for(int i =0; i < n; i++){
        // find the max posible height for each participant
        float height1 = t1*speed[i].first*(1 - (k/100)) + t2*speed[i].second;
        float height2 = t1*speed[i].second*(1 - (k/100)) + t2*speed[i].first;
        answer.push_back(make_pair(max(height1, height2), i+1));
    }
    sort(answer.begin(), answer.end(), helper);
    for(int i =0; i < answer.size(); i++){
        cout<<answer[i].second<<fixed<<setprecision(2)<<answer[i].first<<"\n";
    }
}


#include<bits/stdc++.h>
using namespace std;
bool helper(pair<float, float> a, pair<float, float> b){
    if(a.first == a.second){
        return a.second < b.second;
    }
    return a.first > b.first;
}
int main(){
    float n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<float, float> > speed(n);
    for(int i = 0; i < n; i++){
        cin >> speed[i].first >> speed[i].second;
    }
    vector<pair<float, int> > answer;
    for(int i =0; i < n; i++){
        // find the max posible height for each participant
        float height1 = t1*speed[i].first*(1 - (k/100)) + t2*speed[i].second;
        float height2 = t1*speed[i].second*(1 - (k/100)) + t2*speed[i].first;
        answer.push_back(make_pair(max(height1, height2), i+1));
    }
    sort(answer.begin(), answer.end(), helper);
    for(int i =0; i < answer.size(); i++){
        printf("%d %.2f\n", answer[i].second, answer[i].first);
    }
}


#include<bits/stdc++.h>
using namespace std;
int main(){
    long long int n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<long long, long long> > speed(n);
    for(int i = 0; i < n; i++){
        cin >> speed[i].first >> speed[i].second;
    }
    vector<pair<double, int> > answer;
    for(int i =0; i < n; i++){
        // find the max posible height for each participant
        double height1 = t1*speed[i].first + t2*speed[i].second - (double(t1*speed[i].first*k)/100);
        double height2 = t1*speed[i].second + t2*speed[i].first - (double(t1*speed[i].second*k)/100);
        answer.push_back(make_pair(-1*max(height1, height2), i+1));
    }
    sort(answer.begin(), answer.end());
    for(int i =0; i < answer.size(); i++){
        cout<<answer[i].second<<" "<<fixed<<setprecision(2)<<-1*answer[i].first<<"\n";
    }
}


#include<bits/stdc++.h>
using namespace std;
bool helper(pair<double, double> a, pair<double, double> b){
    if(a.first == a.second){
        return a.second < b.second;
    }
    return a.first > b.first;
}
int main(){
    double n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<double, double> > speed(n);
    for(int i = 0; i < n; i++){
        cin >> speed[i].first >> speed[i].second;
    }
    vector<pair<double, int> > answer;
    for(int i =0; i < n; i++){
        // find the max posible height for each participant
        float height1 = t1*speed[i].first*(1 - (k/100)) + t2*speed[i].second;
        float height2 = t1*speed[i].second*(1 - (k/100)) + t2*speed[i].first;
        answer.push_back(make_pair(max(height1, height2), i+1));
    }
    sort(answer.begin(), answer.end(), helper);
    for(int i =0; i < answer.size(); i++){
        cout<<answer[i].second<<" "<<fixed<<setprecision(2)<<answer[i].first<<"\n";
    }
}


#include<bits/stdc++.h>
using namespace std;
bool helper(pair<double, int> a, pair<double, int> b){
    if(a.first == a.second){
        return a.second < b.second;
    }
    return a.first > b.first;
}
int main(){
    long long int n, t1, t2, k;
    cin >> n >> t1 >> t2 >> k;
    vector<pair<long long, long long> > speed(n);
    for(int i = 0; i < n; i++){
        cin >> speed[i].first >> speed[i].second;
    }
    vector<pair<double, int> > answer;
    for(int i =0; i < n; i++){
        // find the max posible height for each participant
        double height1 = t1*speed[i].first + t2*speed[i].second - (double(t1*speed[i].first*k)/100);
        double height2 = t1*speed[i].second + t2*speed[i].first - (double(t1*speed[i].second*k)/100);
        answer.push_back(make_pair(-1*max(height1, height2), i+1));
    }
    sort(answer.begin(), answer.end(), helper);
    for(int i =0; i < answer.size(); i++){
        cout<<answer[i].second<<" "<<fixed<<setprecision(2)<<-1*answer[i].first<<"\n";
    }
}