#pragma comment(linker, "/STACK:60000000")
#define _CRT_SECURE_NO_WARNINGS

#include <cstdio>
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
#include <set>
#include <map>
#include <ctime>
#include <cstring>
#include <cassert>
#include <sstream>
#include <iomanip>
#include <complex>
#include <queue>
#include <functional>

using namespace std;

#define forn(i, n) for(int i = 0; i < (int)(n); i++)
#define ford(i, n) for(int i = (int)(n) - 1; i >= 0; i--)
#define pb push_back
#define mp make_pair
#define fs first
#define sc second
#define last(a) int(a.size() - 1)
#define all(a) a.begin(), a.end()
#define seta(a,x) memset (a, x, sizeof (a))
#define I (int)
#define next NEXTHUI
#define prev PREVHUI
#define y1 Y1HUI

typedef long long int64;
typedef pair <int, int> pii;
typedef long double ldb;

const long double eps = 1e-5;
const int inf = (1 << 30) - 1;
const int64 inf64 = ((int64)1 << 62) - 1;
const long double pi = 3.1415926535897932384626433832795;

template <class T> T sqr (T x) {return x * x;}

int n, k;
int64 h;
int64 m[100000];
int64 v[100000];
vector <pair < pair <int64, int64>, int> > nums;

bool check (double tm, int tp) {
	int cur = 0;
	vector <int> ans;
	forn (i, k) {
		double cur_h = (double)h * (i+1);
		while (cur < n && tm * v[nums[cur].sc] < cur_h)
			cur ++;
		if (cur == n)
			return 0;
		ans.pb (nums[cur].sc);
		cur ++;
	}
	if (tp == 1) {
		forn (i, ans.size())
			printf ("%d ", ans[i]+1);
		printf ("\n");
	}
	return 1;
}

int main ()
{
//	freopen ("input.txt", "r", stdin);
//	freopen ("output.txt", "w", stdout);
	cin >> n >> k >> h;
	forn (i, n)
		scanf ("%I64d", &m[i]);
	forn (i, n)
		scanf ("%I64d", &v[i]);
	nums.resize (n);
	forn (i, n)
		nums[i] = mp ( mp (m[i], v[i]), i);
	sort (all (nums));
	double l = 0;
	double r = 1e10;
	forn (i, 100) {
		double m = (l + r) / 2.;
		if (check (m, 0))
			r = m;
		else
			l = m;
	}
	while (!check (r, 0))
		r += eps;
	check (r, 1);
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

constexpr int N = 1e5 + 10;

long long n, k, h;
pair <double, pair<double, double>> a[N];

bool cmp (const pair <double, pair<double, double>> &lhs, const pair <double, pair<double, double>> &rhs) {
    if (rhs.first == lhs.first)
        return rhs.second.first < lhs.second.first;
    return rhs.first < lhs.first;
}

bool check(double mytime) {
    double cnt = 0, ertefa = k * h;
    for (int i = 0; i < n; i++) {
        if (cnt == k)
            break;
        if ((ertefa / a[i].second.first) <= mytime) {
            cnt++;
            ertefa -= h;
        }
    }
    if (cnt == k)
        return true;
    return false;
}

void bin2 (double b, double e) {
    for (int i = 0; i < 60; i++) {
        double mid = (b + e) / 2;
        if (check(mid))
            e = mid;
        else
            b = mid;
    }
    double cnt = 0, ertefa = k * h;
    vector <int> ans;
    for (int i = 0; i < n; i++) {
        if (cnt == k)
            break;
        if ((ertefa / a[i].second.first) <= e) {
            cnt++;
            ans.push_back(a[i].second.second);
            ertefa -= h;
        }
    }
    for (int i = ans.size() - 1; i >= 0; i--)
        cout << ans[i] << ' ';
    cout << '\n';
    return;
}

void bin(long long b, long long e) {
    if (b + 1 == e) {
        if (check(b))
            bin2 (max(b - 1, 0ll), b);
        else
            bin2 (b, e);
        return;
    }
    int mid = (b + e) / 2;
    if (check(mid - 1)) {
        bin (b, mid);
        return;
    }
    bin(mid, e);
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    cin >> n >> k >> h;
    for (int i = 0; i < n; i++)
        cin >> a[i].first;
    for (int i = 0; i < n; i++) {
        cin >> a[i].second.first;
        a[i].second.second = i + 1;
    }
    sort (a, a + n, cmp);
    bin (0, 1000000001);
    return 0;
}

#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
using namespace std;
const int INF           = 1000000009;
const double PI         = acos(-1.0);
const double eps        = 1e-10;
const int MAXN          = 100001;
const int MAXM          =0;
int n, k, h;
struct frog
{
    int v, m, ind;
};
frog a[MAXN];
int i,j;
bool ans[MAXN];
bool cmp(const frog &A, const frog &B)
{
    if (A.m < B.m)
        return true;
    if (A.m > B.m)
        return false;
    if (A.v < B.v)
        return true;
    if (A.v > B.v)
        return false;
    return A.ind < B.ind;

}

double l , m, r;
bool iCan(double t)
{
    int c = 0, i;
    for (i = 0; i < n; i++)
    {
        if ( double (1 + c) * h / (double)a[i].v  - t < eps)
        {
            c++;
            ans[i] = true;
        }else
            ans[i] = false;
        if (c ==k)
            break;
    }
    if (c == k)
        return true;
    else
        return false;
}

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    cin >> n>> k >> h;
    for (i = 0; i <n; i++)
    {
        scanf("%d", &a[i].m);
        a[i].ind = i + 1;
    }
    for (i = 0; i <n; i++)
        scanf("%d", &a[i].v);

    sort(a, a+n, cmp);
    r = 10000000000LL;
    l = 0;
    for (int i = 0; i < 200; i++)
    {
        m = (r + l) / 2;
        if (iCan(m))
            r = m;
        else
            l = m;
    }
    iCan(r);
    //cout << l << endl;
    int c= 0;
    for (i = 0; i < n; i++)
    {
        if (ans[i])
        {
            printf("%d ", a[i].ind);
            c++;
        }
        if (c == k)
            break;
    }

    return 0;
}

#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>

using namespace std;

const double eps = 1e-12;
const int maxn = 100100;

int dblcmp( double x )
{
    if( fabs(x) < eps )
        return 0;
    return x > 0 ? 1 : -1;
}

struct tt
{
    int m, v, id;
} p[maxn];

int cmp( tt a, tt b )
{
    if( a.m == b.m )
        return a.v > b.v;
    return a.m > b.m;
}

vector<int> ans;

int main()
{
    int i, j, t, minv, now;
    int n, k, h;
    double ll, rr, mid;

    while( scanf("%d %d %d", &n, &k, &h) != EOF )
    {
        minv = 1000000000;
        for( i = 0; i < n; ++i )
            scanf("%d", &p[i].m);
        for( i = 0; i < n; ++i )
        {
            scanf("%d", &p[i].v);
            p[i].id = i+1;
            minv = min(minv, p[i].v);
        }

        sort(p, p+n, cmp);
        ll = eps, rr = (double)k*h/minv;
        for( j = 0; j < 100; ++j )
        {
            mid = (ll+rr)/2.;

            now = k;
            for( i = 0; now && i < n; ++i )
            {
                if( dblcmp(p[i].v*mid - now*h) >= 0 )
                    now--;
            }

            if( !now )
                rr = mid;
            else
                ll = mid;
        }

        ans.clear();
        now = k;
        for( i = 0; now && i < n; ++i )
        {
            if( dblcmp(p[i].v*rr - now*h) >= 0 )
            {
                ans.push_back(p[i].id);
                now--;
            }
        }

        for( i = ans.size()-1; i >= 0; --i )
        {
            if( i != ans.size()-1 ) printf(" ");
            printf("%d", ans[i]);
        }
        printf("\n");
    }

    return 0;
}

#include <iostream>
#include <algorithm>
using namespace std;
const int MAXN=1000*101;
pair<int,pair<int,int> >a[MAXN]={};
int ans[MAXN]={},n,k,h;
int check(long double x)
{
    int p=0;
    for(int i=0;i<n&&p<k;i++)
    {
        if((p+1)*h<=x*a[i].second.first)
        {
            ans[p++]=a[i].second.second;
        }
    }
    if(p==k)
        return 1;
    return 0;
}
int main()
{
    cin>>n>>k>>h;
    for(int i=0;i<n;i++)
        cin>>a[i].first;
    for(int i=0;i<n;i++)
    {
        cin>>a[i].second.first;
        a[i].second.second=i+1;
    }
    sort(a,a+n);
    long double l=0,r=1e+9,mid;
    for(int i=0;i<210;i++)
    {
        mid=(r+l)/2;
        if(!check(mid))
            l=mid;
        else
            r=mid;
    }
    check(r);
    for(int i=0;i<k;i++)
    {
        cout<<ans[i]<<' ';
    }
}

#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;
#define N 100005
int ans[N], b[N];
struct point{
    double w;
    double v;
    int num;
}p[N];
int n,k, h;
int cmp(point x, point y){
    if(x.w != y.w) return x.w < y.w;
    return x.v < y.v;
}

int ok(double mid){
    int u=1;
    for(int i=1; i<=n; i++){
        if(p[i].v * mid >= h*u*1.0) ans[u++] = p[i].num;
    }
    if(u > k) return 1;
    else return 0;
}
int main(){
    while(scanf("%d%d%d", &n, &k, &h) != EOF){
        for(int i=1; i<=n; i++){
            scanf("%lf", &p[i].w);
            p[i].num = i;
        }
        double minx = 0x7fffffff;
        for(int i=1; i<=n; i++){
            scanf("%lf", &p[i].v);
            if(p[i].v < minx) minx = p[i].v;
        }
        double maxn=h*k/minx;
        sort(p+1, p+n+1, cmp);
        double l=0, r=maxn, mid;
        for(int j=1; j<=100; j++){
            mid = (l + r)/2;
//            printf("%lf %lf %lf\n", l, r, mid);
            if(ok(mid)){
                r=mid;
                for(int i=1; i<=k; i++){
                    b[i] = ans[i];
                }
            }
            else l=mid;
        }
        for(int i=1; i<k; i++){
            printf("%d ", b[i]);
        }
        printf("%d\n", b[k]);
    }
    return 0;
}

#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

const double eps = 1e-9;

int m[100005], v[100005], srt[100005];
int ans[100005], ansCur[100005];
int n, k, h;

bool cmp (int d1, int d2) {
	if (m[d1] == m[d2])
		return v[d1] < v[d2];
	return m[d1] < m[d2];
}

bool isGood (double curTime) {
	int i, curI;

	int ptr = 0;

	for (i = 0;i < n && ptr < k;i++) {
		curI = srt[i];
		if (h * 1. * (ptr + 1) <= curTime * v[curI]) {
			ansCur[ptr] = curI;
			ptr++;
		}
	}

	return ptr == k;
}

int main () {
	//freopen("input.txt", "rt", stdin);
	//freopen("output.txt", "wt", stdout);
	int i;

	scanf("%d%d%d", &n, &k, &h);
	for (i = 0;i < n;i++) {
		scanf("%d", &m[i]);
	}
	for (i = 0;i < n;i++) {
		scanf("%d", &v[i]);
	}

	for (i = 0;i < n;i++)
		srt[i] = i;
	sort(srt, srt + n, cmp);

	double l = 0, r = 1e9, mid;
	double res = 0;

	int it = 0;
	while (it < 100) {
		mid = (l + r) / 2;
		if (isGood(mid)) {
			for (i = 0;i < k;i++)
				ans[i] = ansCur[i];
			r = mid;
		}else
		{
			l = mid;
		}
		it++;
	}

	for (i = 0;i < k;i++) {
		if (i)
			printf(" ");
		printf("%d", ans[i] + 1);
	}
	return 0;
}

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

const int maxn = 1e5 + 10, inf = 2e9 + 1;
const double eps = 1e-10;
int v[maxn], m[maxn], n, k, h, ans[maxn];
vector<int> ord;

bool check(double t) {
    size_t ptr = 0;
    vector<int> tans(maxn);
    for (int i = 1; i <= k; ++i) {
        double req = i * h * 1.0;
        while (ptr < n && v[ord[ptr]] * t < req) ++ptr;
        if (ptr >= n) return false;
        tans[i] = ord[ptr];
        ++ptr;
    }
    for (int i = 1; i <= k; ++i) ans[i] = tans[i];
    return true;
}

double bs(double l, double r, int dep) {
    if (dep > 120) return l;
    double m = (l + r) / 2.0;
    if (check(m)) return bs(l, m, dep + 1);
    return bs(m, r, dep + 1);
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    cin >> n >> k >> h;
    for (int i = 0; i < n; ++i) cin >> m[i];
    for (int i = 0; i < n; ++i) cin >> v[i];
    for (int i = 0; i < n; ++i) ord.push_back(i);
    sort(ord.begin(), ord.end(), [&](const int &a, const int &b) { return m[a] == m[b] ? v[a] < v[b] : m[a] < m[b]; });
    bs(0, inf, 0);
    for (int i = 1; i <= k; ++i) cout << ans[i] + 1 << ' '; cout << endl;
    return 0;
}

/*AMETHYSTS*/
#pragma comment(linker, "/STACK:1000000000")
#include <cstdio>
#include <iostream>
#include <ctime>
#include <string>
#include <vector>
#include <cmath>
#include <algorithm>
#include <cstring>
#include <set>
#include <map>
#include <cstdlib>
#include <ctime>
#include <cassert>
#include <bitset>
#include <deque>
#include <stack>
#include <climits>
#include <string>
#include <queue>
#include <memory.h>

#define ll long long
#define ld long double
#define pii pair <int, int>
#define forn(i, n) for (int i = 0; i < (int)n; i++)
#define mp make_pair
#define ui unsigned ll
#define pll pair <ll, ll>

using namespace std;

const int maxn = (int)1e5 + 10;

int m[maxn];
int v[maxn];
int id[maxn];

bool cmp(int a, int b) {
	if (m[a] == m[b]) {
		return v[a] < v[b];
	}

	return m[a] < m[b];
}

int main() {
	int n, k, h;

	cin >> n >> k >> h;

	for (int i = 0; i < n; i++) {
		scanf("%d", &m[i]);
		id[i] = i;
	}

	for (int i = 0; i < n; i++) {
		scanf("%d", &v[i]);
	}

	sort(id, id + n, cmp);

	ld l = 0;
	ld r = 1e9;

	for (int itt = 0; itt < 1000; itt++) {
		ld m = (l + r) / 2;

		int pos = 1;

		for (int it = 0; it < n; it++) {
			int i = id[it];

			if (pos == k + 1) {
				break;
			}

			if (v[i] * m >= pos * h) {
				pos++;
			}
		}

		if (pos == k + 1) {
			r = m;
		}
		else {
			l = m;
		}
	}

	vector <int> ans;

	int pos = 1;

	for (int it = 0; it < n; it++) {
		int i = id[it];

		if (pos == k + 1) {
			break;
		}

		if (v[i] * r >= pos * h) {
			ans.push_back(i);
			pos++;
		}
	}

	for (int i = 0; i < (int)ans.size(); i++) {
		printf("%d ", ans[i] + 1);
	}

	return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define N (101*1000)
#define ld long double

ll n,k,h;
pair <ll,pair<ll,ll> > a[N];
ll ans[N],ans2[N];

bool check(ld t)
{
     ll p=0;
     for(int i=0;i<n && p!=k;i++)
     {
             //cout<<(p+1)*h<<" "<<a[i].second.second*t<<"\n";
             if((p+1)*h<=a[i].second.first*t)
                 ans[p++]=a[i].second.second;
     }
     //cout<<p<<endl;
     if(p==k)
     {
             for(int i=0;i<k;i++)ans2[i]=ans[i];
             return 1;
     }
     return 0;
}

int main()
{
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>n>>k>>h;
    for(int i=0;i<n;i++)cin>>a[i].first;
    for(int i=0;i<n;i++)cin>>a[i].second.first,a[i].second.second=i+1;
    sort(a,a+n);

    ld l=0,r=(ld)1e12;
    for(int i=0;i<200;i++)
    {
            ld mid=(l+r)/2;
            if(check(mid))r=mid;
            else l=mid;
    }
    //cout<<r<<endl;
    for(int i=0;i<k;i++)cout<<ans2[i]<<" ";
    cout<<endl;
    return 0;
}

//program 169D

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>

using namespace std;

struct Data
{
  int Weight,Speed,Number;
};

bool operator <(Data A,Data B)
{
  return (A.Weight==B.Weight)?(A.Speed<B.Speed):(A.Weight<B.Weight);
}

int N,M,H;
int List[100000];
Data A[100000];

bool Check(double T)
{
  int P=1;
  for(int i=0;i<N;i++)
    {
      if(T*A[i].Speed>=P*H){List[P-1]=A[i].Number;P++;}
      if(P>M)return true;
    }
  return false;
}

int main()
{
  scanf("%d%d%d",&N,&M,&H);
  for(int i=0;i<N;i++)scanf("%d",&A[i].Weight);
  for(int i=0;i<N;i++)scanf("%d",&A[i].Speed);
  for(int i=0;i<N;i++)A[i].Number=i+1;
  sort(A,A+N);
  double Left=0,Right=1000000000;
  for(int i=0;i<150;i++)
    {
      double Mid=(Left+Right)/2;
      if(Check(Mid))Right=Mid;else Left=Mid;
    }
  Check(Right);
  for(int i=0;i<M;i++)
    {
      printf("%d",List[i]);
      putchar((i==M-1)?'\n':' ');
    }
  return 0;
}

#include <set>
#include <map>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <string>
#include <cstdio>
#include <math.h>
#include <time.h>
#include <iomanip>
#include <stdlib.h>
#include <limits.h>
#include <string.h>
#include <iostream>
#include <fstream>
#include <algorithm>
using namespace std;

#define LL long long
#define MIN INT_MIN
#define MAX INT_MAX
#define pii pair<int ,int>
#define bug cout<<"here!!"<<endl
#define FRE freopen("input.txt","r",stdin)
#define FF freopen("output.txt","w",stdout)
#define eps 1e-9
#define pi acos(-1.0)
#define N 100005
#define mod 1000000007

struct node{
    int v,m;
    int id;
}p[N];
bool cmp(node a,node b){
    if(a.m!=b.m)return a.m<b.m;
    return a.v<b.v;
}
int ans[N];
int tmp[N];
int main(){
    int n,k,h;
    cin>>n>>k>>h;
    int i,j;
    for(i=0;i<n;i++){
        cin>>p[i].m;
        p[i].id = i+1;
    }
    for(i=0;i<n;i++)cin>>p[i].v;
    sort(p,p+n,cmp);
    double l=0,r = 1e9,mid;
    for(int cnt=0;cnt<100;cnt++){
        mid = (l+r)*0.5;
        bool ok = 1;
        j = 0;
        for(i=0;i<k && ok;i++){
            while(j<n && ((i+1)*h*1.0)/(p[j].v*1.0) > mid)j++;
            if(j == n){
                ok = 0;
                break;
            } else tmp[i] = j++;
        }
        if(ok){
            r = mid;
            for(i=0;i<k;i++)ans[i] = tmp[i];
        } else l = mid;
    }
    for(i=0;i<k;i++){
        cout<<p[ans[i]].id<<" ";
    }
    cout<<endl;
    return 0;
}

//lxrtxdy!
#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <iomanip>
using namespace std;

typedef pair <int, int>  pii;

const int MAXN = 1e5 + 5, inf = 1e18 + 7;
long long n, k;
long long h;
long long Arr[MAXN];
long double eps = 1e-5;
pair <pair <long long, long long>, long long> v[MAXN];
vector <long long> ans;

bool can(long double t) {
    for (int i = 0; i < n; i++)
        Arr[i] = (t * v[i].first.second) / h;
    int f = k;
    for (int i = n - 1; i > -1; i--) {
        if (Arr[i] >= f)
            f--;
        if (!f)
            break;
    }
    return !f;
}

int main() {
    cin >> n >> k >> h;
    for (int i = 0; i < n; i++)
        cin >> v[i].first.first;
    for (int i = 0; i < n; i++) {
        cin >> v[i].first.second;
        v[i].second = i + 1;
    }
    sort(v, v + n);
    long double s = 0, e = 1e9+ 7;
    for (int i = 0; i < 100; i++) {
        long double m = (e + s) / 2;
        if (can(m))
            e = m;
        else
            s = m;
    }
    for (int i = 0; i < n; i++)
        Arr[i] = (e * v[i].first.second) / h;
    int f = k;
    for (int i = n - 1; i > -1; i--) {
        if (Arr[i] >= f) {
            ans.push_back(v[i].second);
            f--;
        }
        if (!f)
            break;
    }
    for (int i =  k - 1; i > -1; i--)
        cout << ans[i] << " ";
    return 0;
}
//hellobig_tq//hellobig_tq
//orzlxr!//hello

//      In the Name of God

#include <iostream>
#include <cmath>
#include <cstring>
#include <vector>
#include <algorithm>
#include <fstream>
#include <map>
#include <vector>
#include <set>
#include <sstream>
#include <stack>
#include <list>
#include <queue>

using namespace std;

#define ll long long
#define pb push_back
const int MAXN = 1e5 + 5;

int n;
int h , k;
pair<int , pair<int ,int > > V[MAXN];

inline bool check(long double t)
{
    int pos = 0;
    for(int cnt = 1;cnt <= k;cnt ++)
    {
        while(pos < n && (V[pos].second.first * t) < h * cnt)
            pos ++;
        if(pos == n)
            return false;
        pos ++;
    }
    return true;
}

inline void print(long double t)
{
    int pos = 0;
    for(int cnt = 1;cnt <= k;cnt ++)
    {
        while(pos < n && (V[pos].second.first * t) < h * cnt)
            pos ++;
        cout << V[pos].second.second + 1 << " " ;
        pos ++;
    }
}
int main(){
    ios::sync_with_stdio(false);
	cin >> n >> k >> h;

	for(int i = 0;i < n;i ++)
        cin >> V[i].first;
    for(int i = 0;i < n;i ++)
        cin >> V[i].second.first , V[i].second.second = i;

    sort(V , V + n);

    long double b = 0 , e = 1e9 + 1;
    for(int i = 0;i < 100;i ++)
    {
         long double mid = (b + e) / 2.0;
        if(check(mid))
            e = mid;
        else
            b = mid;
    }
    print(e);
    cout << endl;
	return 0;
}

//
//  main.cpp
//  B
//
//  Created by Ali Keramatipour on 8/14/15.
//  Copyright (c) 2015 Ali Keramatipour. All rights reserved.
//

#include <iostream>
#include <algorithm>
#include <vector>
#include <cstdio>
#include <cmath>

using namespace std ;

#define ff first
#define ss second

typedef pair<int,int> pii;
typedef long long ll;
typedef long double ld;

const int N = 1e5 + 10 ;
const long double eps = 1e-14;

int n , k , h ;
ld upd = 1e9 ;
pair<pii,int> lemi[N];
int mark[N] , mrk[N];
vector<pii> v ;

bool check(ld Time)
{
    int cnt = 1 ;

    for (int i = 0 ; i < n ; i++)
    {
        ld t = ((ld)(cnt*h)/(ld)lemi[i].ff.ss) ;
        if ( t <= Time || fabs(Time - t ) < eps ){
            cnt++ , mark[i] = 1 ;
        }
        if ( cnt > k )
            break ;
    }
   // cout << "cnt " << cnt << " " << k << endl ;
    if ( cnt > k ){
        if ( Time < upd || fabs(upd-Time) < eps ){
            upd = Time ;
            for (int i = 0 ; i < n ; i++)
                mrk[i] = mark[i] , mark[i] = 0 ;
        }
        return 1 ;
    }

    return 0 ;
}

int main(int argc, const char * argv[]) {

    scanf("%d %d %d" , &n , &k , &h) ;
    for (int i = 0 ; i < n ; i++) lemi[i].ss = i+1 ;
    for (int i = 0 ; i < n ; i++) scanf("%d" , &lemi[i].ff.ff ) ;
    for (int i = 0 ; i < n ; i++) scanf("%d" , &lemi[i].ff.ss) ;

    sort(lemi , lemi+n) ;

    ld l = 0 , r = 1e9 + 1 ;

    for ( int step = 0 ; step < 100 ; step++ ){
        ld mid = (l+r) / 2 ;
        bool flg = check(mid) ;
        if ( flg )
            r = mid ;
        else
            l = mid ;
    }

    for (int i = 0 ; i < n ; i++ )
        if ( mrk[i] ){
            v.push_back({lemi[i].ff.ff , lemi[i].ss}) ;
        }
    if ( v.size() == 0 )
        cout << "err" << endl ;
    for (int i = 0 ; i < v.size() ; i++)
        printf("%d " , v[i].ss) ;

    return 0;
}

#include <bits/stdc++.h>
#define ll long long
#define EPS 1e-8
using namespace std;

const int MAX = 2e5 + 111;

int n, k, h;

int m[MAX], v[MAX], id[MAX];

vector<int> ans;

bool gg(double mm) {
    int cur = k;
    for (int i = n - 1; i >= 0; --i) {
        if (cur == 0)
            break;
        if (cur * h < mm * v[id[i]] + EPS) {
            --cur;
        }
    }
    return (cur == 0);
}

void out(double t) {
    int cur = k;
    for (int i = n - 1; i >= 0; --i) {
        if (cur == 0)
            break;
        if (cur * h < t * v[id[i]] + EPS) {
            ans.push_back(id[i] + 1);
            --cur;
        }
    }
    cerr << ans.size() << "\n";
    reverse(ans.begin(), ans.end());
    for (int i = 0; i < k; ++i) {
        cout << ans[i] << " ";
    }
}

double bin(double l, double r) {
    for (int i = 0; i < 100; ++i) {
        double mid = (l + r) / 2;
        if (gg(mid))
            r = mid;
        else
            l = mid;
    }
    return r;
}

bool cmp(int i, int j) {
    if (m[i] != m[j])
        return m[i] < m[j];
    return v[i] < v[j];
}

bool cmp2(int i, int j) {
    return v[i] < v[j];
}

int main() {
#ifdef LOCAL
    freopen("xxx.in", "r", stdin);
    freopen("xxx.out", "w", stdout);
#endif
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> k >> h;
    for (int i = 0; i < n; ++i) {
        cin >> m[i];
    }
    for (int i = 0; i < n; ++i) {
        cin >> v[i];
        id[i] = i;
    }
    sort(id, id + n, cmp);
    double t = bin(0, 1e9 + 1);
    cerr << t << "\n";
    out(t);
    return 0;
}

#include <iostream>
#include <sstream>
#include <stdio.h>
#include <memory.h>
#include <algorithm>
#include <set>
#include <map>
#include <string>
#include <vector>
#include <cmath>
#include <queue>
#include <deque>
#include <stack>
#include <cassert>
#include <time.h>
#include <bitset>

using namespace std;

#define mp make_pair
#define pb push_back
#define _(a,b) memset( (a), b, sizeof( a ) )
#define all(a) a.begin(), a.end()
#define sz(a) (int)a.size()

typedef unsigned long long ull;
typedef long long lint;
typedef pair < int , int > pii;
typedef long double ld;

const int INF = 1000 * 1000 * 1000;
const lint LINF = 1000000000000000000LL;
const double eps = 1e-9;

void prepare()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
#endif
}

const int nmax = 100005;
pair < pii , int > a[nmax];
int n,k,h;
vector < int > ans;

void readdata()
{
	scanf("%d%d%d",&n,&k,&h);
	for (int i = 0; i < n; i++)
		scanf("%d",&a[i].first.first);
	for (int i = 0; i < n; i++)
		scanf("%d",&a[i].first.second);
	for (int i = 0; i < n; i ++)
		a[i].second = i;
	sort(a,a+n);
}

bool can(double T)
{
	ans.clear();
	for (int i = 0; i < n; i ++)
	{
		if (sz(ans) == k) break;
		double t = (double)(sz(ans) + 1.0) * (double)h / (double)a[i].first.second;
		if (t - eps <= T)
		{
			ans.pb(a[i].second);
		}
	}
	return (sz(ans) == k);
}

bool solve()
{
	readdata();
	double l = 0.0,r = INF,m;
	for (int it = 0; it < 400; it ++)
	{
		m = (l + r) / 2.0;
		if (can(m))
			r = m;
		else
			l = m;
	}
	can(r);
	for (int i = 0; i < sz(ans); i ++)
		printf("%d ",ans[i] + 1);
	printf("\n");
	return false;
}

int main()
{
	prepare();
	while (solve());
	return 0;
}

#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <vector>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<string> vs;

const int INF = (int) 1E9;
const ll LINF = (ll) 1E18;

#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
#define REP(i, a) for (int i = 0; i < (a); i++)
#define REPD(i, a) for (int i = (a) - 1; i >= 0; i--)
#define FIT(it, v) for (typeof((v).begin())it = (v).begin(); it != (v).end(); ++it)
#define FITD(it, v) for (typeof((v).rbegin())it = (v).rbegin(); it != (v).rend(); ++it)

#define ALL(v) (v).begin(), (v).end()
#define SET(a, x) memset((a), (x), sizeof(a))
#define SIZE(a) ((int)(a).size())

#define SORT(x) sort(ALL(x))
#define GSORT(x) sort(ALL(x), greater<typeof(*((x).begin()))>())
#define UNIQUE(v) SORT(v); (v).resize(unique(ALL(v)) - (v).begin())

#define PB push_back
#define MP make_pair
#define F first
#define S second

int INP, AM;
#define BUFSIZE (1<<10)
char BUF[BUFSIZE + 1], *inp = BUF;
#define GETCHAR(INP) { \
    if(!*inp) { \
        fread(BUF,1,BUFSIZE,stdin); \
        inp=BUF; \
    } \
    INP=*inp++; \
}
#define DIG(a) (((a)>='0')&&((a)<='9'))
#define GN(j) { \
    AM=0;\
    GETCHAR(INP); while(!DIG(INP) && INP!='-') GETCHAR(INP);\
    if (INP=='-') {AM=1;GETCHAR(INP);} \
    j=INP-'0'; GETCHAR(INP); \
    while(DIG(INP)){j=10*j+(INP-'0');GETCHAR(INP);} \
    if (AM) j=-j;\
}

template<typename T> T gcd(T a, T b) {
    return (b == 0) ? abs(a) : gcd(b, a % b);
}
template<typename T> inline T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}
template<typename T> inline T sqr(T x) {
    return x * x;
}

const char DEBUG_PARAM[] = "__LOCAL_TESTING";

const char IN[] = "input.txt";
const char OUT[] = "output.txt";

int ntest = 0, test;

inline void init();
inline void run();
inline void stop() {
    ntest = test - 1;
}

int main(int argc, char* argv[]) {
    if (argc > 1 && strcmp(argv[1], DEBUG_PARAM) == 0) {
        freopen(IN, "r", stdin);
        //      freopen(OUT, "w", stdout);
    }
    init();
    if (ntest == 0) {
        puts("ntest = ?");
        return 0;
    }
    for (test = 1; test <= ntest; test++) {
        run();
    }
    return 0;
}

/* IMPLEMENTATION */

const int dx[] = { -1, 0, 0, 1 };
const int dy[] = { 0, -1, 1, 0 };

const double EPS = 1E-9;
const ll MODULO = 1000000007LL;

inline void init() {
    ntest = 1; // Input ntest
}
const int maxn = 100000 + 5;
int k, n;
double h[maxn];
double m[maxn];
double v[maxn];
int pos[maxn];
int res[maxn];
int temp[maxn];

bool check(double t) {
    int cur = 1;
    FOR(i,1,k) {
        while (cur <= n && v[cur] * t + EPS < h[i])
            cur++;
        if (cur > n)
            return false;
        temp[i] = cur;
        cur++;
    }
    FOR(i,1,k)
        res[i] = temp[i];
    return true;
}
void sort(int l, int r) {
    if (l >= r)
        return;
    double key = m[(l + r) >> 1];
    int i = l, j = r;
    do {
        while (m[i] < key)
            i++;
        while (m[j] > key)
            j--;
        if (i <= j) {
            swap(m[i], m[j]);
            swap(v[i], v[j]);
            swap(pos[i], pos[j]);
            i++;
            j--;
        }
    } while (i <= j);
    sort(l, j);
    sort(i, r);
}
void sort2(int l, int r) {
    if (l >= r)
        return;
    double key = v[(l + r) >> 1];
    int i = l, j = r;
    do {
        while (v[i] < key)
            i++;
        while (v[j] > key)
            j--;
        if (i <= j) {
            swap(v[i], v[j]);
            swap(pos[i], pos[j]);
            i++;
            j--;
        }
    } while (i <= j);
    sort2(l, j);
    sort2(i, r);
}
void solve() {
    double l = 0, r = 1e12;
    double mid;
    FOR(k,1,100) {
        mid = (l + r) / 2;
        if (check(mid))
            r = mid;
        else
            l = mid;
    }
    FOR(i,1,k) {
        cout << pos[res[i]];
        if (i != k)
            cout << " ";
    }
}

inline void run() {
    double t;
    cin >> n >> k >> t;
    FOR(i,1,k)
        h[i] = t * i;
    FOR(i,1,n)
        cin >> m[i];
    FOR(i,1,n)
        cin >> v[i];
    FOR(i,1,n)
        pos[i] = i;
    sort(1, n);
    FOR(i,1,n) {
        if (i == 1 || m[i] != m[i - 1]) {
            int l = i;
            while (l < n && m[l + 1] == m[l])
                l++;
            sort2(i, l);
        }
    }
    solve();
}

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<cstring>
#include<algorithm>
#include<vector>
#include<deque>
#include<list>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<sstream>
#include<time.h>
#define inf 0x3FFFFFFF
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fo_(i,a,b) for(int i=a;i>=b;i--)
#define ll long long
#define M(a) memset(a,0,sizeof a)
#define M_(a) memset(a ,-1,sizeof a)
#define pb push_back
#define N
using namespace std;

#define mod 1000000007
struct A{
	int w,v,i;
};
bool check(A a[],int n,int k,double lim){
	int i=0,j=1;
	for(;i<n&&j<=k;i++)
		if(a[i].v>lim*j) j++;
	if(j==k+1) return true;
	return false;
}
int main(){
	ios::sync_with_stdio(false);
	//freopen("C:\\test.txt","r",stdin);
	int n,k,h;cin>>n>>k>>h;
	A a[n];fo(i,0,n-1) cin>>a[i].w;fo(i,0,n-1) cin>>a[i].v;fo(i,0,n-1) a[i].i=i+1;
	sort(a,a+n,[](A a,A b){return a.w<b.w||a.w==b.w&&a.v<b.v;});
	double l=0,r=1e9;
	fo(i,1,100){
		double m=(r+l)/2;
		if(check(a,n,k,m)) l=m;
		else r=m;
	}
	for(int i=0,j=1;j<=k;i++)
		if(a[i].v>l*j-1e-8) {
			j++;cout<<a[i].i<<' ';
		}
	return 0;
}

#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <utility>
#include <cstdio>
#include <climits>

using namespace std;

const int size1 = 4e5;
const int INF = 1e9;
const long long mod = 1e9 + 7;
const long double pi = 3.1415926;
long double eps = 1e-6;

int main()
{
#ifdef _DEBUG
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	int k, n, h;
	cin >> n >> k >> h;
	static int m[size1], v[size1];
	for (int i = 1; i <= n; i++)
	{
		cin >> m[i];
	}
	for (int i = 1; i <= n; i++)
	{
		cin >> v[i];
	}
	vector < pair < pair < int, int >, int > > v1;
	for (int i = 1; i <= n; i++)
	{
		v1.push_back({ {m[i], v[i]}, i });
	}
	sort(v1.begin(), v1.end());
	static int mas[size1], num[size1];
	for (int i = 0; i < n; i++)
	{
		mas[i] = v1[i].first.second;
		num[i] = v1[i].second;
		//cout << mas[i] << endl;
	}
	long double r = 1e9 + 500;
	long double l = 0;
	for (int t = 1; t <= 100; t++)
	{
		long double m = (l + r) / 2;
		int cnt = 0;
		for (int i = 0; i < n; i++)
		{
			if (mas[i] >= m * (cnt + 1))
			{
				cnt++;
			}
		}
		if (cnt >= k)
		{
			l = m;
		}
		else
		{
			r = m;
		}
	}
	//cout << l << endl;
	int cnt = 0;
	for (int i = 0; i < n; i++)
	{
		if (mas[i] >= l * (cnt + 1))
		{
			cnt++;
			cout << num[i] << ' ';
			if (cnt >= k)
			{
				break;
			}
		}
	}
	return 0;
}

#include <stdio.h>
#include <string.h>
#include <cmath>
#include <algorithm>
using namespace std;

struct LEM
{
    int m;
    int v;
    int id;
    bool operator<(const LEM& b) const { return m==b.m?v < b.v:m<b.m; }
};
LEM lemm[100010];
bool dblcmp(double a,double b)
{
return fabs(a-b)<1e-9 || a<=b;
}
bool verify(int n,int k,int h,double T)
{
    int pickout = 0;
    for(int i = 0;i < n;i++)
    {
        if(dblcmp(((double)(h*(pickout+1))),(double)lemm[i].v*T))
        {
            pickout++;
            if(pickout >= k) break;
        }
    }
    return pickout >= k;
}

int main(void)
{
    int n = 0;
    int k = 0;
    int h = 0;
    scanf("%d %d %d",&n,&k,&h);
    for(int i = 0;i < n;i++) scanf("%d",&lemm[i].m);
    for(int i = 0;i < n;i++) scanf("%d",&lemm[i].v);
    for(int i = 0;i < n;i++) lemm[i].id = i+1;
    sort(lemm,lemm+n);
    double l = 0;
    double r = 10000000000;
    while((r-l)/r>1e-9)
    {
        double mid = (l+r)/2.0;
        if(verify(n,k,h,mid)) r = mid;
        else l = mid;
    }
    int pickout = 0;
    for(int i = 0;i < n;i++)
    {
        if(dblcmp((double)((pickout+1)*h),(double)lemm[i].v*r))
        {
            printf("%d ",lemm[i].id);
            pickout++;
            if(pickout >= k) break;
        }
    }
    putchar('\n');
    while(getchar() != EOF);
    return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int n, k;
double h;
vector <int> m;
vector <double> v;
vector <int> ans;
pair <pair <int, int>, int> arr[100000];

bool Can(double mid)
{
    vector <int> res;
    for (int i = 0; i < n; i++)
    {
        arr[i].first.second = min(1e9, mid * v[i] / h);
        arr[i].first.first = m[i];
        arr[i].second = i;
    }
    sort(arr, arr + n);
    int tk = k;
    for (int i = n - 1; i >= 0 && tk > 0; i--)
        if (arr[i].first.second >= tk)
        {
            res.push_back(arr[i].second);
            --tk;
        }
    if (tk == 0)
    {
        ans = res;
        return true;
    }
    return false;
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
#endif

    cin >> n >> k >> h;
    m.resize(n);
    v.resize(n);
    for (int i = 0; i < n; i++)
        cin >> m[i];
    for (int i = 0; i < n; i++)
        cin >> v[i];
    double l = 0, r = 1e9;
    for (int i = 0; i < 100; i++)
    {
        double mid = (l + r) / 2;
        if (Can(mid))
            r = mid;
        else
            l = mid;
    }
    reverse(ans.begin(), ans.end());
    for (int i = 0; i < k; i++)
        cout << ans[i] + 1 << " ";
    return 0;
}

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

struct LEM
{
    int m;
    int v;
    int id;
    bool operator<(const LEM& b) const { return m==b.m?v < b.v:m<b.m; }
};
LEM lemm[100010];

bool verify(int n,int k,int h,double T,bool output=false)
{
    int pickout = 0;
    for(int i = 0;i < n;i++)
    {
        if(((double)(h*(pickout+1))) <= (double)lemm[i].v*T)
        {
            if(output) printf("%d ",lemm[i].id);
            pickout++;
            if(pickout >= k) break;
        }
    }
    return pickout >= k;
}

int main(void)
{
    int n = 0;
    int k = 0;
    int h = 0;
    scanf("%d %d %d",&n,&k,&h);
    for(int i = 0;i < n;i++) scanf("%d",&lemm[i].m);
    for(int i = 0;i < n;i++) scanf("%d",&lemm[i].v);
    for(int i = 0;i < n;i++) lemm[i].id = i+1;
    sort(lemm,lemm+n);
    double l = 0;
    double r = 10000000000;
    int fuck = 200;
    while(fuck--)
    {
        double mid = (l+r)/2.0;
        if(verify(n,k,h,mid)) r = mid;
        else l = mid;
    }
    int pickout = 0;
    for(int i = 0;i < n;i++)
    {
        if((double)((pickout+1)*h) <= (double)lemm[i].v*r)
        {
            printf("%d ",lemm[i].id);
            pickout++;
            if(pickout >= k) break;
        }
    }
    putchar('\n');
    while(getchar() != EOF);
    return 0;
}

/// ANTI_LIGHT ///

#include <bits/stdc++.h>

using namespace std;

#define f first
#define s second
#define int long long int
#define double long double

typedef pair<int,int> pii;
typedef pair<pii,int> pos;
const int maxn=1e5+100;
vector<pos>v;
int vv[maxn];
int ww[maxn];

main()
{
	ios_base::sync_with_stdio(false);

	int n,k,h;
	cin>>n>>k>>h;

	for(int i=1;i<=n;i++)
		cin>>ww[i];
	for(int i=1;i<=n;i++)
		cin>>vv[i];

	for(int i=1;i<=n;i++)
	{
		int u=ww[i],w=vv[i];
		v.push_back(pos(pii(u,w),i));
	}
	sort(v.begin(),v.end());
//	for(int i=0;i<n;i++)
//	{
//		cout<<v[i].f.f<<" "<<v[i].f.s<<endl;
//	}

	double l=-1;
	double r=1e12;

	for(int Q=1;Q<=100;Q++)
	{
		double mid=(l+r)/2;
		int now=k;

		for(int i=n-1;i>=0;i--)
		{
			double heigt=now*h;
			double spe=v[i].f.s;
			if(spe*mid>=heigt)
				now--;
			if(!now)
				break;
		}
//		cout<<mid<<" "<<now<<endl;
		if(!now)
			r=mid;
		else
			l=mid;
	}

	vector<int>ans;
	int now=k;

    for(int i=n-1;i>=0;i--)
    {
        double heigt=now*h;
        double spe=v[i].f.s;
        if(spe*r>=heigt)
        {
			ans.push_back(v[i].s);
			now--;
		}
        if(!now)
            break;
    }

	for(int i=k-1;i>=0;i--)
		cout<<ans[i]<<" ";

	return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define sqr(x) ((x) * (x))
#define pb push_back
#define mp make_pair
#define X first
#define Y second
#define fin(name) freopen(name, "r", stdin)
#define fout(name) freopen(name, "w", stdout)
#define I(x, a) for(auto x : a)
#define F(i, l, r) for(auto i = l; i < r; ++i)
#define DF(i, l, r) for(auto i = l; i > r; --i)
#define clean(a) memset((a),0,sizeof (a))
#define sync ios_base::sync_with_stdio(0);cin.tie(0)
#define all(x) x.begin(),x.end()
#define ret return
#define cont continue
#define brk break
#define ins insert
#define sz(a) ((int)(a).size())

typedef long long ll;
typedef unsigned long long ull;
typedef long double dbl;
typedef pair <int, int> pii;

const int inf = (int)1e9;
const ll linf = (ll)1e18;
const int mod = (int)1e9 + 7;
const dbl eps = (dbl)1e-8;
const int maxn = (int)1e5 + 5;
const dbl pi = acos(-1);

ll n, k, h;
pair <ll, ll> a[maxn];
pair <pair <ll, ll>, ll> b[maxn];
int ans[maxn];

int check(dbl t) {
	int u = k;
	F(ti, 0, n) {
		int i = b[ti].Y;
		if ((dbl)u * h / a[i].Y <= t) {
			ans[u] = i;
			--u;
		}
		if (u == 0)
			return 1;
	}
	return 0;
}

int main() {
//    fin("t.in");
    sync;
    cin >> n >> k >> h;
    F(i, 0, n) {
    	cin >> a[i].X;
    }
    F(i, 0, n) {
    	cin >> a[i].Y;
    	b[i] = mp(a[i], i);
    }
    sort(b, b + n);
    reverse(b, b + n);
    dbl l = 0, r = 1e10;
    F(numi, 0, 100) {
    	dbl m = (l + r) / 2;
    	if (check(m))
    		r = m;
    	else
    		l = m;
    }
//    cout << r << endl;
    check(r);
	F(i, 1, k + 1) {
		cout << ans[i] + 1 << " ";
	}
    return 0;
}

#include <cstdio>
#include <cmath>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <string>
#include <cstring>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 1e9;
const double EPS = 1e-9;
int N, K, H;
ll M[100100], V[100100];
int P[100100];
int ans[100100];
bool check(double t)
{
	int cur = K - 1;
	for (int i = 0; i < N; ++i)
	{
		if (cur < 0) return true;
		int nm = P[i];
		double x = ((cur + 1)*H);
		if (x <= t*V[nm])
		{
			ans[cur] = nm;
			--cur;
		}
	}
	return cur < 0;
}
bool cmp (int a, int b)
{
	if (M[a] != M[b])
		return M[a] > M[b];
	return V[a] > V[b];
}
int main()
{
#ifdef _DEBUG
	freopen("test.txt", "r", stdin);
#endif
	scanf ("%d%d%d", &N, &K, &H);
	for (int i = 0; i < N; ++i)
	{
		int t;
		scanf ("%d", &t);
		M[i] = t;
		P[i] = i;
	}
	for (int i = 0; i < N; ++i)
	{
		int t;
		scanf ("%d", &t);
		V[i] = t;
	}
	sort(P, P + N, cmp);
	double l = 0, r = ((ll)K) * H;
	for (int i = 0; i < 200; ++i)
	{
		double m = (l + r) / 2;
		if (check(m))
		{
			r = m;
		}
		else
		{
			l = m;
		}
	}
	check(r);
	for (int i = 0; i < K; ++i)
	{
		printf("%d ", ans[i] + 1);
	}
	return 0;
}

#include <algorithm>
#include <cstring>
#include <cmath>
#include <iostream>
#include <map>
#include <vector>
#include <set>

using namespace std;

// 1 <= k, n <= 10^5
// 1 <= h <= 10^4
// 1 <= m_i <= 10^9
// 1 <= v_i <= 10^9

int main() {
  int n, k, h;
  cin >> n >> k >> h;

  int min_speed = 1e9+1, max_speed = -1;
  vector<pair<int, int>> l(n+1);
  for (int i = 1 ; i <= n ; ++i) {
    cin >> l[i].first;
  }
  for (int i = 1 ; i <= n ; ++i) {
    cin >> l[i].second;
    min_speed = min(min_speed, l[i].second);
    max_speed = max(max_speed, l[i].second);
  }

  vector<int> order(n+1);
  for (int i = 1 ; i <= n ; ++i) order[i] = i;
  sort(order.begin()+1, order.end(), [&](auto& lhs, auto& rhs) {
    int w_diff = l[lhs].first - l[rhs].first;
    if (w_diff != 0) return (w_diff < 0);
    return (l[lhs].second - l[rhs].second) < 0;
  });

  vector<int> ans(k+1);
  auto can_solve = [&](double time) {
    int ki = 1;
    for (int i = 1 ; i <= n && ki <= k ; ++i) {
      if (l[order[i]].second*time >= (double) ki * h) {
        ans[ki] = order[i];
        ++ki;
      }
    }

    return ki > k;
  };

  double lo = (double)h / max_speed;
  double hi = (double)k * h / min_speed;
  double mid = (hi + lo) / 2;
  for (int i = 0 ; i < 90 ; ++i) {
    if (can_solve(mid)) {
      hi = mid;
    }
    else {
      lo = mid;
    }
    mid = (hi + lo) / 2;
  }
  // Rollback to last solvable
  can_solve(hi);
  //cout << hi << endl;

  for (int i = 1 ; i <= k ; ++i) {
    if (i >= 2) cout << " ";
    cout << ans[i];
  }

  cout << endl;

  return 0;
}

#include <iostream>
#include<bits/stdc++.h>
using namespace std;
#define inf 1e10
int n,k,h,f=0;
pair<int,pair<int,int> >a[100001];

bool solve(double t)
{
    int cur=1;
    for(int i=1;i<=n;i++)
    {
        if(1.0*cur*h<=1.0*a[i].second.first*t)
        {
            cur++;
            if(f)
            cout<<a[i].second.second<<" ";
            if(cur>k)
            break;
        }
    }
    return cur>k;
}

int main()
{
    int i;
    cin>>n>>k>>h;
    for(i=1;i<=n;i++)
    cin>>a[i].first;
    for(i=1;i<=n;i++)
    cin>>a[i].second.first;
    for(i=1;i<=n;i++)
    a[i].second.second=i;
    sort(a+1,a+n+1);
    f=0;
    int temp=200;
    double lo=0;
    double hi=inf;
    while(temp--)
    {
        double mid=(lo+hi)/2.0;
        if(solve(mid))
        hi=mid;
        else
        lo=mid;
    }
    f=1;
    solve(hi);
    return 0;
}

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

struct LEM
{
    int m;
    int v;
    int id;
    bool operator<(const LEM& b) const { return m==b.m?v < b.v:m<b.m; }
};
LEM lemm[100010];

bool verify(int n,int k,int h,double T,bool output=false)
{
    int pickout = 0;
    for(int i = 0;i < n;i++)
    {
        if(((double)(h*(pickout+1))) <= (double)lemm[i].v*T)
        {
            if(output) printf("%d ",lemm[i].id);
            pickout++;
            if(pickout >= k) break;
        }
    }
    return pickout >= k;
}

int main(void)
{
    int n = 0;
    int k = 0;
    int h = 0;
    scanf("%d %d %d",&n,&k,&h);
    for(int i = 0;i < n;i++) scanf("%d",&lemm[i].m);
    for(int i = 0;i < n;i++) scanf("%d",&lemm[i].v);
    for(int i = 0;i < n;i++) lemm[i].id = i+1;
    sort(lemm,lemm+n);
    double l = 0;
    double r = 10000000000;
    int fuck = 200;
    while(fuck--)
    {
        double mid = (l+r)/2.0;
        if(verify(n,k,h,mid)) r = mid;
        else l = mid;
    }
    //verify(n,k,h,r,true);
    int pickout = 0;
    for(int i = 0;i < n;i++)
    {
        if((double)((pickout+1)*h) <= (double)lemm[i].v*r)
        {
            printf("%d ",lemm[i].id);
            pickout++;
            if(pickout >= k) break;
        }
    }
    putchar('\n');
    while(getchar() != EOF);
    return 0;
}

#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;

struct lem{
	int m,v,id;
	lem(int m, int v, int id):m(m),v(v),id(id){}
	friend int operator <(const lem &a, const lem &b) {
		if(a.m!=b.m)
			return a.m>b.m;
		return a.v>b.v;
	}
};

vector<lem> in;

const long double eps = 1e-10;

int main() {
	int k,n,h;
	cin>>n>>k>>h;
	for(int i=0;i<n;i++) {
		int m;
		cin>>m;
		in.push_back(lem(m,0,i+1));
	}
	for(int i=0;i<n;i++)
		cin>>in[i].v;
	sort(in.begin(),in.end());
	long double maxt = 1e10;
	long double mint = eps;
	for(int j=0;j<200 || maxt-mint>eps;j++) {
//	while(maxt-mint>eps) {
		long double t = (maxt+mint)/2;
		int flag = 1;
		int begin = 0;
		for(int i=k;i>0;i--) {
			while(in[begin].v<(i*h/t)-eps && begin<n)
				begin++;
			if(begin<n)
				begin++;
			else {
				flag = 0;
				break;
			}
		}
		if(flag)
			maxt = t;
		else
			mint = t;
	}
	vector<int> ans;
	int begin = 0;
	long double t= maxt;
	cerr<<k<<endl;
	for(int i=k;i>0;i--) {
		while(in[begin].v<(i*h/t)-eps && begin<n)
			begin++;
		ans.push_back(in[begin].id);
		begin++;
	}
	reverse(ans.begin(),ans.end());
	for(int i=0;i<ans.size();i++)
		cout<<ans[i]<<' ';
	cout<<endl;
}

//BY momo
#include<cstdio>
#include<vector>
#include<algorithm>
#define MAXN 100010
#define INF 1000000100
#define EPS 10e-10
#define PB push_back
using namespace std;
vector<int> ans;
struct lem{ int m,v,i; }x[MAXN];
bool comp( lem a, lem b ){ return a.m > b.m || a.m == b.m && a.v > b.v; }
int main(){
	int n,k; double h; scanf("%d%d%lf",&n,&k,&h);
	for( int i = 0 ; i < n ; i++ ) x[i].i = i;
	for( int i = 0 ; i < n ; i++ ) scanf( "%d", &x[i].m );
	for( int i = 0 ; i < n ; i++ ) scanf( "%d", &x[i].v );
	sort( x, x+n, comp );
	double lb = 0, rb = INF;
	for( int g = 0 ; g < 100 ; g++ ){
		double mid = ( lb + rb )/2;
		if( g==99 ) mid=rb;
		int cnt = k;
		ans.clear();
		for( int i = 0 ; i < n ; i++ ){
			if( mid*x[i].v-h*cnt+EPS >= 0 ){
				cnt--;
				ans.PB(x[i].i+1);
			}
			if( cnt == 0 ) break;
		}
		if( cnt > 0 ) lb = mid;
		else rb = mid;
	}
	for( int i = ans.size()-1 ; i>=0 ; i-- ) printf("%d%c",ans[i],i==0?'\n':' ');
}

#include<bits/stdc++.h>
using namespace std;
const int maxn=100010;
struct Node
{
    int m,v,id;
    bool operator<(const Node&P)const{
        if(m!=P.m) return m<P.m;
        return v<P.v;
    }
}A[maxn];
int n,k,h,tmp[maxn],ans[maxn];
inline bool check(double M)
{
    int cnt=k;
    for(int i=n;i;i--){
        if(cnt<=A[i].v*M){
            tmp[cnt--]=A[i].id;
            if(!cnt){
                memcpy(ans,tmp,sizeof(int)*(k+1));
                return 1;
            }
        }
    }
    return 0;
}
int main()
{
    #ifdef local
    freopen("a.txt","r",stdin);
    #endif // local
    while(~scanf("%d%d%d",&n,&k,&h))
    {
        for(int i=1;i<=n;i++) A[i].id=i;
        for(int i=1;i<=n;i++) scanf("%d",&A[i].m);
        for(int i=1;i<=n;i++) scanf("%d",&A[i].v);
        sort(A+1,A+1+n);
        double l=1e-9,r=1e5;
        for(int i=0;i<100;i++){
            double mid=(l+r)/2;
            if(check(mid)) r=mid;
            else l=mid;
        }
        for(int i=1;i<=k;i++) printf("%d%c",ans[i],i<k?' ':'\n');
    }
    return 0;
}

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

const int N = 1e5 + 10, MAX = 1e9 + 10;
const long double eps = 1e-18;

typedef long double ld;
typedef pair<pair<int, int>, int> piii;

int n, k, h;
piii a[N];

ld timE(int dex, int floor) {
	return (floor * 1.) / (1. * a[dex].first.second);
}
bool check(ld t) {
	int cnt = 0;
	for (int i = 0; i < n; i++)
		if(timE(i, cnt + 1) - t < eps)
			cnt++;
	return (cnt >= k);
}
int main() {
	ios::sync_with_stdio(false), cin.tie(0), cout.tie(0);
	cin >> n >> k >> h;
	for (int i = 0; i < n; i++)
		cin >> a[i].first.first;
	for (int i = 0; i < n; i++)
		cin >> a[i].first.second;
	for (int i = 0; i < n; i++)
		a[i].second = i;
	sort(a, a + n);
	ld l = 0, r = MAX;
	for (int i = 0; i < 200; i++) {
		ld c = (l + r) / 2;
		if(check(c))
			r = c;
		else
			l = c;
	}
	int cnt = k - 1;
	vector<int> ans;
	for (int i = n - 1; cnt >= 0; i--)
		if(timE(i, cnt + 1) - r <= eps) {
			ans.push_back(a[i].second + 1);
			cnt--;
		}
	reverse(ans.begin(), ans.end());
	for (int dex: ans)
		cout << dex << ' ';
	return 0;
}

#include <vector>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <queue>
#include <string>
#include <algorithm>
#include <utility>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>

using namespace std;

int n, k, h;

bool poss(long double m, vector<pair<int, pair<int, int> > >& lems, vector<int>& res)
{
    int j = 1;

    for (int i = 0; i < n && j <= k; ++i) {
        if (j * h  < m * lems[i].second.first)
        {
            res[j - 1] = lems[i].second.second;
            ++j;
        }
    }

    if (j > k) {
        return true;
    } else {
        return false;
    }
}

int main(void)
{
    long double l , r, m;
    int iter = 128;
    int mass, v;

    vector<pair<int, pair<int, int> > > lems;
    vector<int> res;
    long double ans;

    cin >> n >> k >> h;

    res.assign(k, 0);

    for (int i = 0; i < n; ++i) {
        cin >> mass;
        lems.push_back(make_pair(mass, make_pair(0, i)));
    }

    for (int i = 0; i < n; ++i) {
        cin >> v;
        lems[i].second.first = v;
    }

    sort(lems.begin(), lems.end());

    l = 0, r = 1e9 + 1;

    while (iter > 0) {
        m = (l + r) / 2;

        if (poss(m, lems, res)) {
            r = m;
            ans = m;
        } else {
            l = m;
        }

        --iter;
    }

    poss(ans, lems, res);

    for (int i = 0; i < k; ++i) {
        cout << (res[i] + 1) << " ";
    }

    cout << "\n";

    return 0;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <cstdlib>

using namespace std;

const int ITERATION_COUNT = 65;

struct Lemming
{
	int mass, velocity, index;
	Lemming(){}
	Lemming(const int mass, const int velocity, const int index) :
		mass(mass), velocity(velocity), index(index){}
	bool operator < (const Lemming &p)const
	{
		return
			mass < p.mass ||
			mass == p.mass && velocity < p.velocity ||
			mass == p.mass && velocity == p.velocity && index < p.index;
	}
};

int main()
{
	ios::sync_with_stdio(false);
	int k, n, h;
	cin >> n >> k >> h;
	vector < int > v(n);
	vector < Lemming > lemming(n);
	for (int i = 0; i < n; ++i)
	{
		cin >> lemming[i].mass;
	}
	for (int i = 0; i < n; ++i)
	{
		cin >> v[i];
		lemming[i].velocity = v[i];
	}
	for (int i = 0; i < n; ++i)
	{
		lemming[i].index = i + 1;
	}
	sort(lemming.begin(), lemming.end());

	long double t_left = 0, t_right = (long double)k * h / *min_element(v.begin(), v.end());
	for (int i = 0; i < ITERATION_COUNT; ++i)
	{
		long double t_middle = (t_left + t_right) / 2.0;
		int lemming_idx = 0, ledge_idx;
		for (ledge_idx = 1; ledge_idx <= k && lemming_idx < n; ++ledge_idx, ++lemming_idx)
		{
			while (lemming_idx < n && (long double)ledge_idx * h / lemming[lemming_idx].velocity > t_middle)
			{
				++lemming_idx;
			}
		}
		if (ledge_idx == k + 1 && lemming_idx <= n)
		{
			t_right = t_middle;
		}
		else
		{
			t_left = t_middle;
		}
	}
	int lemming_idx = 0;
	for (int ledge_idx = 1; ledge_idx <= k; ++ledge_idx, ++lemming_idx)
	{
		while ((long double)ledge_idx * h / lemming[lemming_idx].velocity > t_right)
		{
			++lemming_idx;
		}
		cout << lemming[lemming_idx].index << ' ';
	}
	return 0;
}

//              +-- -- --++-- +-In the name of ALLAH-+ --++-- -- --+              \\

#include <bits/stdc++.h>

#define F first
#define S second
#define _sz(x) (int)x.size()

using namespace std ;
using pii = pair <int , int> ;
using ll = long long ;
using ld = long double ;

int const N = 1e5 + 20 ;
int n , k , h ;

struct lemming {
	int m , v , id ;
} a[N] ;

inline bool cmp (lemming a , lemming b) {
	if (a.m != b.m) return a.m < b.m ;
	return a.v < b.v ;
}

int sec[N] , sz ;

inline bool build (ld t) {
	sz = 0 ;
	for (int i = 0 ; i < n ; i ++) {
		if (sz == k) break ;
		if (t * a[i].v >= (sz + 1) * h) sec[sz ++] = a[i].id ;
	}
	return (sz == k) ;
}

int main(){
	ios::sync_with_stdio(false) , cin.tie(0) , cout.tie(0) ;

	cin >> n >> k >> h ;

	for (int i = 0 ; i < n ; i ++) cin >> a[i].m , a[i].id = i ;
	for (int i = 0 ; i < n ; i ++) cin >> a[i].v ;

	sort(a , a + n , cmp) ;

	ld low = 0 , high = 1e9 + 20 ;

	for (int tt = 0 ; tt < 200 ; tt ++) {
		ld mid = (low + high) / 2 ;

		if (build(mid)) high = mid ;
		else low = mid ;
	}

	build(high) ;
	for (int i = 0 ; i < k ; i ++) cout << sec[i] + 1 << ' ' ;
	cout << '\n' ;
}

#pragma GCC optimize("O2")
#include <bits/stdc++.h>
using namespace std;
typedef long long                   ll;
typedef long double                 ld;
typedef pair<int,int>               pii;
typedef pair<ll,ll>                 pll;
typedef pair<double,double>         pdd;
typedef pair<ld,ld>                 pld;
typedef pair<string , string>       pss;
#define ts(x)                       to_string(x)
#define ti(x)                       stoi(x)
#define all(x)                      (x).begin(),(x).end()
#define F                           first
#define S                           second
#define Mp                          make_pair
#define tab                         '\t'
#define sep                         ' '
#define mine(v)                     *min_element(all(v))
#define maxe(v)                     *max_element(all(v))
#define error(x)                    cerr << #x << " = " << x << endl
#define fast_io                     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define file_io                     freopen("in.txt" , "r+" , stdin) ; freopen("out.txt" , "w+" , stdout);
#define endl                        "\n"
inline ll input(){ll n; cin >> n ; return n;}

const int MAXN = 1e5 + 10;
const int MOD = 1e9 + 7;
const int MOD2 = 998244353;
const ll INF = 8e18;

ll pw(ll a , ll b)  { return (!b ? 1 : (b & 1 ? (a * pw(a * a % MOD, b / 2)) % MOD : pw(a * a % MOD, b / 2))); }

ll n, k, h;

ld m[MAXN], V[MAXN];
int BUILD[MAXN];

pair<ld, pair<ld, int> > v[MAXN];

bool f(ld x){
    ll I = h, cnt = 0;
    for(int i = 0; i < n; i++){
        ll ANDI = (v[i].S.S);
        if(I <= V[ANDI] * x){
            cnt++;
            I += h;
        }
    }
    if(cnt < k){
        return 0;
    }
    return 1;
}

void B(ld x){
    ll I = h, cnt = 0;
    for(int i = 0; i < n; i++){
        ll ANDI = (v[i].S.S);
        if(I <= V[ANDI] * x){
            BUILD[cnt] = ANDI + 1;
            cnt++;
            I += h;
        }
    }
}

int main(){
    fast_io;
    //cout << fixed << setprecision(15);
    //scanf("%d %d %f %lld %s %c", &x);
    //printf("%d %d %f %lld %s %c", x);
    cin >> n >> k >> h;
    for(int i = 0;i < n; i++){
        cin >> m[i];
    }
    for(int i = 0; i < n; i++){
        cin >> V[i];
        v[i] = {m[i], {V[i], i}};
    }
    sort(v, v + n);
    ld d = 0, up = 1e10;
    for(ll i = 0; i < 100; i ++){
        ld mid = (up + d) / 2;
        if(f(mid)){
            up = mid;
        }
        else{
            d = mid;
        }
    }
    B(up);
    //cout << up << endl;
    for(int i = 0; i < k; i++){
        cout << BUILD[i] << " ";
    }
    return 0;
}

#include <iostream>
#include <cstdio>
#include <algorithm>

using namespace std;
const long double eps = 1e-9;
struct node{
    long double v;
    int i;
    int m;
};
node v[100010];
long double h[100010];
int n, k;
int ans[100010];
bool f(long double t){
    int i;
    int uk = n - 1;
    for (i = k; i > 0; i--){
        while (uk >= 0 && v[uk].v * t + eps < i)
            uk--;
        if (uk <= -1)
            return false;
        uk--;
    }
    return true;

}

bool less0(node a, node b){
    return a.m < b.m || (a.m == b.m && a.v < b.v);
}

int main(){
    long double r, l, q;
    int w, i;
    int uk;
    cin >> n >> k >> q;
    for (i = 0; i < n; i++)
        scanf("%d", &v[i].m);
    for (i = 0; i < n; i++){
        scanf("%d", &w);
        v[i].v = w / q;
        v[i].i = i;
    }
    sort(v, v + n, less0);

    l = 0;
    r = 2000000000;
    for (i = 0; i < 100; i++){
        if (f((l + r) / 2))
            r = (l + r) / 2;
        else
            l = (l + r) / 2;
    }
    uk = n - 1;
    for (i = k; i > 0; i--){
        while (uk >= 0 && v[uk].v * r + eps < i)
            uk--;
        ans[i - 1] = v[uk].i;

        uk--;
    }
    for (i = 0; i < k; i++)
        printf("%d ", ans[i] + 1);

        return 0;
}

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
using namespace std;
struct node
{
    int m,v,id;
};
bool cmp(const node &a,const node &b)
{
    if (a.m!=b.m) return a.m<b.m;
    return a.v<b.v;
}
int n,k;
long long a[100010];
node p[100010];
double h;
int sgn(double x)
{
    if (fabs(x)<1e-8) return 0;
    return x>0?1:-1;
}
bool ok(double tmax)
{
    for (int i=1; i<=n; i++)
    {
        double num=(1.0*p[i].v*tmax)/h;
        a[i]=(long long)(num);
        if (sgn(a[i]+1-num)==0) a[i]++;
    }
    int now=1;
    for (int i=1; i<=n; i++)
    {
        if (a[i]>=now) now++;
        if (now==k+1) break;
    }
    if (now==k+1) return true;
    return false;
}
int main()
{
    while (scanf("%d%d%lf",&n,&k,&h)==3)
    {
        for (int i=1; i<=n; i++)
        {
            scanf("%d",&p[i].m);
            p[i].id=i;
        }
        for (int i=1; i<=n; i++)
            scanf("%d",&p[i].v);
        sort(p+1,p+n+1,cmp);
        int minn=p[1].v;
        for (int i=1; i<=n; i++)
            minn=min(minn,p[i].v);
        double tmax=h*k*1.0/minn;
        double tmin=0;
        for (int i=0; i<200; i++)
        {
            double mid=(tmax+tmin)/2.0;
            if (ok(mid)) tmax=mid;
            else tmin=mid;
        }
        for (int i=1; i<=n; i++)
        {
            double num=(1.0*p[i].v*tmax)/h;
            a[i]=(long long)(num);
            if (sgn(a[i]+1-num)==0) a[i]++;
        }
        int now=1;
        for (int i=1; i<=n; i++)
        {
            if (a[i]>=now)
            {
                printf("%d ",p[i].id);
                now++;
            }
            if (now==k+1) break;
        }
        printf("\n");
    }
    return 0;
}

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <queue>
#include <set>
#include <map>
#include <bitset>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <hash_map>
#include <unordered_set>

using namespace std;
typedef long long ll;

const double eps = 1e-12;

int n, k, h;
vector<pair<pair<int, int>, int> > arr;

bool func(double mid, bool fl){
    int cnt = k;
    vector<int> ind(k);
    for (int i = 0; i < arr.size(); i++){
        if (cnt == 0)
            break;
        double v = arr[i].first.second;
        double buf = cnt * h;
        buf /= v;
        if (buf < mid || fabs(buf - mid) < eps){
            if (fl){
                ind[cnt - 1] = arr[i].second + 1;
            }
            cnt--;
        }
    }

    if (fl){
        for (int i = 0; i < ind.size(); i++){
            printf("%d ", ind[i]);
        }
    }

    return cnt == 0;
}

int main(){
    cin >> n >> k >> h;
    arr.resize(n);
    for (int i = 0; i < n; i++){
        scanf("%d", &arr[i].first.first);
        arr[i].second = i;
    }
    for (int i = 0; i < n; i++){
        scanf("%d", &arr[i].first.second);
    }

    sort(arr.rbegin(), arr.rend());

    double l = 0, r = 1e11;
    for (int i = 0; i < 100; i++){
        double mid = (l + r) / 2;
        if (func(mid, 0))
            r = mid;
        else
            l = mid;
    }

    func(r, 1);
    return 0;
}

#include <iostream>
#include <algorithm>
#define MAX 100007
using namespace std;

int n, k, h;
int sel[MAX], res[MAX];

struct P{
    int first, second, idx;
    P(){}
    P( int _first, int _second, int _idx ){
        first = _first, second = _second, idx = _idx;
    }
    bool operator < ( const P& m ) const{
        return ( first != m.first ) ? first < m.first : second < m.second;
    }
};
P p[MAX];

int main()
{
    cin >> n >> k >> h;
    for( int i = 0;i < n; i++ ){
        scanf( "%d", &p[i].first );
        p[i].idx = i + 1;
    }
    for( int i = 0;i < n; i++ )
        scanf( "%d", &p[i].second );
    sort( p, p + n );
    double l = 0, r = 1e10;
    for( int i = 0;i < 200; i++ ){
        double mid = ( l + r ) / 2;
        int last = k, idx = n - 1;
        while( idx >= 0 && last ){
            double tim = (double)( last * h ) / (double)p[idx].second;
            if( tim - 1e-10 < mid ){
                sel[last] = p[idx].idx;
                idx--, last--;
            }
            else idx--;
        }
        if( last == 0 ){
            for( int i = 1; i <= k; i++ )
                res[i] = sel[i];
            r = mid;
        }
        else l = mid;
    }
    double pp = (double)h / p[sel[1] - 1].second;
    cout << res[1];
    for( int i = 2; i <= k; i ++ ){
        cout << ' ' << res[i];
        pp = max( pp, (double)( i * h ) / p[res[i] - 1].second );
    }
    cout << endl;
    //cout << pp << endl;
    return 0;
}

//Grzegorz Prusak
#include <cstdio>
#include <algorithm>
#include <cstring>

#define REP(i,n) for(int i=0; i<(n); ++i)
#define FOR(i,p,k) for(int i=(p); i<=(k); ++i)
#define FORD(i,p,k) for(int i=(p); i>=(k); --i)

typedef long long LL;

template<typename T> inline T abs(T a){ return a>0 ? a : -a; }
template<typename T> inline T min(T a, T b){ return a<b ? a : b; }
template<typename T> inline T max(T a, T b){ return a>b ? a : b; }
template<typename T> inline void checkmin(T &a, T b){ if(a>b) a=b; }
template<typename T> inline void checkmax(T &a, T b){ if(a<b) a=b; }
//template<typename T> inline void swap(T &a, T &b){ T c=a; a=b; b=c; }

enum { n_max = 200000, t_max = 100001 };

struct TL
{
	int m,v,i;
	bool operator<(const TL &l) const { return m!=l.m ? m<l.m : v<l.v; }
};

TL L[n_max];

int main()
{
	int n,k,h; scanf("%d%d%d",&n,&k,&h);
	REP(i,n) L[i].i = i+1;
	REP(i,n) scanf("%d",&L[i].m);
	REP(i,n) scanf("%d",&L[i].v);
	std::sort(L,L+n);

	long double tl = 0, th = t_max;
	REP(_,100)
	{
		long double t = (tl+th)/2;
		LL s = 1;
		REP(i,n) if(L[i].v*t>=s) s++;
		if(s>k) th = t; else tl = t;
	}
	//printf("t = %lf\n",th);
	LL s = 1;
	REP(i,n) if(L[i].v*th>=s && s<=k){ s++; printf("%d ",L[i].i); }
	puts("");

	return 0;
}

#include <set>
#include <map>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <sstream>
#include <cstdlib>
#include <vector>
#include <string>
#include <cstring>
#include <algorithm>
using namespace std;

#define forn(a,n) for(int a = 0; a<(n); ++a)
#define dforn(a,n) for(int a = (n)-1; a >= 0; --a)
#define forsn(a,s,n) for(int a = (s); a < n; ++a)

typedef long long tint;

struct triple
{
    tint a;
    tint b;
    tint c;
};

vector <triple> lemmings;

bool compa(triple a, triple b)
{
    if(a.a!=b.a)
    return a.a<b.a;

    if(a.b!=b.b)
    return a.b<b.b;

    return a.c<b.c;
}

int main()
{
#ifdef TESTING
	freopen("test.in", "r", stdin);
#endif
    long long n, k, h;
    cin >> n >> k >> h;

    lemmings.resize(n);

    forn(i,n)
    {
        cin >> lemmings[i].a;
        lemmings[i].c=i;
    }

    forn(i,n)
        cin >> lemmings[i].b;

    sort(lemmings.begin(),lemmings.end(), compa);

    double top=20000000000.0, bot=0.0, mid=(top+bot)/2;

    forn(i,100)
    {
        double t=1;

        forn(i,n)
        {
            double gas=lemmings[i].b;
            gas*=mid;
            if(t<gas)
            t+=1.0;
        }

        if(t+0.5>k+1)
        top=mid;
        else
        bot=mid;

        mid=(top+bot)/2;
    }

    int asd[k];
    double t=1; int wer=0;
    forn(i,n)
    {double gas=lemmings[i].b; gas*=mid;
    if(t<gas+0.0000000001 && wer<k)
    {
        t+=1.0;
        asd[wer]=lemmings[i].c;
        wer++;
    }
    }
    forn(i,k-1)
    cout << asd[i]+1 << " ";
    cout << asd[k-1]+1 << endl;
}

#include <iostream>
#include <vector>
#include <string>
#include <deque>
#include <algorithm>
#include <functional>
#include <map>
#include <bitset>
#include <iomanip>
#include <list>
#include <set>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <numeric>
using namespace std;
#define FOR(i,b,e) for( int i = b; i <  e; ++i )
#define FOI(i,b,e) for( int i = b; i <= e; ++i )
#define FOD(i,b,e) for( int i = b; i >= e; --i )
#define REP(c) FOR(_______,0,c)

#define sz(z) int( (z).size() )
#define all(a) (a).begin(), (a).end()
#define pii pair<int,int>
#define pt pair<int,int>
#define x first
#define y second
#define uint64 unsigned __int64
#define int64 __int64
#define wtf(s) {while(1)puts(s);}

const int INF32 = int(1e9);

void deb(){}

int nextInt(){
    int n;
    scanf( "%d", &n );
    return n;
}

struct lem{
    int id, m;
    double v;
};

bool lessByMV( lem a, lem b ){
    return
        a.m <  b.m ||
        a.m == b.m && a.v < b.v;
}

int n, k, h;
vector<lem> arr;
vector<int> ans;

bool CanGet( double tm ){
    vector<int> curAns;
    curAns.reserve( k );
    for( int i = 0; sz(curAns) != k && i < n; ++i ){
        if( h*(sz(curAns)+1) <= tm * arr[i].v ){
            curAns.push_back( arr[i].id );
        }
    }
    if( sz(curAns) == k ) ans = curAns;
    return sz(curAns) == k;
}

__int32 main(){
#ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
#endif

    cin >> n >> k >> h;
    arr.assign( n, lem() );
    FOR( i, 0, n ) arr[i].id = i + 1;
    FOR( i, 0, n ) arr[i].m = nextInt();
    FOR( i, 0, n ) arr[i].v = nextInt();

    sort( all(arr), lessByMV );

    double tl = 0, tr = 1e4*1e5 * 1.5;
    while( 1 ){
        double tm = (tl + tr) / 2;
        if( tm == tl || tm == tr ) break;
        ( CanGet(tm)? tr : tl ) = tm;
        //cout << tm << endl;
    }

    FOR( i, 0, sz(ans) )
        printf( " %d", ans[i] );
    cout << endl;

    return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <queue>
#include <map>
using namespace std;

struct blok
{
	int m;
	int v;
	int nom;
};

bool comp(blok b1, blok b2)
{
	if(b1.m == b2.m)
	{
		return b1.v < b2.v;
	}
	return b1.m < b2.m;
}

int n, k, h;

blok u[100005];
vector<int> ans;
vector<int> tmp_ans;

bool get_ans(double t)
{
	int i;
	int kk = 0;
	int cur_h = h;
	tmp_ans.clear();
	for(i = 0; i < n && kk < k; i++)
	{
		if((double(cur_h) / u[i].v) < t)
		{
			tmp_ans.push_back(u[i].nom);
			kk++;
			cur_h += h;
		}
	}
	if(kk >= k)
	{
		ans = tmp_ans;
		return true;
	}
	return false;
}

int main()
{
	scanf("%d%d%d", &n, &k, &h);
	int i;
	for(i = 0; i < n; i++)
	{
		scanf("%d", &u[i].m);
		u[i].nom = i + 1;
	}
	for(i = 0; i < n; i++)
	{
		scanf("%d", &u[i].v);
	}
	sort(u, u + n, comp);
	double st = 0;
	double end = 1e18;
	for(i = 0; i < 500; i++)
	{
		double t = (st + end) / 2.0;
		if(get_ans(t))
		{
			end = t;
		}
		else
		{
			st = t;
		}
	}
	for(i = 0; i < k; i++)
	{
		printf("%d", ans[i]);
		if(i < k - 1) printf(" ");
	}
	printf("\n");
	return 0;
}

#include <cstdio>
#include <cstring>
#include <algorithm>
#include <vector>
#include <cmath>
using namespace std;

typedef double db;
const int maxn = 1e5 + 5;
const db eps = 1e-12;//精度卡得非常的恶心
int n, k, h;
struct lemming {
	int w, v, id;

	bool operator < (const lemming &rhs) const {
		if (w != rhs.w)	return w < rhs.w;
		return v < rhs.v;
	}
}a[maxn];
vector<int> ans;

int dcmp(db x) {
	if (fabs(x) < eps)	return x;
	return x > 0 ? 1 : -1;
}

bool ok(db t) {
	vector<int> v;
	for (int i = 1, j = 1; i <= n; i++) {//greedy
		if (dcmp(t - (db)h * j / a[i].v) < 0)	continue;
		v.emplace_back(a[i].id); j++;
		if (j > k)	break;
	}
	if (v.size() < k)	return 0;
	ans = v; return 1;
}

int main() {
	scanf("%d %d %d", &n, &k, &h);
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i].w), a[i].id = i;
	for (int i = 1; i <= n; i++)
		scanf("%d", &a[i].v);

	sort(a + 1, a + 1 + n);

	db l = 0, r = 1e9;
	for (int i = 0; i < 150; i++) {//根据本题实践的话迭代的方式貌似精度更好
		db mid = (l + r) / 2;
		if (ok(mid))	r = mid;
		else	l = mid;
	}

	for (auto i : ans)
		printf("%d ", i);
}

#include <cstdio>
#include <iostream>
#include <cstdlib>
#include <cmath>
#include <cstring>
#include <ctime>
#include <climits>
#include <utility>
#include <algorithm>
using namespace std;

#define ms(x, y) memset(x, y, sizeof(x))
#define mc(x, y) memcpy(x, y, sizeof(x))

const int maxn = 100000 + 10;

struct info {
    int m, v, ind;
};

int n, k, h;
info a[maxn];
int ans[maxn], res[maxn];

bool cmp(const info &a, const info &b) {
    return a.m < b.m || a.m == b.m && a.v < b.v;
}

int main() {

    scanf("%d%d%d", &n, &k, &h);
    for (int i = 0; i < n; ++i) {
        scanf("%d", &a[i].m);
        a[i].ind = i + 1;
    }
    for (int i = 0; i < n; ++i)
        scanf("%d", &a[i].v);
    sort(a, a + n, cmp);

    int nk;
    double l = 0, r = 1e12, mid;
    for (int z = 0; z < 300; ++z) {
        mid = (l + r) * 0.5;
        nk = 1;
        for (int i = 0; i < n && nk <= k; ++i)
            if (nk <= mid * a[i].v)
                res[nk++] = a[i].ind;
        if (nk > k) {
            mc(ans, res);
            r = mid;
        } else
            l = mid;
    }

    //printf("%lf\n", res);
    for (int i = 1; i < k; ++i)
        printf("%d ", ans[i]);
    printf("%d\n", ans[k]);

    return 0;
}

#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <vector>
#include <string>
#include <string.h>
#include <utility>
#include <queue>
#include <iostream>
#include <iomanip>
#include <ctype.h>
#include <sstream>
#include <map>
#include <stdio.h>

#define LL long long
#define fr(i,n) for(i=0;i<n;i++)
#define INF (2000000000)
#define FOR(n) for(int i = 0;i < n;i++)
#define CLEAR(x) memset(x,0,sizeof(x))

using namespace std;

struct lem{
    int m;
    int v;
    int pos;
};

int n,k,h;
lem* a = new lem[100000];
int mez[100000];

bool cmp(lem x,lem y){
    if (x.m != y.m)
        return x.m < y.m;
    else
        return x.v < y.v;
}

double low,high;

void bs(){
    double t = (low+high)/2;
    FOR(n){
        LL x = (LL)((long double)t*(LL)a[i].v);
        if (x > k)
            x=k;
        mez[i] = x;
    }
    int idx = k;
    for (int x = n-1;x>=0;x--){
        if (mez[x] >= idx)
            idx--;
        if (idx == 0)
            break;
    }
    if (idx == 0)
        high=t;
    else
        low=t;

}

int main()
{
    //freopen("input.txt", "rt", stdin);
    cin >> n >> k >> h;
    FOR(n){
        a[i].pos=i+1;
        scanf("%d",&a[i].m);
    }
    FOR(n)
        scanf("%d",&a[i].v);
    sort(a,a+n,cmp);

    low=0;
    high=k+1;
    FOR(128)
        bs();

    int ans[100000];
    FOR(n){
        LL x = (LL)((long double)high*(LL)a[i].v);
        if (x > k)
            x=k;
        mez[i] = x;
    }
    int idx = k;
    for (int x = n-1;x>=0;x--){
        if (mez[x] >= idx){
            ans[idx-1]=a[x].pos;
            idx--;
        }
        if (idx == 0)
            break;
    }

    FOR(k)
        printf("%d ",ans[i]);

    return 0;
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

template<class T> inline void checkmin(T &a,T b){if(b<a) a=b;}

const int maxn=100+5;

const double pi = 3.1415926535897932384626433832795;
const double eps=0.000000001;
int i,j,n,k;
double h;
int m[100010][3],ans[100010],temp[100010];

int cmp(const void *a,const void *b)
{
	if (*(int *)a == *(int *)b)return *((int *)a+1)-*((int *)b+1);
	return *(int *)a-*(int *)b;
}

void deal()
{
	double l,r,mid;
	int top,num=200;
//	printf("%lf\n",eps);
//	h=100000000.0;
	l=0;r=k * h;
	while(num--)
	{
		mid=(l+r)/2;
		for (top=1,i=0;i<n && top<=k;i++)
		{
			if ( h * top/m[i][1] <= mid )
			{
				temp[top-1]=m[i][2];
				top++;
			}
		}
		if (top>k)
		{
			r=mid;
			for (i=0;i<k;i++)ans[i]=temp[i];
		}
		else l=mid;
	}
//	printf("%f\n",mid);
}

int main()
{
	scanf("%d%d%lf",&n,&k,&h);
	for (i=0;i<n;i++)scanf("%d",&m[i][0]);
	for (i=0;i<n;i++){scanf("%d",&m[i][1]);m[i][2]=i+1;}
	qsort(m,n,sizeof(m[0]),cmp);

	deal();

	for (i=0;i<k;i++)
	{
		printf("%d",ans[i]);
		if (i<k-1)printf(" ");
		else printf("\n");
	}
	return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
typedef string str;

#define all(x)                      (x).begin(),(x).end()
#define Sort(x)                     sort(all((x)))
#define X                           first
#define Y                           second
#define Mp                          make_pair
#define pb(x)                       push_back(x)
#define sep                         ' '
#define endl                        '\n'
#define debug(x)                    cerr << #x << " = " << x << endl
#define SZ(x)                       ll(x.size())
#define fast_io                     ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);

const ll MAXN = 1e5 + 10;
const ll MOD = 1e9 + 7;

pair <ll , pll> p[MAXN];
ll h , m[MAXN];
ll n , k;

bool check(ll t){

    ll cnt = 1;
    ll hr = h;
    for(int i = 1; i <= n; i++){
        if(1.0 * hr / p[i].Y.X <= t){
            cnt ++;
            if (cnt == k + 1){
                return true;
            }
            hr += h;
        }
    }
    return false;

}

bool checkt(ld t){

    ll cnt = 1;
    ll hr = h;
    for(int i = 1; i <= n; i++){
        if(1.0 * hr / p[i].Y.X <= t){
            cnt ++;
            if (cnt == k + 1){
                return true;
            }
            hr += h;
        }
    }
    return false;

}

int main(){

    fast_io;
    cin >> n >> k >> h;
    for(int i = 1; i <= n; i++){
        cin >> m[i];
    }
    ll x;
    for(int i = 1; i <= n; i++){
        cin >> x;
        p[i] = Mp(m[i] , Mp(x , i));
    }
    sort(p + 1 , p + n + 1);
    ll l = 0 , r = 1e10;
    while(r - l > 1){
        ll t = (l + r) / 2;
        if (check(t)){
            r = t;
        }
        else{
            l = t;
        }
    }
    ll q = 100;
    ld lt = 1.0 * l , rt = 1.0 * r , ti;
    while(q > 0){
        ti = 1.0 * (lt + rt) / 2;
        if (checkt(ti)){
            rt = ti;
        }
        else{
            lt = ti;
        }
        q --;
    }
    ll cnt = 1;
    ll hr = h;
    vector <ll> v;
    for(int i = 1; i <= n; i++){
        //cout << p[i].X << " " << p[i].Y.X << " " << p[i].Y.Y << endl;
        if(1.0 * hr / p[i].Y.X <= rt){
            v.pb(p[i].Y.Y);
            cnt ++;
            if (cnt == k + 1){
                break;
            }
            hr += h;
        }
    }
    for(auto u: v){
        cout << u << sep;
    }

}//hellobig_tq

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <ctime>
using namespace std;
#define ll long long
#define ull unsigned long long
#define mst(a,b) memset((a),(b),sizeof(a))
#define pii pair<int,int>
#define pII pair<ll,ll>
#define pi acos(-1)
#define pb push_back
const double eps = 1e-6;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int MAXN = 1e5 + 10;
const int MAXM = 1e6 + 10;

int n,k,h;
int ans[MAXN];

struct node {
    int m,v,id;
}a[MAXN];

bool cmp(node x,node y) {
    if(x.m != y.m) return x.m < y.m;
    return x.v < y.v;
}

bool judge(double tim) {
    int sum = 1;
    for(int i=1; i<=n; i++) {
        if(a[i].v * tim >= sum * h) sum++;
        if(sum > k) return true;
    }
    return false;
}

int main() {
#ifdef local
    freopen("data.txt","r",stdin);
//    freopen("data.txt","w",stdout);
#endif
    scanf("%d%d%d",&n,&k,&h);
    for(int i=1; i<=n; i++)
        scanf("%d",&a[i].m);
    for(int i=1; i<=n; i++) {
        scanf("%d",&a[i].v);
        a[i].id = i;
    }
    double l = 1e-9, r = 1e9;
    sort(a+1,a+1+n,cmp);
    for(int i=0; i<200; i++) {
        double mid = (l + r) / 2;
        if(judge(mid)) r = mid;
        else l = mid;
    }
    int sum = 1;
    for(int i=1; i<=n; i++) {
        if(a[i].v * r >= sum * h) {
            ans[sum++] = a[i].id;
//            printf("%d ",a[i].id);
            if(sum > k) break;
        }
    }

    for(int i=1; i<=k; i++)
        printf("%d ",ans[i]);
    return 0;
}

#include<iostream>
#include<cstdio>
#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<numeric>
using namespace std;

#define LL long long

const int MaxN = 100005;

int M[MaxN],V[MaxN],N,K,H,idx[MaxN];
LL ok[MaxN];
int out[MaxN];
inline int cmp(int a, int b)
{
	return M[a] != M[b] ? M[a] < M[b] : V[a] < V[b];
}

int main()
{
	scanf("%d %d %d", &N, &K, &H);
	for(int i=0;i<N;++i)
	{
		scanf("%d", M+i);
		idx[i]=i;
	}
	for(int i=0;i<N;++i)
		scanf("%d", V+i);

	sort(idx, idx+N, cmp);

	double lo = -1, hi =/* K * H*/1000000010, mid;
	int cap;
	for(int loop=0;loop<200;++loop)
	{
		mid = (lo + hi) * 0.5;
//		for(int i=0;i<N;++i)
//			ok[i] =
		cap = 1;
		for(int i=0;i<N && cap <= K;++i)
		{
			int j = idx[i];
			if(mid * V[j]>= cap * H){
				++ cap;
			//	out[cap-2]=j+1;
			}
		}
		if(cap > K) hi = mid;
		else lo = mid;
	}
	cap = 1;
	for(int i=0;i<N && cap <= K;++i)
	{
		int j = idx[i];
		if( hi * V[j]>= cap*H)
		{

			//cout <<endl<<"---> id = "<<j+1<<"  V = "<<V[j]<<"  Kcap = "<<hi * V[j]/H<<endl;

			++ cap;
			out[cap-2]=j+1;
		}
	}

	for(int i=0;i<K;++i)
	{
		if(i) putchar(' ');
		printf("%d",out[i]);
	}
	puts("");
	//cout << hi << endl;
	//scanf("%*s");
	return 0;
}
/*
5 3 10
3 4 3 2 1
5 4 3 2 1

5 3 2
1 2 3 2 1
1 2 1 2 10
*/

#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <limits>

using namespace std;

int DEBUG = 0;

double Min(double a, double b) {
  return (a < b ? a : b);
}
double Max(double a, double b) {
  return (a > b ? a : b);
}
double Abs(double a) {
  return (a >= 0 ? a : -a);
}
void print1d(int *vec, int M, const char *str=NULL) {
  if(str != NULL) printf("%s ", str);
  for(int i=0; i<M; i++) {
    if(i>0) printf(" ");
    printf("%d", vec[i]);
  }
  printf("\n");
}

struct NODE {
  int id, m, v;
};

int compare_NODE_speed_dec (const void * a_, const void * b_) {
  NODE *a = (NODE*)a_;
  NODE *b = (NODE*)b_;
  if(      a->v < b->v ) return  1;
  else if( a->v > b->v ) return -1;
  else return 0;
}

int compare_NODE_weight_inc (const void * a_, const void * b_) {
  // weight inc then speed inc
  NODE *a = (NODE*)a_;
  NODE *b = (NODE*)b_;
  if(      a->m > b->m ) return  1;
  else if( a->m < b->m ) return -1;
  else if( a->v > b->v ) return  1;
  else if( a->v < b->v ) return -1;
  else return 0;
}

#define MAXN 100010
int n, k, h;
NODE lem[MAXN];
int out[MAXN];

bool doable(double t) {
  // check if t is realizable
  int nvalid = 0;
  for(int i=1; i<=n; i++) {
    if( (1.0*h*(nvalid+1)/lem[i].v) <= t ) {
      out[nvalid++] = lem[i].id;
      if( nvalid==k ) return true;
    }
  }
  return false;
}

int main(int argc, char **argv) {
  DEBUG = (argc>=2) ? atoi(argv[1]) : 0;
  // n,k 1e5, h 1e4, m 1e9, v 1e9
  cin >> n >> k >> h;
  h = 1; // WLOG
  double tmin = 1.0e10, tmax=0;
  for(int i=1; i<=n; i++) {
    cin >> lem[i].m;
    lem[i].id = i;
  }
  for(int i=1; i<=n; i++) {
    cin >> lem[i].v;
    tmin = Min(tmin, 1.0*h/lem[i].v);
    tmax = Max(tmax, 1.0*k*h/lem[i].v);
  }
  if(DEBUG) {
    cout << "tmin= " << tmin << " tmax= " << tmax << endl;
  }
  qsort(lem+1, n, sizeof(NODE), compare_NODE_weight_inc);
  // binary search between tmin, tmax
  if(DEBUG) {
    for(int i=1; i<=n; i++) {
      cout << "i= " << i << " id= " << lem[i].id
	   << " m= " << lem[i].m
	   << " v= " << lem[i].v << endl;
    }
  }
  // double tgap = tmin / 100.0;
  // while( (tmax-tmin) > tgap ) {
  for(int iter=0; iter<100; iter++) { // overkill
    double tmid = (tmin+tmax)/2.0;
    if(doable(tmid)) {
      tmax = tmid;
    } else {
      tmin = tmid;
    }
    if(DEBUG) {
      cout
	<< "tmin= " << tmin
	<< " tmid= " << tmid
	<< " tmax= " << tmax
	<< endl;
    }
  }
  doable(tmax); // set the final out vector
  for(int i=0; i<k; i++) {
    if(i>0) cout << " ";
    cout << out[i];
  }
  cout << endl;
  if(DEBUG) {
    cout << "sizeof(double)= " << sizeof(double) << endl;
    cout << "sizeof(long double)= " << sizeof(long double) << endl;
    cout << "numeric_limits<double>::min()= " << numeric_limits<double>::min() << endl;
    cout << "numeric_limits<double>::max()= " << numeric_limits<double>::max() << endl;
    cout << "numeric_limits<long double>::min()= " << numeric_limits<long double>::min() << endl;
    cout << "numeric_limits<long double>::max()= " << numeric_limits<long double>::max() << endl;
  }
  return 0;
}

/*

g++ 169D.cpp; cat 169D.in1 | ./a.out 1

g++ 169D.cpp; cat 169D.in2 | ./a.out 1

*/

#include <string>
#include <cctype>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <cstring>
#include <stack>
#include <bitset>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <cstdlib>
#include <cstdio>
#include <queue>
#include <stack>
#include <functional>
#include <utility>
#include <iomanip>
#include <ctime>
using namespace std;
#define SZ(a) (int)(a).size()
#define FOR(i,a,b) for (int i=(a); i<=(b); ++i)
#define REP(i,n) for (int i=0; i<(n); ++i)
#define ALL(c) c.begin(), c.end()
#define CLR(c,n) memset(c,n,sizeof(c))
#define TR(container, it) for(typeof(container.begin()) it = container.begin(); it != container.end(); it++)
#define CONTAIN(container, it) (container.find(it)!=container.end())
const int INF=0x3F3F3F3F;
template <class T> inline T& checkmin(T& a, T b) {if (b<a) a=b;}
template <class T> inline T& checkmax(T& a, T b) {if (b>a) a=b;}
typedef long long LL;
typedef vector<int> VI;
typedef vector<VI> VII;
typedef vector<string> VS;
typedef pair<int,int> PII;

const int N=200000;
int n, k, h;
struct DAT {
	int m, id;
	double v;
};
bool operator<(const DAT &d1, const DAT &d2) {if (d1.m!=d2.m) return d1.m>d2.m; else return d1.v>d2.v;}
DAT d[N];
int ans[N+1];
bool check(double t) {
	int cur=k;
	REP(i,n) {
		if (cur>0&&d[i].v*t/h+1e-9>=cur) {
			ans[cur]=d[i].id;
			--cur;
		}
	}
	return cur==0;
}
int main() {
	scanf("%d%d%d", &n, &k, &h);
	REP(i,n) scanf("%d", &d[i].m);
	REP(i,n) scanf("%lf", &d[i].v);
	REP(i,n) d[i].id=i+1;
	sort(d,d+n);
	double mint=0, maxt=1e9;
	REP(i,90) {
		double t=(maxt+mint)/2;
		if (check(t)) maxt=t;
		else mint=t;
	}
	check(maxt);
	FOR(i,1,k) printf("%d ", ans[i]);
}

#include <cstdarg>
#include <ctime>
#include <cmath>
#include <cctype>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cassert>

#include <algorithm>
#include <vector>
#include <string>
#include <sstream>
#include <iostream>
#include <functional>
#include <map>
#include <set>
#include <fstream>
#include <queue>
#include <bitset>
#include <numeric>
#include <iterator>
#include <complex>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define repd(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define forn(i, a, b) for (int i = (int)(a); i <= (int)(b); ++i)
#define fornd(i, a, b) for (int i = (int)(b); i >= (int)(a); --i)
#define sz(a) (int)(a).size()
#define all(a) (a).begin(), (a).end()
#define zero(a) memset(a, 0, sizeof(a))
#define fill(a, x) memset(a, x, sizeof(a))
#define pb push_back
#define mp make_pair
#define log(a, x) cout << a << " : " << x << endl;

typedef unsigned int uint;
typedef double dbl;
typedef long long ll;
typedef unsigned long long ull;
typedef vector <int> vi;
typedef vector <vi> vvi;
typedef vector <string> vs;
typedef pair <int, int> pii;
typedef pair <dbl, dbl> pdd;
typedef unsigned char byte;
typedef complex<double> base;

template <class T> T inline sqr(T x) { return x * x; }
template <class T> inline T myAbs( T a ) { return a > 0 ? a : -a; }

#define mod 1000000007
#define nmax 501
#define eps 1e-10

#ifndef ONLINE_JUDGE
#include "prettyprint.cpp"
#endif

struct lol {
    int m,v,n;
    double h;
};

vector<lol> a;

bool compr(lol a, lol b) {
    if (a.m == b.m)
        return a.v>b.v;
    return a.m > b.m;
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif
    int n,k,h;
    vi res,our;
    cin >> n >> k >> h;
    a.resize(n);
    res.resize(k);
    our.resize(k);
    rep(i,n) {
        scanf("%d",&a[i].m);
    }
    rep(i,n) {
        scanf("%d",&a[i].v);
        a[i].n = i+1;
    }

    double l = 0;
    double r = 2000000000.0;
    bool yes = false;
    sort(a.begin(),a.end(),compr);
    rep(test,500) {
        double t = (l+r) / 2;
        rep(i,n) {
            a[i].h = 1.0*t*a[i].v;
        }
        int j = k;
        res.clear();
        res.resize(k);
        rep(i,n) {
            if (j == 0)
                break;
            if (a[i].h >= j*h)
                res[j-1] = a[i].n, --j;
        }
        if (j >0) {
            l = t;
        } else {
            r = t;
            our = res;
        }
    }
    rep(i,k-1) {
        cout << our[i] << " ";
    }
    cout << our[k-1] << endl;
    return 0;
}

#include<cstdio>
#include<iostream>
#include<string>
#include<algorithm>
#include<map>
using namespace std;
const long double EPS=1e-9;

typedef long long LL;
int n,k,h;
int m[100000],v[100000],id[100000];
int ans[100000];
double x;

bool cmp(int a,int b){return m[a]!=m[b]?m[a]<m[b]:v[a]<v[b];}

int main(){

  scanf("%d%d%d",&n,&k,&h);
  for(int i=0;i<n;i++)scanf("%d",m+i);
  for(int i=0;i<n;i++)scanf("%d",v+i);
  for(int i=0;i<n;i++)id[i]=i;

  sort(id,id+n,cmp);
  long double l=0,r=1e20,c;
  for(int i=0;i<200;i++){
    c=(l+r)/2;
    int t=0,j;
    for(j=1;j<=k;j++){
      for(;t<n && (double)j*h+EPS>v[id[t]]*c;t++);
      if(t==n)break;
      t++;
    }
    if(j>k)r=c;
    else l=c;
  }
  int t=0;
  for(int j=1;j<=k;j++){
    for(;t<n && (double)j*h+EPS>v[id[t]]*r;t++);
    printf("%d%c",id[t]+1,j==k?'\n':' ');
    t++;
  }

  return 0;
}

/*
I guess this time you're really leaving
I heard your suitcase say goodbye
Well as my broken heart lies bleeding
you say true love is suicide

You say you've cried a thousand rivers
And now you're swimming for the shore
You left me drowning in my tears
And you won't save me anymore

Now I'm praying to God you'll give me one more chance, girl

I'll be there for you
These five words I swear to you
When you breathe I want to be the air for you
I'll be there for you
I'd live and I'd die for you
I'd steal the sun from the sky for you
Words can't say what love can do
I'll be there for you

I know you know we've had some good times
Now they have their own hiding place
Well I can promise you tomorrow
But I can't buy back yesterday

And Baby you know my hands are dirty
But I wanted to be your valentine
I'll be the water when you get thirsty, baby
When you get drunk, I'll be the wine

I'll be there for you
These five words I swear to you
When you breathe I want to be the air for you
I'll be there for you
I'd live and I'd die for you
Steal the sun from the sky for you
Words can't say what a love can do
I'll be there for you

And I wasn't there when you were happy
I wasn't there when you were down
I didn't mean to miss your birthday, baby
I wish I'd seen you blow those candles out

I'll be there for you
These five words I swear to you
When you breathe I want to be the air for you
I'll be there for you
I'd live and I'd die for you
Steal the sun from the sky for you
Words can't say what a love can do
I'll be there for you
*/

#include <iostream>
#include <fstream>
#include <string>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>

#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define INF 1000000000
#define eps 1e-10
#define M_PI 3.141592653589793

//#define mx 1000000000000ll
#define bs 1000000007
//#define szz 400
//#define pb push_back

using namespace std;
vector <long> ans;
long long n,q,k,h,m[200000],v[200000];
pair <long, long> p;
pair <pair <long, long> ,long > pp;
vector <pair <pair <long, long> ,long > > ve;
long double l,mm,r;

int main(){
//freopen("C:/aver.txt","r",stdin);
//freopen("C:/output.txt","w",stdout);
cin>>n>>k>>h;

for (int i=1;i<=n;i++)
{
    cin>>m[i];
}

for (int i=1;i<=n;i++)
{
    cin>>v[i];
}

for (int i=1;i<=n;i++)
{p=make_pair(m[i],v[i]);
pp=make_pair(p,i);
ve.push_back(pp);
}

l=0;
r=h*k;

sort(ve.begin(),ve.end());

long iters=0;

while (iters<100)
{
      ++iters;
      q=0;
      mm=l+r;
      mm/=2;

      for (int i=0;i<ve.size();i++)
      {
          if (q<k)
          if (h*(q+1)<=mm*ve[i].first.second)q++;
      }
      if (q==k)r=mm; else l=mm;
}

//cout<<mm<<endl;
q=0;
mm=r;

    for (int i=0;i<ve.size();i++)
      {
          if (q<k)
          if (h*(q+1)<=mm*ve[i].first.second+1e-14){q++;ans.push_back(ve[i].second);}
      }

for (int i=0;i<ans.size();i++)
{if (i)cout<<" ";
 cout<<ans[i];}

 cout<<endl;

cin.get();cin.get();
return 0;}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <climits>
#include <cassert>
#include <string>
#include <bitset>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <algorithm>
using namespace std;

#define INF 1000000000
#define LL_INF 4000000000000000000ll
#define EPS (1e-9)

#define Lowbit(x) ((x) & (-(x)))
#define Lc(x) ((x) << 1)
#define Rc(x) (lc(x) + 1)
#define Pow2(x) (1 << (x))
#define Contain(a, x) ((bool)(a & Pow2(x)))

#define Rep(i, a, b) for(int i = (a); i <= (b); ++i)
#define Til(i, a, b) for(int i = (a); i >= (b); --i)
#define Foru(i, a, b) for(int i = (a); i < (b); ++i)
#define Ford(i, a, b) for(int i = (a); i > (b); --i)

#define For_edge(i, x) for(edge i = x; i; i = i->next)
#define For(i, x) for(__typeof(x.begin()) i = x.begin(); i != x.end(); ++i)

#define Debug(x) (cout << #x << " = " << (x) << endl)
#define Debug2(x, y) (cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl)

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int, int> pii;
typedef vector<int>::iterator vit;
typedef deque<int>::iterator dit;
typedef list<int>::iterator lit;
typedef set<int>::iterator sit;
typedef map<int, int>::iterator mit;

template <class T> inline bool Up(T &a, const T &b) { if(a < b) {a = b; return true;} return false; }
template <class T> inline bool Down(T &a, const T &b) { if(a > b) {a = b; return true;} return false; }

inline int getint() { int tmp, c; while(tmp = getchar(), tmp < '0' || tmp > '9'); tmp -= '0'; while(c = getchar(), '0' <= c && c <= '9') tmp = tmp * 10 + c - '0'; return tmp; }
inline int getsigned() { int tmp, c, flag; while(flag = getchar(), flag != '-' && (flag < '0' || flag > '9')); if(flag == '-') tmp = 0; else tmp = flag - '0'; while(c = getchar(), '0' <= c && c <= '9') tmp = tmp * 10 + c - '0'; return flag == '-' ? -tmp : tmp; }

#define MAXN 100022
struct lem {
	int m, v, id;
}L[MAXN];

inline bool operator < (const lem &a, const lem &b) {
	if(a.m != b.m) return a.m > b.m;
	return a.v > b.v;
}

int N, K, H;

__inline double Time(int i, int j) {
	return double(j) * H / L[i].v;
}

void Init() {
	N = getint(); K = getint(); H = getint();
	Rep(i, 1, N) L[i].id = i;
	Rep(i, 1, N) L[i].m = getint();
	Rep(i, 1, N) L[i].v = getint();
	sort(L + 1, L + N + 1);
}

bool Check(double t) {
	int cnt = 0;
	Rep(i, 1, N)
		if(Time(i, K - cnt) <= t)
			if(++cnt == K)
				return true;
	return false;
}

int ans[MAXN];
void GetAns(double t) {
	int cnt = 0;
	Rep(i, 1, N)
		if(Time(i, K - cnt) <= t) {
			ans[++cnt] = L[i].id;
			if(cnt == K) break;
		}
	printf("%d", ans[K]);
	Til(i, K - 1, 1) printf(" %d", ans[i]);
	putchar('\n');
}

void Work() {
	int cnt = 128;
	double l = 0, r = 1e10;
	while(cnt--) {
		double m = (l + r) / 2;
		if(Check(m)) r = m;
		else l = m;
	}
	GetAns(r);
}

int main() {
	Init();
	Work();
	return 0;
}

/*
 * File:      main.cpp
 * Author:    Hrayr [HarHro94]
 * Problem:
 * IDE:       Visual C++ 2012
 */
#pragma comment(linker, "/STACK:67108864")
#define _CRT_SECURE_NO_WARNINGS
#include <functional>
#include <algorithm>
#include <iostream>
#include <sstream>
#include <fstream>
#include <cassert>
#include <iomanip>
#include <cstring>
#include <cstdio>
#include <string>
#include <vector>
#include <ctime>
#include <queue>
#include <stack>
#include <cmath>
#include <set>
#include <map>
using namespace std;

typedef long long LL;
typedef long double LD;
#define pb push_back
#define mp make_pair
#define all(v) (v).begin(), (v).end()
#define sz(v) (int)(v).size()

const LD eps = 1e-10;
const int N = 100007;
int n, k, h;
struct man
{
    int v, m, ind;
    bool operator < (const man &o) const
    {
        return m < o.m || (m == o.m && v < o.v);
    }
};
vector<man> a;
vector<int> v;

bool ok(LD t)
{
    vector<int> dp(n);
    if (v[0] * t > h - eps)
    {
        dp[0] = 1;
    }
    else
    {
        dp[0] = 0;
    }
    for (int i = 1; i < n; ++i)
    {
        dp[i] = dp[i - 1];
        if (dp[i] != k && v[i] * t > (dp[i - 1] + 1) * h - eps)
        {
            ++dp[i];
        }
    }
    return dp[n - 1] == k;
}

int main()
{
#ifdef harhro94
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    scanf("%d%d%d", &n, &k, &h);
    a.resize(n);
    v.resize(n);
    for (int i = 0; i < n; ++i)
    {
        scanf("%d", &a[i].m);
    }
    for (int i = 0; i < n; ++i)
    {
        scanf("%d", &a[i].v);
        a[i].ind = i + 1;
    }
    sort(all(a));
    for (int i = 0; i < n; ++i)
    {
        v[i] = a[i].v;
    }
    LD l = 0.0;
    LD r = 1e10;
    for (int iter = 0; iter < 300; ++iter)
    {
        LD m = (l + r) / 2.0;
        if (ok(m))
        {
            r = m;
        }
        else
        {
            l = m;
        }
    }
    LD t = l;
    //assert(ok(t));
    vector<int> dp(n);
    vector<int> ans;
    if (v[0] * t > h - 2 * eps)
    {
        ans.pb(a[0].ind);
        dp[0] = 1;
    }
    else
    {
        dp[0] = 0;
    }
    for (int i = 1; i < n; ++i)
    {
        dp[i] = dp[i - 1];
        if (dp[i] != k && v[i] * t > (dp[i - 1] + 1) * h - 2 * eps)
        {
            ans.pb(a[i].ind);
            ++dp[i];
        }
    }
    assert(sz(ans) == k);
    for (int it : ans)
    {
        printf("%d ", it);
    }
    puts("");

#ifdef harhro94
    cerr << fixed << setprecision(3) << "\nExecution time = " << clock() / 1000.0 << "s\n";
#endif
    return 0;
}

#pragma comment(linker, "/stack:64000000")
#define _CRT_SECURE_NO_DEPRECATE

#include <iostream>
#include <iomanip>
#include <sstream>
#include <fstream>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <climits>
#include <cstring>
#include <ctime>
#include <cmath>
#include <cassert>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <algorithm>
#include <utility>
#include <numeric>
#include <functional>

#define forn(i, n) for (int i = 0; i < int(n); i++)
#define forl(i, n) for (int i = 1; i <= int(n); i++)
#define ford(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define fore(i, l, r) for (int i = int(l); i <= int(r); i++)
#define correct(x, y, n, m) (0 <= (x) && (x) < (n) && 0 <= (y) && (y) < (m))
#define all(a) (a).begin(), (a).end()
#define sz(a) int((a).size())
#define pb(a) push_back(a)
#define mp(x, y) make_pair((x), (y))
#define ft first
#define sc second
#define X first
#define Y second

using namespace std;

typedef long long li;
typedef double ld;
typedef pair<int, int> pt;

template<typename X> inline X abs(const X& a) { return a < 0? -a: a; }
template<typename X> inline X sqr(const X& a) { return a * a; }

const int INF = int(1e9);
const li INF64 = li(1e18);
const ld EPS = 1e-9, PI = 3.1415926535897932384626433832795;

const int N = 100 * 1000 + 3;

int n, k, h;
pair<pt, int> a[N];

inline bool read()
{
	if (scanf("%d%d%d", &n, &k, &h) != 3)
		return false;

	forn(i, n)
		assert(scanf("%d", &a[i].ft.ft) == 1);

	forn(i, n)
		assert(scanf("%d", &a[i].ft.sc) == 1);

	forn(i, n)
		a[i].sc = i;

	return true;
}

inline bool check(ld mid, bool restore)
{
	int p = 0;
	vector<int> ans;

	forl(i, k)
	{
		while (p < n && ld(i) * h / a[p].ft.sc > mid)
			p++;

		if (p == n)
			return false;

		if (restore)
			ans.pb(a[p].sc);

		p++;
	}

	if (restore)
	{
    	assert(sz(ans) == k);

    	forn(i, sz(ans))
    	{
    		printf("%d", ans[i] + 1);

    		if (i + 1 < sz(ans))
    			putchar(' ');
    	}

    	puts("");
	}

	return true;
}

inline void solve()
{
	sort(a, a + n);

	ld lf = 0.0, rg = 1e18;

    int iter = 0;

	while (true)
	{
        iter++;

		ld mid = (lf + rg) / 2.0;

        //cerr << mid << " " << lf << " " << rg << endl;

        if (mid <= lf || mid >= rg)
            break;

		if (check(mid, false))
			rg = mid;
		else
			lf = mid;
	}

	cerr << rg << endl;
    cerr << iter << endl;

	assert(check(rg, true));
}

int main()
{
#ifndef ONLINE_JUDGE
    freopen("input.txt", "rt", stdin);
    freopen("output.txt", "wt", stdout);
#endif

    assert(read());
    solve();

    return 0;
}

#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <deque>
#include <bitset>

#define sqr(x) ((x) * (x))
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define y0 ywuerosdfhgjkls
#define y1 hdsfjkhgjlsdfhgsdf
#define j1 j924
#define j0 j2834
#define sqrt(x) (sqrt(abs(x)))
#define re return
#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 rrep(i, n) for (int i = ((n) - 1); i >= 0; i--)
#define fill(a, x) memset(a, x, sizeof(a))

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair <int, int> ii;
typedef vector <int> vi;
typedef vector <ii> vii;
typedef vector <vi> vvi;
typedef double D;
typedef vector <string> vs;

template <class T> inline T abs(T a) {
    return a > 0 ? a : -a;
}

int n;
int m;

pair <ii, int> a[100000];

int main() {
    int k, h;
    cin >> n >> k >> h;
    rep(i, n) {
        scanf("%d", &a[i].fi.fi);
    }
    rep(i, n) {
        scanf("%d", &a[i].fi.se);
        a[i].se = i;
    }
    sort(a, a + n);
    double l = 0.0, r = 2e9;
    vi ans;
    rep(I, 200) {
        double t = (l + r) / 2.0;
        int cur = k;
        vi govno;
        govno.clear();

        rrep(i, n) {
            if ((D)cur * (D)h < t * (D)a[i].fi.se) {
                cur--;
                govno.pb(a[i].se);
                if (cur == 0)
                    break;
            }
        }
        if (cur == 0) {
            r = t;
            ans = govno;
        } else
            l = t;
    }
    reverse(all(ans));
    rep(i, sz(ans))
        printf("%d ", ans[i] + 1);
    printf("\n");
    return 0;
}

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
using namespace std;
const int N=1000010;
struct data{
	int id,w,v;
}p[N];
int ans[N],n,k,h;
int check(double x){
	int t=1;
	for(int i=1;i<=n;i++)
		if(1.0*t*h<=p[i].v*x){
			ans[t++]=p[i].id;
			if(t>k) return 1;
		}
	return 0;
}
bool cmp(data a,data b){
	if(a.w==b.w) return a.v<b.v;
	return a.w<b.w;
}
int main(){
	scanf("%d%d%d",&n,&k,&h);
	for(int i=1;i<=n;i++) scanf("%d",&p[i].w);
	for(int i=1;i<=n;i++) scanf("%d",&p[i].v);
	for(int i=1;i<=n;i++) p[i].id=i;
	sort(p+1,p+1+n,cmp);
	double l=0.0,r=1000000000.0;
	for(int i=1;i<=100;i++){
		double mid=(l+r)/2.0;
		if(check(mid)) r=mid;
		else l=mid;
	}
	check(r);
	for(int i=1;i<=k;i++) printf("%d ",ans[i]);
	printf("\n");
}

#define _CRT_SECURE_NO_DEPRECATE

#pragma comment(linker,"/STACK:260108864")

#include <iostream>
#include <ctime>
#include <cstdio>
#include <memory>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <list>
#include <stack>
#include <string>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <ctime>
#include <utility>
#include <iterator>
#include <bitset>
#include <sstream>
#include <numeric>

#define pb push_back
#define mp make_pair
#define pii pair<int,int>
#define pdd pair<double,double>
#define LL long long
#define ULL unsigned LL
#define VI vector<int>
#define X first
#define Y second
#define sz(_v) ((int)_v.size())
#define all(_v) (_v).begin(),(_v).end()
#define FOR(i,a,b) for (int i(a); i<=(b); ++i)
#define rep(i,a) FOR(i,1,a)
#define rept(i,a) FOR(i,0,(int)(a)-1)
#define x1 X1
#define y1 Y1
#define sqr(a) ((a)*(a))
#define INF 2000000000
#define PI 3.141592653589
#define eps 0.00000001
#define MOD 1000000007
#define PRIME 1000003

using namespace std;

pair< pii, int > cs[100005];
int n,k,h;

bool can(double tm)
{
    int nowh(k*h);
    int it(n-1);
    while (it>=0 && nowh)
    {
        if (nowh<=tm*cs[it].X.Y || abs(nowh-tm*cs[it].X.Y)<eps)
        {
            nowh-=h;
        }
        --it;
    }
    if (nowh==0) return true;
    return false;
}

int main()
{
#ifndef ONLINE_JUDGE
    {
        freopen("input.txt","r",stdin);
        freopen("output.txt","w",stdout);
    }
#endif
    scanf("%d%d%d",&n,&k,&h);
    double GOOD(1000000010.),BAD(0.);
    rept(i,n) scanf("%d",&cs[i].X.X);
    rept(i,n) scanf("%d",&cs[i].X.Y);
    rept(i,n) cs[i].Y=i+1;
    sort(cs,cs+n);
    rept(smth,300)
    {
        double med=(GOOD+BAD)/2.;
        if (can(med)) GOOD=med;
        else BAD=med;
    }
    if (can(BAD)) GOOD=BAD;
    VI ans;
    int nowh(k*h);
    int it(n-1);
    while (it>=0 && nowh)
    {
        if (nowh<=GOOD*cs[it].X.Y || abs(nowh-GOOD*cs[it].X.Y)<eps)
        {
            nowh-=h;
            ans.pb(cs[it].Y);
        }
        --it;
    }
    rept(i,sz(ans))
    {
        if (i!=0) printf(" ");
        printf("%d",ans[sz(ans)-i-1]);
    }
    printf("\n");
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
typedef long double ld;
const int MAX=1e5+9;
struct rec{int w,v,id;}a[MAX];
ld l,r,mid;
int n,m,h,i,j;
bool cmp(rec a,rec b){return a.w<b.w||a.w==b.w&&a.v<b.v;}
int main()
{
	ios_base::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	cin>>n>>m>>h;
	for(i=1;i<=n;i++) cin>>a[i].w;
	for(i=1;i<=n;i++)
	{
		cin>>a[i].v;
		a[i].id=i,r=max(r,(ld)m*h*1.0/a[i].v);
	}
	r++,sort(a+1,a+n+1,cmp);
	for(int k=1;k<=200;k++)
	{
		mid=(l+r)/2;
		for(i=j=1;i<=m;i++)
		{
			for(;j<=n&&i*h*1.0/a[j].v>mid;j++);
			if(j>n) break;
			j++;
		}
		if(i<=m) l=mid; else r=mid;
	}
	for(i=j=1;i<=m;i++)
	{
		for(;j<=n && i*h*1.0/a[j].v>r+r-l;j++);
		cout<<a[j].id<<" ";
		j++;
	}
	return 0;
}

#include<cstdio>
#include<cmath>
#include<cstring>
#include<cstdlib>
#include<iostream>
#include<algorithm>
#include<string>
#include<map>
using namespace std;
typedef long long LL;
typedef unsigned long long ull;
const int inf = 0x3f3f3f3f;
const LL infll = 0x3f3f3f3f3f3f3f3f;
const LL mod = 1e9 + 7;
const double eps = 1e-8;
const double pi = acos(-1.0);
const int maxn = 1e5 + 5;
const int maxm = 1.5e7 + 5;
using namespace std;
struct node
{
	LL m, v;
	int index;
	bool operator < (node &tmp)
	{
		if (m == tmp.m) return v < tmp.v;
		else return m < tmp.m;
	}
}a[maxn];
LL time[maxn];
int ans[maxn];
int main()
{
	int n, k, h;
	cin >> n >> k >> h;
	for (int i = 1;i <= n;i++)
	{
		cin >> a[i].m;
		a[i].index = i;
	}
	for (int i = 1;i <= n;i++) cin >> a[i].v;
	sort(a + 1, a + 1 + n);
	double l = 0, r = 1e9;
	for (int j = 1;j <= 100;j++)
	{
		double mid = (l + r) / 2.0;
		for (int i = 1;i <= n;i++)
		{
			time[i] = mid * a[i].v / h;
		}
		LL temp = k;
		for (int i = n;i >= 1;i--)
		{
			if (time[i] >= temp) temp--;
		}
		if (temp <= 0)r = mid;
		else l = mid;
	}
	for (int i = 1;i <= n;i++)
	{
		time[i] = r * a[i].v / h;
	}
	LL temp = k;
	for (int i = n;i >= 1;i--)
	{
		if (time[i] >= temp)
		{
			ans[temp--] = a[i].index;
		}
		if (temp == 0)break;
	}
	for (int i = 1;i <= k;i++)
		cout << ans[i] << " ";
	cout << endl;
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
const int MX=(1<<18) , MOD = 1e9+7;
int n , K , H;
pair < pair < int , int > , int > arr[MX];
vector < int > sol;
bool check(long double  X){
  //  cout<<endl<<X<<endl;
    sol.clear();
    int cur = 1 ;
    long double  height = H;
    for(int j=1;j<=n;j++){
        if((long double ) (height / (arr[j].first.second+0.0) <= X)){
            height += H;
            cur++;
            sol.push_back(arr[j].second);
                    //        cout<<j<<' '<<cur<<' ';

            if(cur == K+1){
                return 1;
            }
        }

    }
    return 0;
}
int main(){
    scanf("%d %d %d",&n,&K,&H);
    for(int j=1;j<=n;j++) scanf("%d",&arr[j].first.first);
    for(int j=1;j<=n;j++){
        scanf("%d",&arr[j].first.second);
        arr[j].second = j;
    }
    sort(arr+1 , arr+1+n);
   // reverse(arr+1 , arr+1+n);
    long double  st = 0.0 , en = 4e9 , mid , best;
    for(int iter=1;iter<=200;iter++){
        mid = st + (en-st)/2.0;
        if(check(mid)){
            best = mid;
            en = mid;
        }
        else st = mid;
    }
    //cout<<st<<endl;
    check(best);
    for(auto pp : sol) cout<<pp<<' ';

}

#include<string>
#include<iostream>
#include<sstream>
#include<assert.h>
#include<cstdio>
#include<map>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<queue>
#include<functional>
#include<set>
#include<stack>
#include<cstdlib>
#include<cstring>
typedef long long int64;
#define long int64
#define var(q,s) typeof(s) q = s
#define for_each(q,s) for(var(q,(s).begin()); q!=(s).end(); q++)
using namespace std;

//=========================================================
// program:
//
/* lemmings*/ /*ledges*/ /*height factor*/
int n,k,h;
int m[100000];
int v[100000];

int ledge[100000];

pair< pair<int,int> ,int> byWeightVel[100000];

bool makeLedges(double t)
{
    int j = n-1;
    typedef pair<int,int> intint;
    //prority_queue is much faster than set
    priority_queue< intint, vector<intint>, less<intint> > lemmingWeight;

    for (int i=k-1; i>=0; i--) {
        ledge[i] = -1;
        while (j>=0) {
            int y= byWeightVel[j].second;
            int weight = m[y];
            int vel    = v[y];

            //maximum position we can place lemming i in.

            //pick max pos such that (pos+1)/vi <= t
            //                     (pos+1)    <= t * vi
            //                      pos       <= t * vi - 1
            int maxPos = (int)(min<double>(t * vel, k) ) - 1; //the min avoids overflow
            if (maxPos >= i) {
                ledge[i] = y;
                j--;
                break;
            } else {
                j--;
            }
        }
        if (ledge[i] < 0) {
            return false;
        }
    }
    return true;
}
/* height is useless */

void solve()
{
    for (int i=0; i<n; i++) {
        byWeightVel[i] = make_pair( make_pair(m[i],v[i]), i);
    }
    sort(byWeightVel, byWeightVel + n);
    /*for (int i=0; i<n; i++) {
        cout<<"("<<byWeightVel[i].first.first<<", "<<byWeightVel[i].first.second<<")";
    }cout<<endl;*/

    double hi = 100001.0, lo = 0;
    // { possible(hi) }
    // { impossible(lo) }
    for (int iter=0; iter<80; iter++) {
        double t = (hi+lo) / 2;
        if (makeLedges(t)) {
            hi = t;
        } else {
            lo = t;
        }

    }
    makeLedges(hi);
    for (int i=0; i<k; i++) {
        cout << (i?" ":"") << (ledge[i]+1);
    }
    cout << endl;

}

inline void init(){}
//=========================================================
// I/O:
//
int main()
{
    init();

    bool prev = false;
    while( cin >> n >> k >> h ) {
        if (prev) {
            cout << endl;
        }
        prev = true;
        for (int i=0; i<n; i++) {
            cin >> m[i];
        }
        for (int j=0; j<n; j++) {
            cin >> v[j];
        }
        solve();

    }
    return 0;
}

#include <iostream>
#include <cstdio>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <queue>
#include <bitset>
#include <stack>
#include <algorithm>
#pragma comment (linker, "/STACK:256000000")

using namespace std;

const int maxN = 110000;
int n, k, h;
int m[maxN], v[maxN], order[maxN];
int ans[maxN];

bool comp(int x, int y) {
	return make_pair(m[x], v[x]) < make_pair(m[y], v[y]);
}

bool check(double t) {
	int m = k;
	int bans[maxN];
	for (int i = n; i >= 1 && m != 0; --i)
		if ((double)(m * h) <= (double)(v[order[i]]) * t) {
			bans[m] = order[i];
			--m;
		}

	if (m == 0) {
		for (int i = 1; i <= k; ++i)
			ans[i] = bans[i];
	}
	return m == 0;
}

int main() {
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);

	scanf("%d%d%d", &n, &k, &h);
	for (int i = 1; i <= n; ++i)
		scanf("%d", &m[i]), order[i] = i;
	for (int i = 1; i <= n; ++i)
		scanf("%d", &v[i]);

	sort(order + 1, order + n + 1, comp);
	double l = 0.0, r = 1e10;
	int iters = 200;
	while (iters) {
		double key = (l + r) / 2.0;
		if (check(key))
			r = key; else l = key;
		--iters;
	}

	for (int i = 1; i <= k; ++i)
		printf("%d ", ans[i]);
	printf("\n");

	return 0;
}

#include<string>
#include<iostream>
#include<sstream>
#include<assert.h>
#include<cstdio>
#include<map>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<queue>
#include<functional>
#include<set>
#include<stack>
#include<cstdlib>
#include<cstring>
typedef long long int64;
#define long int64
#define var(q,s) typeof(s) q = s
#define for_each(q,s) for(var(q,(s).begin()); q!=(s).end(); q++)
using namespace std;

//=========================================================
// program:
//
/* lemmings*/ /*ledges*/ /*height factor*/
int n,k,h;
int m[100000];
int v[100000];

int ledge[100000];

pair< pair<int,int> ,int> byVelWeight[100000];

bool makeLedges(double t, bool deb = false)
{
    if (deb) {
        fill(ledge, ledge+k, -2);
        cerr<<"::"<<t<<endl;
    }
    int j = n-1;
    typedef pair<int,int> intint;
    priority_queue< intint, vector<intint>, less<intint> > lemmingWeight;
    int mostWeight = 2000000000;

    for (int i=k-1; i>=0; i--) {
        while (j>=0) {
            int y= byVelWeight[j].second;
            int weight = m[y];
            int vel    = v[y];

            //maximum position we can place lemming i in.

            //pick max pos such that (pos+1)/vi <= t
            //                     (pos+1)    <= t * vi
            //                      pos       <= t * vi - 1
            int maxPos = (int)(min<double>(t * vel, k) ) - 1;
            if (maxPos < i) {
                break;
            } else {
                if ( weight <= mostWeight ) {
                    lemmingWeight.push( make_pair(weight, y ) );
                }
                j--;
            }
        }
        if (lemmingWeight.empty()) {
            return false;
        } else {
            intint it = lemmingWeight.top();
            mostWeight = it.first;
            ledge[i] = it.second;
            lemmingWeight.pop();
        }
    }
    return true;
}
/* height is useless */

void solve()
{
    for (int i=0; i<n; i++) {
        byVelWeight[i] = make_pair(make_pair(v[i], m[i]), i);
    }
    sort(byVelWeight, byVelWeight + n);
    double hi = 100001.0, lo = 0;
    // { possible(hi) }
    // { impossible(lo) }
    for (int iter=0; iter<80; iter++) {
        double t = (hi+lo) / 2;
        if (makeLedges(t)) {
            hi = t;
        } else {
            lo = t;
        }

    }
    makeLedges(hi, true);
    for (int i=0; i<k; i++) {
        if (ledge[i]==-2) {
            cout<<hi<<endl;
        } else {
            cout << (i?" ":"") << (ledge[i]+1);
        }
    }
    cout << endl;

}

inline void init(){}
//=========================================================
// I/O:
//
int main()
{
    init();

    bool prev = false;
    while( cin >> n >> k >> h ) {
        if (prev) {
            cout << endl;
        }
        prev = true;
        for (int i=0; i<n; i++) {
            cin >> m[i];
        }
        for (int j=0; j<n; j++) {
            cin >> v[j];
        }
        solve();

    }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e6;
pair<pair<int,int>,int>p[maxn];
int ans[maxn];
int n,k,h;
int check(double x)
{
    int tot = 1;
    for(int i=1;i<=n;i++)
    {
        if(1.0*tot*h<=p[i].first.second*x)
        {
            ans[tot]=p[i].second;
            tot++;
            if(tot>k)return 1;
        }
    }
    return 0;
}
int main()
{
    scanf("%d%d%d",&n,&k,&h);
    for(int i=1;i<=n;i++)
        scanf("%d",&p[i].first.first);
    for(int i=1;i<=n;i++)
        scanf("%d",&p[i].first.second);
    for(int i=1;i<=n;i++)
        p[i].second=i;
    sort(p+1,p+1+n);
    double l = 0.0,r = 1000000000.0;
    for(int i=1;i<=100;i++)
    {
        double mid = (l+r)/2.0;
        if(check(mid))r=mid;
        else l=mid;
    }
    check(r);
    for(int i=1;i<=k;i++)
        printf("%d ",ans[i]);
    printf("\n");
}

#include <iostream>
#include <algorithm>
using namespace std;
const int N = 100*1000+10;
int s=0;
int n, m, k;
int ans[N];
pair<int, pair<int, int> > p[N];
bool check(double mid)
{
    for(int i=0; i<n; i++){
        double q1=s, q2=k, q3=p[i].second.first;
        if(q1*q2/q3 <= mid){
            ans[s] = p[i].second.second+1;
            s++;
        }
        if(s==m+1)return true;
    }
    return false;
}
main()
{
    cin >> n >> m >> k;
    for(int i=0; i<n; i++){
        cin >> p[i].first;
    }
    for(int i=0; i<n;i++){
        cin >> p[i].second.first;
        p[i].second.second = i;
    }
    sort(p,p+n);
    double l = 0, r = 1e9, mid;
    for(int i=0; i<200; i++){
        s = 1;
        mid = (r+l)/2;
        if(check(mid))r = mid;
        else l = mid;
    }
    s = 1;

    check(r);
    for(int i=1; i<=m; i++){
        cout << ans[i] << " ";
    }
}

/*
ID: lxc9021
PROG: hamming
LANG: C++
*/
/** @author starLeo
 *  Standard C++ Header File For Contests
 */
#include <iostream>
#include <fstream>
//#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <utility> //pair
#include <map>
//#include <set>
#include <list>
#include <deque>
#include <queue>
#include <stack>
#include <cctype>
#include <cstring>
//#include <malloc.h>
using namespace std;
#define R(x) scanf("%d",&(x)) //read int
#define RS(x) scanf("%s",(x)) //read string
#define PL(x) printf("%d\n",(x)) //println int
#define REP(i,n) for(int i(0),_n(n);i<_n;++i)
#define FOR(i,l,h) for(int i(l),_h(h);i<=_h;++i)
#define FORD(i,h,l) for(int i(h),_l(l);i>=_l;--i)
#define RESET(a,b) memset((a),b,sizeof(a))
#define DEBUG(exp) (cout<<(#exp)<<" = "<<(exp)<<endl)
//#define oo (1234567890LL) // 64bits
#define oo (1<<29) // 32bits
//#define oo 9999999999.0 // Double
#define eps 1e-10
typedef long long Int;
typedef pair<int,int> pii;
typedef pair<long double,long double> pdd;

#define M ( 100000+10 )
struct Lem {
    int m,v,id;
    bool operator < (Lem b) const {
        return m<b.m || (m==b.m && v<b.v);
    }
};

int n,k,h;
Lem a[M];

bool can(long double t)
{
    int j=k;
    FORD(i,n-1,0) {
        if( j>0 && (long double)j*h/a[i].v - t <= -eps ) j--;
    }
    return j==0;
}
void putAns(long double t)
{
    int ans[M];
    int j=k;
    FORD(i,n-1,0) {
        if( j>0 && (long double)j*h/a[i].v - t <= -eps ) ans[--j]=a[i].id;
    }
    REP(i,k-1) printf("%d ",ans[i]);
    PL(ans[k-1]);
}
int main()
{
#ifndef MyComputer
//    freopen("hamming.in","r",stdin);
//    freopen("hamming.out","w",stdout);
#endif

    R(n),R(k),R(h);
    REP(i,n) R(a[i].m),a[i].id=i+1;
    REP(i,n) R(a[i].v);
    sort(a,a+n);

    long double l=1e-10, r=1e10;
    int cnt=100;
    while(cnt--) {
        long double mid=(l+r)/2.0;
        if( can(mid) ) r=mid;
        else l=mid;
    }
    putAns(r);

    return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string.h>
#include <limits.h>
#include <cfloat>
#include <stack>
#include <queue>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <cassert>
#include <unordered_map>
#include <unordered_set>
#include <functional>
#include <type_traits>
using namespace std;
#define mem(flag) memset(flag,0,sizeof(flag))
#define Mem(flag) memset(flag,-1,sizeof(flag))
#define En printf("\n")
#define P(a) printf("%d ",a)
#define read(a) scanf("%d", &a)
#define readll(a) scanf("%lld", &a)
#define reads(s) scanf("%s", s)
#define Pn(a) printf("%d\n",a)
#define dbg(x) cout << (#x) << " = " << (x) << endl
#define rep(flag, a, b) for (int flag = (a); flag <= (b); ++flag)
#define Rep(flag, a, b) for (int flag = (a); flag >= (b); --flag)

const int MAX = 1e5 + 20;
typedef long double ld;
ld eps = 1e-17;

inline bool eq(ld a, ld b) { return abs(a - b) < eps; }
inline bool ls(ld a, ld b) { return a <= b - eps; }
inline bool gt(ld a, ld b) { return a >= b + eps; }
inline bool le(ld a, ld b) { return a < b + eps; }
inline bool ge(ld a, ld b) { return a > b - eps; }
inline bool zr(ld lhs) { return fabs(lhs) < eps; }
inline bool nz(ld lhs) { return fabs(lhs) >= eps; }
inline bool ps(ld lhs) { return lhs >= eps; }
inline bool nn(ld lhs) { return lhs >= -eps; }
inline bool ng(ld lhs) { return lhs < -eps; }
inline bool np(ld lhs) { return lhs < eps; }

struct lem {
    int w, v, idx;
    lem(int a = 0, int b = 0) : w(a), v(b) {}
};

lem lems[MAX];
int n, k, h;

int main() {
    scanf("%d%d%d", &n, &k, &h);
    rep (i, 1, n) {
        scanf("%d", &lems[i].w);
    }
    rep (i, 1, n) {
        scanf("%d", &lems[i].v);
        lems[i].idx = i;
    }
    sort(lems + 1, lems + n + 1, [] (const lem &a, const lem b) {
         if (a.w != b.w) return a.w < b.w;
         else return a.v < b.v;
         });
    ld l = 0, r = 1e9;
    int cnt = 100;
    while (cnt--) {
        ld t = (r + l) / 2;
        int fh = 1, sid = 1;
        while (fh <= k && sid <= n) {
            if (fh <= t * lems[sid].v / h) {
                ++sid, ++fh;
            } else ++sid;
        }
        if (fh == k + 1) r = t;
        else l = t;
    }
    int fh = 1, sid = 1;
    vector<int> ans;
    while (fh <= k && sid <= n) {
        if (fh <= lems[sid].v * r / h) {
            ans.push_back(lems[sid].idx);
            ++sid, ++fh;
        } else ++sid;
    }
    rep (i, 0, (int)ans.size() - 1) {
        P(ans[i]);
    }
    En;

    return 0;
}

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cstring>
#include <string>
#include <cmath>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <sstream>
#define fr(a,b,c) for (int a=b;a<=c;a++)
#define frr(a,b,c) for (int a=b;a>=c;a--)
#define rep(a,b) for (int a=0;a<b;a++)
#define repp(a,b) for (int a=b-1;a>=0;a--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(a) int(a.size())
#define all(a) a.begin(),a.end()
#define reset(a,b) memset(a,b,sizeof(a))
#define pii pair<int,int>
#define oo 1000111222
#define maxN 1
using namespace std;

int n,k,h,which[100100];
pair <pair<int,int>,int> a[100100];

int possible(double t,int k)
{
	int kk=1;
	rep(i,n)
		if (t-1.0*kk*h/a[i].fi.se>-1e-9)
		{
			which[kk++]=a[i].se;
			if (k<kk) return 1;
		}
	return 0;
}

int main()
{
	cin >> n >> k >> h;
	rep(i,n) cin >> a[i].fi.fi;
	rep(i,n) cin >> a[i].fi.se;
	rep(i,n) a[i].se=i+1;
	sort(a,a+n);

	double low=0,high=1e9,ans=0;
	rep(i,200)
	{
		double mid=(low+high)/2;
		if (possible(mid,k)) ans=mid, high=mid;
		else low=mid;
	}
	possible(ans,k);
	fr(i,1,k) cout << which[i] << ' ';
}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstdlib>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <fstream>
#include <set>
#include <map>
#include <cmath>
#pragma comment(linker,"/STACK:16777216")
#define inf 1000000000
#define MP make_pair
#define PI acos(-1.0)
#define eps 1e-6
using namespace std;
typedef long long i64;
typedef unsigned long long u64;
struct lemme{
    int v,m,idx;
};
const int sz=100100;
lemme A[sz];
int ans[sz],n,k,h;

int f(lemme a,lemme b){
    if(a.m!=b.m)return a.m<b.m;
    else return a.v<b.v;
}

int main()
{

    scanf("%d%d%d",&n,&k,&h);

    for(int i=1;i<=n;i++){scanf("%d",&A[i].m);A[i].idx=i;}
    for(int i=1;i<=n;i++)scanf("%d",&A[i].v);

    double l,r,t;
    l=0; r=inf;

    sort(A+1,A+(n+1),f);

    int cur;

    for(int it=1;it<=100;it++){
        t=(l+r)/2.0;

        cur=1;

        for(int i=1;i<=n&&cur<=k;i++)
            if((1.0*cur*h/A[i].v)<=t)cur++;

        if(cur==k+1)r=t;
        else l=t;
    }

    cur=1;
    t=r;

    for(int i=1;i<=n&&cur<=k;i++)
        if((1.0*cur*h/A[i].v)<=t){
            ans[cur]=A[i].idx;
            cur++;
        }
    printf("%d",ans[1]);
    for(int i=2;i<=k;i++)printf(" %d",ans[i]);
    printf("\n");

    return 0;
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>

using namespace std;

#define pb push_back
#define mp make_pair

#define ALL(x) (x).begin(),(x).end()
#define CLR(a,b) memset(a,b,sizeof(a))
#define REPN(x,a,b) for (int x=a; x<b;++x)
#define REP(x,b) REPN(x, 0, b)

#define dbg(x) cout << #x << " = " << x << endl;
#define dbg2(x, y) cout << #x << " = " << x << "  " << #y << " = " << y << endl;
#define dbg3(x, y, z) cout << #x << " = " << x << "  " << #y << " = " << y << "  " << #z << " = " << z << endl;
#define dbg4(x, y, z, w) cout << #x << " = " << x << "  " << #y << " = " << y << "  " << #z << " = " << z << "  " << #w << " = " << w <<  endl;

#define MAX 100005

#define F first
#define S second

typedef long double ld;

int m[MAX], v[MAX], selected[MAX];
vector < pair < pair <int, int>, int > > V;
int k, n, h;

bool check(ld time) {
    ld pos = 1.0;
    int id = 0;
    for (int i = 0; i < n; i++) {
        if (V[i].F.S*1.0 * time >= pos * h) {
            selected[id++] = V[i].S;
            pos += 1.0;
        }
    }
    return (id >= k);
}

int main() {
    V.clear();
    cin >> n >> k >> h;
    REP(i, n) cin >> m[i];
    REP(i, n) cin >> v[i];
    REP(i, n) V.pb(mp(mp(m[i], v[i]), i));

    sort(ALL(V));

    ld l = 0, r = 1000000009, mid;
    for (int i = 0; i < 200; i++) {
        mid = (l+r)*0.5;
        if (check(mid)) r = mid;
        else l = mid;
    }

	check(r);

    REP(i, k) {
        if (i != 0) cout << " ";
        cout << selected[i]+1;
    }
    cout << endl;

    return 0;
}

#include <iostream>
#include <fstream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <vector>
#include <cmath>
#include <map>
using namespace std;
const double eps = 0.0000000001;
long int i, n, p, mi;
double h, k;
struct mvnum
{
    double m, v;
    long num;
};

double t, l, r;
vector <mvnum> a;
vector <long> b;
bool cmp(mvnum a1, mvnum b1)
{
    return(a1.m < b1.m) || (a1.m == b1.m && a1.v < b1.v) ||
          (a1.m == b1.m && a1.v == b1.v && a1.num < b1.num);
}
bool ok1(double mi)
{
    double k1 = 1;
    for(long j = 0; j < n; j++)
    {
        if((k1 * h / a[j].v - mi) < eps)
        {
            k1 += 1;
        }
        if(k1 > k) return true;
    }
    return false;
}

int main()
{
    //freopen("input.txt", "r", stdin);
    scanf("%ld %lf %lf", &n, &k, &h);
    a.resize(n);
    for(i = 0; i < n; i++)
    {
        scanf("%lf", &a[i].m);
    }
    for(i = 0; i < n; i++)
    {
        scanf("%lf", &a[i].v);
        a[i].num = i;
    }
    sort(a.begin(), a.end(), cmp);
    l = 0;
    r = h * k + 1;
    for(i = 0; i < 100; i++)
    {
        if(ok1((l + r) / 2))r = (l + r) / 2;
        else l = (l + r) / 2;
    }
    t = r;
    double k1 = 1;
    for(i = 0; i < n; i++)
    {
        if((k1 * h / a[i].v - t) < eps)
        {
            b.push_back(a[i].num);
            k1 += 1;
        }
        if(k1 > k) break;
    }
    for (int i = 0; i < k; i++)
    {
        printf("%ld ", b[i] + 1);
    }
    return 0;
}

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cstring>
#include <string>
#include <cmath>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <sstream>
#define fr(a,b,c) for (int a=b;a<=c;a++)
#define frr(a,b,c) for (int a=b;a>=c;a--)
#define rep(a,b) for (int a=0;a<b;a++)
#define repp(a,b) for (int a=b-1;a>=0;a--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(a) int(a.size())
#define all(a) a.begin(),a.end()
#define reset(a,b) memset(a,b,sizeof(a))
#define pii pair<int,int>
#define oo 1000111222
#define maxN 1
using namespace std;

int n,k,h,which[100100];
pair <pair<int,int>,int> a[100100];

int possible(double t,int k)
{
	int kk=1;
	rep(i,n)
		if (t>=1.0*kk*h/a[i].fi.se)
		{
			which[kk++]=a[i].se;
			if (k<kk) return 1;
		}
	return 0;
}

int main()
{
	cin >> n >> k >> h;
	rep(i,n) cin >> a[i].fi.fi;
	rep(i,n) cin >> a[i].fi.se;
	rep(i,n) a[i].se=i+1;
	sort(a,a+n);

	double low=0,high=1e9,ans=0;
	rep(i,200)
	{
		double mid=(low+high)/2;
		if (possible(mid,k)) ans=mid, high=mid;
		else low=mid;
	}
	possible(ans,k);
	fr(i,1,k) cout << which[i] << ' ';
}

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

const int MAXN = 1e5 + 6.66;
struct Lemming {
  int m;
  int v;
  int I;
} lemms[MAXN];
int prv[MAXN];

pair<int,int> generate_ans(int n, int h, long double t) {
  memset(prv, -1, sizeof prv);
  int last = -1;
  int cnt = 0;
  for(int i = 0; i < n; i++) {
    long double lp = 1.l * t * lemms[i].v / h;
    if(lp >= 1 + cnt) {
      prv[i] = last;
      last = i;
      cnt ++;
    }
  }
  return {last, cnt};
}

int main() {
  int n, k, h;
  scanf("%d %d %d", &n, &k, &h);
  for(int i = 0; i < n; i++) scanf("%d", &lemms[i].m);
  for(int i = 0; i < n; i++) scanf("%d", &lemms[i].v);
  for(int i = 0; i < n; i++) lemms[i].I = i + 1;
  sort(lemms,lemms + n, [] (Lemming a, Lemming b) -> bool
      { return a.m == b.m ? a.v < b.v : a.m < b.m; });
  long double l = 0, r = 1e9 + 9;
  for(int i = 0; i < 200; i++) {
    long double mid = l + (r - l) / 2;
    if(k <= generate_ans(n, h, mid).second) r = mid;
    else l = mid;
  }
  int st = generate_ans(n, h, r).first;
  vector<int> vvs;
  while(~st) {
    vvs.push_back(st);
    st = prv[st];
  }
  reverse(vvs.begin(), vvs.end());
  int I = 0;
  for(auto i : vvs)
    if(I < k) printf("%d ", lemms[i].I);
    else break;
  printf("\n");
  return 0;
}

#include <bits/stdc++.h>

using namespace std;

typedef double ld;
typedef pair<ld , ld> ii;
typedef pair< ii , ld> pii;

const int N = 1e5+10 , K = 1e5+10;

pii a[N];
int ans[K] , ans1[K];
int n , k;
int h;

bool check( long double t ){
    int now = 1;
    for(int i=0 ; i<n ; i++) ans1[i] = 1e12;
    for(int i=0 ; i<n ; i++){
        if( now * h <= t * a[i].first.second ){
            ans1[now-1] =  a[i].second;
            now ++;
            if(now > k)
                break;
        }

    }
    if(now > k){
        for(int i=0 ; i<k ; i++)
            ans[i] = ans1[i];
        return true;
    }else
        return false;
}

int main(){
    ios_base::sync_with_stdio( false );cin.tie( 0 );cout.tie( 0 );
    cin >> n >> k >> h;
    for(int i=0 ; i<n ; i++){
        cin >> a[i].first.first;
        a[i].second = i+1;
    }
    for(int i=0 ; i<n ; i++)
        cin >> a[i].first.second;
    sort( a , a+n );
    long double l = 0 , r = 1e10;
    for(int test = 0 ; test < 100 ; test++){
        long double mid = (l + r) / 2;
        if( check( mid ) )
            r = mid;
        else
            l = mid;
    }
    for(int i=0 ; i<k ; i++)
        cout << ans[i] << " ";
    cout << endl;
}

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;
struct N
{
	int m,v,r;
	bool operator<(const N& b)const
	{
		return m==b.m?v<b.v:m<b.m;
	}
};
N a[100010];
bool check(int n,int k,int h,double T,bool P=0)
{
	int re=0;
	for(int i=0;i<n;i++)
	{
		if((double)(re+1)*h<=a[i].v*T)
		{
			re++;
			if(P)
				 ;
			if(re>=k)
				break;
		}
	}
	return re>=k;
}
int main()
{
	int n,k,h;
	scanf("%d %d %d",&n,&k,&h);
	for(int i=0;i<n;i++)
		scanf("%d",&a[i].m);
	for(int i=0;i<n;i++)
		scanf("%d",&a[i].v);
	for(int i=0;i<n;i++)
		a[i].r=i+1;
	sort(a,a+n);
	double l=0;
	double r=1e10;
	int tim=200;
	while(tim--)
	{
		double mid=(l+r)/2.0;
		if(check(n,k,h,mid))
			r=mid;
		else
			l=mid;
	}
	int re=0;
	for(int i=0;i<n;i++)
	{
		if((double)(re+1)*h<=a[i].v*r)
		{
			re++;
			printf("%d ",a[i].r);
			if(re>=k)
				break;
		}
	}
	return 0;
}

#include <iostream>
#include <algorithm>

using namespace std;

const int MAXN = 1e5 + 10;

pair <pair<int, int>, int> lem[MAXN];
int n, k, h, ans[MAXN];

bool check(double t) {
	int kk = 0;
	for(int i = 0; i < n; ++i) {
		int v = lem[i].first.second;
		if (double((kk + 1) * h) <= t * v)
			ans[kk++] = lem[i].second;
		if (kk >= k)
			return true;
	}
	return false;
}

int main(){
	cin >> n >> k >> h;
	for (int i = 0; i < n; ++i) {
		cin >> lem[i].first.first;
		lem[i].second = i;
	}
	for(int i = 0; i < n; ++i)
		cin >> lem[i].first.second;
	sort(lem, lem + n);
	double l = 0, r = 1e9;
	for (int i = 0; i < 400; ++i) {
		double mid = (r + l) / 2;
		if (check(mid))
			r = mid;
		else
			l = mid;
	}
	if(check(r)) {
		for (int i = 0; i < k; ++i)
			cout << ans[i] + 1 << ' ';
	}
	return 0;
}

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <climits>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <string>
#include <set>
#include <map>
#include <numeric>
#include <functional>
#define rep(i,n) for(int i=0;i<(n);++i)
#define foreach(i,v) for(__typeof(v.begin()) i=v.begin();i!=v.end();++i)
#define ass(v) (v)||++*(int*)0;
using namespace std;
typedef pair<int,int> PII;
typedef vector<PII> VPII;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<double> VD;
int n,m,h;
struct info
{
	int m,v,i;
	info(int _m=0,int _v=0,int _i=0):m(_m),v(_v),i(_i) {}
	bool operator<(const info &o) const
	{
		if(m<o.m) return true;
		if(m>o.m) return false;
		return v<o.v;
	}
};
vector<info> all;
VI ans;
bool check(long double t)
{
	for(int i=0,j=0;i<m;++i)
	{
		bool ok=false;
		while(j<n)
		{
			if((long double)(i+1.0)<t*all[j].v)
			{
				ans[i]=all[j].i;
				++j;
				ok=true;
				break;
			}
			else
			{
				++j;
			}
		}
		if(!ok) return false;
	}
	return true;
}
int main()
{
	scanf("%d%d%d",&n,&m,&h);
	all.resize(n);
	ans.resize(m);
	rep(i,n)
	{
		scanf("%d",&all[i].m);
		all[i].i=i;
	}
	rep(i,n)
	{
		scanf("%d",&all[i].v);
	}
	sort(all.begin(),all.end());
	long double st=0.0,ed=m+1;
	rep(i,200)
	{
		long double md=(st+ed)/2.0;
		if(check(md)) ed=md; else st=md;
	}
	ass(check(ed));
	//printf("st=%lf ed=%lf\n",st,ed);
	rep(i,m)
	{
		printf("%d",ans[i]+1);
		if(i<n-1) putchar(' '); else puts("");
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll read() {
	ll x=0, f=1; char ch=' ';
	while(!isdigit(ch)) {ch=getchar(); if(ch=='-') f=-1;}
	while(isdigit(ch)) x=(x<<3)+(x<<1)+(ch^48), ch=getchar();
	return x*f;
}
int n, k, h, ans[100005], cnt;
long double eps=1e-18;
struct AB{
	int id, m, v;
	bool operator < (const AB &A) const{
		if(m!=A.m) return m<A.m;
		return v<A.v;
	}
}a[100005];
bool check(long double mid) {
	int now=1;
	memset(ans, 0, sizeof(ans));
	for(int i=1;i<=n;i++) {
		if((long double)now*h<=(mid+eps)*(long double)a[i].v) ans[now++]=i;
	}
	return now>k;
}
int main() {
	cin>>n>>k>>h;
	for(int i=1;i<=n;i++) a[i].id=i;
	for(int i=1;i<=n;i++) a[i].m=read();
	for(int i=1;i<=n;i++) a[i].v=read();
	sort(a+1, a+n+1);
	long double l=0, r=k*h, mid;
	while(l<=r-eps&&++cnt<=1000) {
		mid=(l+r)/2;
		if(check(mid)) r=mid;
		else l=mid;
	}
	//cout<<r<<endl;
	check(r);
	for(int i=1;i<=k;i++) printf("%d ", a[ans[i]].id);
}

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

typedef long long ll;
typedef long double ld;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1e5 + 100;
const int LOG = 20;
int n, k;
ll h;

ld m[maxn], v[maxn];
vector<vector<ld>> a;

vector<int> make(ld t) {
  vector<int> ans;
  int j=n-1;
  for (ll i=k; i>=1 && j>=0; i--) {

    while (j>=0 && 1.0*i*h > 1.0*a[j][1]*t) j--;
    if (j>=0) {
      ans.push_back(a[j][2]);
      j--;
    }
  }

  reverse(ans.begin(), ans.end());
  return ans;
}

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);
  cin>>n>>k>>h;
  for (int i=0; i<n; i++) {
    cin>>m[i];
  }
  for (int i=0; i<n; i++) {
    cin>>v[i];
  }

  for (int i=0; i<n; i++) {
    a.push_back({m[i],v[i],i+1});
  }
  sort(a.begin(), a.end());

  ld lo = 0; ld hi = 1e10; //hi>=1e15 gets fucked
  for (int iters=0; iters<100; iters++) {
    ld mid = (hi+lo)/2;
    vector<int> res = make(mid);
    if ((int)res.size() == k) {
      hi = mid;
    } else {
      lo = mid;
    }
  }

  vector<int> ans = make(hi);
  assert((int)ans.size() == k);
  for (int i: ans) cout<<i<<" ";
  cout<<endl;

  return 0;
}

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
using namespace std;

typedef long long ll;

const int INF = (int)1e9;
const ll MOD = (ll)1e9 + 7ll;
const int maxN = 100500;
#define task "a"
#define fi first
#define se second
pair<int,int> A[maxN];
int p[maxN];

bool cmp(int a, int b) {
    return (A[a] < A[b]);
}

int n, k, h;
vector<int> res;
bool f(double t) {
    vector<int> ans;
    for (int i = 0; i < n; i++) {
        int j = p[i];
        if (A[j].se * t >= h * (1.0 + (double)ans.size())) {
            ans.push_back(j + 1);
        }
        if (ans.size() == k) {
            res = ans;
            return true;
        }
    }
    return false;
}

int main() {
    //freopen(task".in", "r", stdin);
    //freopen(task".out", "w", stdout);
    cin >> n >> k >> h;
    for (int i = 0; i < n; i++) {
        cin >> A[i].fi;
        p[i] = i;
    }
    for (int i = 0; i < n; i++) {
        cin >> A[i].se;
        p[i] = i;
    }
    sort(p, p + n, cmp);
    double l = 0, r = 1e14;
    for (int i = 0; i < 200; i++) {
        double m = (r + l) / 2.0;
        if (f(m)) {
            r = m;
        } else {
            l = m;
        }
    }
    f(r);
    for (int i = 0; i < k; i++) {
        cout << res[i] << " ";
    }
    cout << endl;
    return 0;
}

#include <cstdio>
#include <algorithm>
#define N 102400
int M[N], V[N], R[N], T = 100, n, k, h, t[N], a[N], i, j;
bool cp(int a, int b) { return M[a] > M[b] || M[a] == M[b] && V[a] > V[b]; }
int main() {
  for (scanf("%d%d%d", &n, &k, &h); i < n; ++i) scanf("%d", M + i), R[i] = i;
  for (i = 0; i < n; ++i) scanf("%d", V + i);
  std::sort(R, R + n, cp);
  for (double l = 0, r = 2e9, m; T--;) {
    m = (l + r) * 0.5;
    for (i = k, j = 0; i; t[--i] = R[j++]) {
      for (; j < n && V[R[j]] * m - i * h < -1e-9; ++j)
        ;
      if (j >= n) break;
    }
    if (i)
      l = m;
    else {
      r = m;
      for (i = 0; i < k; ++i) a[i] = t[i];
    }
  }
  for (i = 0; i < k; ++i) printf("%d ", a[i] + 1);
  return 0;
}

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

struct Fraction {
  long long n;  // numerator.
  long long d;  // denominator.

  Fraction(long long num, long long den) : n(num), d(den) {
    const long long g = __gcd(num, den);
    n /= g;
    d /= g;
  }

  bool operator<(const Fraction& f) const {
    return n * f.d < f.n * d;
  }

  bool operator<=(const Fraction& f) const {
    return n * f.d <= f.n * d;
  }

  bool operator>(const Fraction& f) const {
    return n * f.d > f.n * d;
  }

  bool operator>=(const Fraction& f) const {
    return n * f.d >= f.n * d;
  }

  bool operator==(const Fraction& f) const {
    return n == f.n && d == f.d;
  }

  bool operator!=(const Fraction& f) const {
    return n != f.n || d != f.d;
  }
};

struct Lemming {
  long long w;
  long long v;
  int index;
};

// Is it possible to distribute the lemmings over the ledges
// in <= t seconds.
// Complexity: O(N * log(N))
// If possible, lemmings_weights will contain the ideal configuration.
bool possible(const vector<Lemming>& lemmings,
              long long K, long long H, double t,
              vector<int>& config) {
  const int N = lemmings.size();
  long long num_placed = 0;
  for (int i = 0; i < N; ++i) {
    if ((num_placed + 1) * H <= t * lemmings[i].v) {
      config[num_placed] = lemmings[i].index;
      ++num_placed;
      if (num_placed == K) {
        return true;
      }
    }
  }
  return false;
}

int main() {
  long long N, K, H;
  cin >> N >> K >> H;
  vector<Lemming> lemmings(N);
  for (int i = 0; i < N; ++i) {
    cin >> lemmings[i].w;
    lemmings[i].index = i + 1;  // 1-based indexing.
  }
  for (int i = 0; i < N; ++i) {
    cin >> lemmings[i].v;
  }

  sort(lemmings.begin(), lemmings.end(), [] (const Lemming& a, const Lemming& b) {
    if (a.w != b.w) {
      return a.w < b.w;
    } else {
      return a.v < b.v;
    }
  });

  // // Binary search over Stern-Brocot tree to find smallest
  // // time (as a rational number) for which it's possible.
  // Fraction lo(0, 1);
  // Fraction hi(1, 0);
  // vector<int> lemmings_config_indices(K);
  // while (lo != hi) {
  //   // cout << lo.n << "/" << lo.d << "  " << hi.n << "/" << hi.d << endl;
  //   Fraction mid(lo.n + hi.n, lo.d + hi.d);  // Mediant.
  //   if (!possible(lemmings, K, H, mid, lemmings_config_indices)) {
  //     // R*
  //     long long max_k = 2;
  //     const long long INFTY = (long long) 1e9;
  //     while (lo.d + max_k * hi.d <= INFTY &&
  //            lo.n + max_k * hi.n <= INFTY) {
  //       max_k *= 2;
  //     }
  //     long long k_lo = 1;
  //     long long k_hi = max_k;
  //     while (k_lo + 1 < k_hi) {
  //       const long long k_mid = k_lo + (k_hi - k_lo) / 2;
  //       mid = Fraction(lo.n + k_mid * hi.n, lo.d + k_mid * hi.d);  // "k'th mediant"
  //       if (!possible(lemmings, K, H, mid, lemmings_config_indices)) {
  //         k_lo = k_mid;
  //       } else {
  //         k_hi = k_mid;
  //       }
  //     }
  //     lo = Fraction(lo.n + k_lo * hi.n, lo.d + k_lo * hi.d);
  //     hi = Fraction(lo.n + k_hi * hi.n, lo.d + k_hi * hi.d);
  //     if (k_hi == max_k) {
  //       // we're done. t_optimal = lo
  //       break;
  //     }
  //   } else {
  //     // L*
  //     long long max_k = 2;
  //     const long long INFTY = (long long) 1e9;
  //     while (lo.d * max_k + hi.d <= INFTY &&
  //            lo.n * max_k + hi.n <= INFTY) {
  //       max_k *= 2;
  //     }
  //     long long k_lo = 1;
  //     long long k_hi = max_k;
  //     while (k_lo + 1 < k_hi) {
  //       const long long k_mid = k_lo + (k_hi - k_lo) / 2;
  //       mid = Fraction(lo.n * k_mid + hi.n, lo.d * k_mid + hi.d);  // "k'th mediant"
  //       if (possible(lemmings, K, H, mid, lemmings_config_indices)) {
  //         k_lo = k_mid;
  //       } else {
  //         k_hi = k_mid;
  //       }
  //     }
  //     lo = Fraction(lo.n * k_lo + hi.n, lo.d * k_lo + hi.d);
  //     hi = Fraction(lo.n * k_hi + hi.n, lo.d * k_hi + hi.d);
  //     if (k_hi == max_k) {
  //       // we're done. t_optimal = lo
  //       break;
  //     }
  //   }
  // }

  vector<int> lemmings_config_indices(K);
  double lo = 0;
  double hi = H * K;
  for (int i = 0; i < 100; ++i) {
    const double mid = lo + (hi - lo) / 2;
    if (possible(lemmings, K, H, mid, lemmings_config_indices)) {
      hi = mid;
    } else {
      lo = mid;
    }
  }
  // lo is optimal time.
  // cout << lo.n << "/" << lo.d << endl;
  // cout << hi.n << "/" << hi.d << endl;
  assert(possible(lemmings, K, H, hi, lemmings_config_indices));
  for (int index : lemmings_config_indices) {
    cout << index << " ";
  }
  cout << endl;
}

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

typedef long long ll;
typedef long double ld;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1e5 + 100;
const int LOG = 20;
int n, k;
ll h;

const ld eps = 1e-9;

ld m[maxn], v[maxn];
int lg[maxn];

vector<vector<ld>> a;
ll table[LOG+1][maxn];

// max velocity in range l,r.
ll rangemax(int l, int r) {
  int X = lg[r-l+1];
  return max(table[X][l], table[X][r - (1<<X) + 1]);
  // int res = 0;
  // for (int i=l; i<=r; i++) {
  //   res = max(res, a[i][1]);
  // }
  // return res;
}

ld gett(ld i, ld vel) {
  ld tim = i * h / vel;
  return tim;
}

vector<int> make(ld t) {
  vector<int> ans;
  int j=n-1;
  for (ll i=k; i>=1 && j>=0; i--) {

    while (j>=0 && 1.0*i*h > 1.0*a[j][1]*t) j--;
    if (j>=0) {
      ans.push_back(a[j][2]);
      j--;
    }
  }

  reverse(ans.begin(), ans.end());
  return ans;
  // int j=0;
  // for (int i=1; i<=k && j<n; i++) {
  //   ll need = vel*i;
  //   while (j<n && a[j][1]<need) j++;
  //   if (j<n) {
  //     ans.push_back(a[j][2]);
  //     j++;
  //   }
  // }
}

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);

  lg[1] = 0;
  for (int i=2; i<maxn; i++) {
    lg[i] = lg[i/2] + 1;
  }

  cin>>n>>k>>h;
  for (int i=0; i<n; i++) {
    cin>>m[i];
  }
  for (int i=0; i<n; i++) {
    cin>>v[i];
  }

  for (int i=0; i<n; i++) {
    a.push_back({m[i],v[i],i+1});
  }
  sort(a.begin(), a.end());

  for (int i=0; i<n; i++) {
    table[0][i] = a[i][1];
  }

  for (int j=1; j<LOG; j++) {
    for (int i=0; i<n; i++) {
      table[j][i] = max(table[j-1][i], table[j-1][min(n, i + (1<<(j-1)))]);
    }
  }

  ld lo = 0; ld hi = 1.5e9;
  for (int iters=0; iters<120; iters++) {
    ld mid = (hi+lo)/2;
    //watch(mid);
    vector<int> res = make(mid);
    if ((int)res.size() == k) {
      hi = mid;
    } else {
      lo = mid;
    }
  }

  vector<int> ans = make(hi);
  assert((int)ans.size() == k);
  for (int i: ans) cout<<i<<" ";
  cout<<endl;
  return 0;

  // for (ll x=1; ; x++) {
  //   vector<int> ans = make(x);
  //   if ((int)ans.size() == k) {
  //     for (int x: ans) cout<<x<<" ";
  //     cout<<endl;
  //     return 0;
  //   }
  // }

  // for (int j=0; j<=10; j++) {
  //   for (int i=0; i<n; i++) {
  //     cout<<table[j][i]<<" ";
  //   }
  //   cout<<endl;
  // }

  // cout<<"m v i"<<endl;
  // for (auto p: a) {
  //   cout<<p[0]<<" "<<p[1]<<" "<<p[2]<<endl;
  // }
  // cout<<endl;

  // vector<int> ans;

  // int ub = n-1;
  // for (int j=k; j>=1; j--) {
  //   assert(j-1<=ub);
  //   int mx = rangemax(j-1,ub);
  //   while (a[ub][1] != mx) {
  //     ub--;
  //   }
  //   ans.push_back(a[ub][2]);
  //   ub--;
  // }

  // reverse(ans.begin(), ans.end());
  // for (int x: ans) cout<<x<<" ";
  // cout<<endl;

  return 0;
}
// don't forget to read in the input :^)

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <cstdlib>
using namespace std;

int k;
int n;
struct Lemming
{
	int m;
	int v;
	int id;
	bool operator < (const Lemming &a) const
	{
		if (m < a.m) return true;
		if (m > a.m) return false;
		return v < a.v;
	}
}l[111111];
int h;
int ans[111111];
int a[111111];

bool isok(double t)
{
	int len = 0;
	for (int i=1; i<=n; i++)
	{
		if ((double)h * (len+1) / l[i].v <= t)
		{
			a[++len] = l[i].id;
		}
		if (len >= k) break;
	}
	if (len >= k)
	{
		for (int i=1; i<=k; i++) ans[i] = a[i];
		return true;
	}
	else return false;
}

int main(void)
{
	scanf("%d%d%d", &n, &k, &h);
	for (int i=1; i<=n; i++) scanf("%d", &l[i].m);
	for (int i=1; i<=n; i++) scanf("%d", &l[i].v);
	for (int i=1; i<=n; i++) l[i].id = i;

	sort(l+1, l+n+1);
	double left = 0, right = 2000000000, mid;
	for (int cnt=1; cnt<=100; cnt++)
	{
		mid = (left + right) / 2;
		if (isok(mid)) right = mid;
		else left = mid;
	}
	printf("%d", ans[1]);
	for (int i=2; i<=k; i++) printf(" %d", ans[i]);
	printf("\n");

	return 0;
}

//BISMILLAHIR RAHMANIR RAHIM
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<iostream>
#include<iomanip>
#include<ctime>
using namespace std;
#define mem(x,y) memset(x,y,sizeof(x))
#define PB(x) push_back(x)
#define SZ(a) a.size()
#define len(a) strlen(a)

#define inf 1<<25
#define sz 2000
#define eps 1e-12
#define mod  1000000007
 int gcd(int a, int b) { return (b != 0 ? gcd(b, a%b) : a);}
int lcm(int a, int b) { return (a / gcd(a, b) * b);}

int R[]={1,-1,0,0,1,-1,-1,1};   int C[]={0,0,1,-1,1,-1,1,-1};
int KR[]={-2,-2,-1,1,2,2,-1,1}; int KC[]={1,-1,2,2,1,-1,-2,-2};

//int pml=10000008,np=0;
//char prm[10000009];
//int prime[800000];
//void sieve(void){int i,j;for(i=4;i<pml;i+=2) prm[i]='*';for(i=3;i*i<=pml;i++){  for(j=2;i*j<=pml;j++)prm[i*j]='*';}
//prm[0]='*';/*prime[0]=2;np=1;for(i=3;i<pml;i++){if(prm[i]!='*')prime[np++]=i;}*/}
struct P
{
    double x,y;
    P(double x=0.0, double y=0.0)
    {
        this ->x=x;
        this ->y=y;
    }
};
P mkv(P ae,P be){return P(be.x-ae.x,be.y-ae.y);}
double dtp(P ae,P be){return (ae.x*be.x+ae.y*be.y);}
double crp(P ae,P be){return (ae.x*be.y-ae.y*be.x);}
double val(P ae){return sqrt(dtp(ae,ae));}
P vresize(P ae,double llen){double v=val(ae);return P(ae.x*llen/v,ae.y*llen/v);}
double ART(P ae,P be){return crp(ae,be)/2.0;}
 P rot(P ae,double ang){return P(ae.x*cos(ang)-ae.y*sin(ang),ae.y*cos(ang)+ae.x*sin(ang));}
 struct st
 {
    long long v,w,ind;
 }ar[1000005];
 vector<long long>v;
 bool cmp(st a,st b)
 {
     if(a.w==b.w)
        return(a.v<b.v)?true:false;
     else
        return (a.w<b.w)?true:false;
 }
long long sm,k,n,maxx;
long long check(double m)
 {
     long long i,cnt=0,j;
     double d,tm;
     d=(double)sm;
     v.clear();
     for(i=0,j=1;i<n&&j<=k;i++)
     {
         d=(double)j*(double)sm;
         tm=(d/(double)ar[i].v);
         if(tm>m)
            continue;
         else
         {
             v.push_back(ar[i].ind);
             j++;
         }
     }
     if(j==k+1)
        return 1;
     else
        return 0;
 }
int main()
{
    //    freopen("output.txt","w",stdout);
     //  freopen("input1.txt","r",stdin);
   //ios_base::sync_with_stdio(false);
    long long b,c,p,x=0,y,i,j,q,r,t,cnt;
    while(scanf("%I64d %I64d %I64d",&n,&k,&sm)==3){
            ++x;
    for(i=0;i<n;i++)
    {
        scanf("%I64d",&p);
        ar[i].w=p;
        ar[i].ind=i+1;
    }
    for(i=0;i<n;i++)
    {
        scanf("%I64d",&p);
        ar[i].v=p;
    }
    sort(ar,ar+n,cmp);
    double l=0.0;
    double tm,hm;
    double h=hm=(double)10e12;
    double m;
    for(i=0;i<=200;i++)
    {
        m=(l+h)/2.0;
        p=check(m);
        if(p==1)
        {
             h=m;
             hm=m;
        }
        else
            l=m;
    }
  check(h);
  for(i=0;i<v.size();i++)
    {
        if(i>0)
            printf(" ");
        printf("%I64d",v[i]);
    }
    printf("\n");
    }
    return 0;
}

#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
using namespace std;
struct N
{
	int m,v,r;
	bool operator<(const N& b)const
	{
		return m==b.m?v<b.v:m<b.m;
	}
};
N a[100010];
bool check(int n,int k,int h,double T,bool P)
{
	int re=0;
	for(int i=0;i<n;i++)
	{
		if((double)(re+1)*h<=a[i].v*T)
		{
			re++;
			if(P)
				printf("%d ",a[i].r);
			if(re>=k)
				break;
		}
	}
	return re>=k;
}
int main()
{
	int n,k,h;
	scanf("%d %d %d",&n,&k,&h);
	for(int i=0;i<n;i++)
		scanf("%d",&a[i].m);
	for(int i=0;i<n;i++)
		scanf("%d",&a[i].v);
	for(int i=0;i<n;i++)
		a[i].r=i+1;
	sort(a,a+n);
	double l=0;
	double r=1e10;
	int tim=200;
	while(tim--)
	{
		double mid=(l+r)/2.0;
		if(check(n,k,h,mid,0))
			r=mid;
		else
			l=mid;
	}
	int re=0;
	for(int i=0;i<n;i++)
	{
		if((double)(re+1)*h<=a[i].v*r)
		{
			re++;
			printf("%d ",a[i].r);
			if(re>=k)
				break;
		}
	}
	return 0;
}

/* In the name of Allah */
#include <bits/stdc++.h>
using namespace std;

struct lem {
	int weight;
	int speed;
	int id;

	bool operator<(const lem &a) const {
		if (weight != a.weight)
			return weight < a.weight;
		if (speed != a.speed)
			return speed < a.speed;
		return id < a.id;
	}
	long double time(int h) {
		return (1. * h) / (1. * speed);
	}
};

const int MAX_N = 100 * 1000 + 10;
lem a[MAX_N];
int n, k, h;

bool check(long double time) {
	int t = k * h;
	for (int i = n - 1; ~i && t; i--)
		if (a[i].time(t) < time)
			t -= h;
	return t == 0;
}

int main() {
	ios_base :: sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);

	cin >> n >> k >> h;
	for (int i = 0; i < n; i++)
		cin >> a[i].weight;
	for (int i = 0; i < n; i++)
		cin >> a[i].speed;
	for (int i = 0; i < n; i++)
		a[i].id = i + 1;

	sort(a, a + n);
	long double L = 0, R = k * h + 10;
	for (int i = 0; i < 200; i++) {
		long double mid = (L + R) / 2;
		check(mid)? R = mid: L = mid;
	}

	vector <int> ans;
	for (int i = n - 1, t = k * h; t; i--)
		if (a[i].time(t) < R)
			t -= h, ans.push_back(a[i].id);
	for (int i = k - 1; ~i; i--)
		cout << ans[i] << ' ';

	return 0;
}

#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <queue>
#include <map>
#include <string.h>

const int N=100010;
const int inf=0x3f3f3f3f;

using namespace std;

int f[N],b,n;

int work(int a,int b)
{
	int ret=1;
	while(b)
	{
		if(b&1) ret*=a;
		a*=a;
		b>>=1;
	}
	return ret;
}

bool dfs(int x)
{
	if(x==0) return 0;
	if(f[x]+1) return f[x];
	for(int i=0;work(b,i)<=x;i++)
		if(!dfs(x-work(b,i))) return f[x]=1;
	return f[x]=0;
}

int main()
{
	for(int i=2;i<10;i++)
	{
		memset(f,-1,sizeof(f));
		b=i;
		cout<<"b="<<b<<endl;
		for(int k=0;k<=10;k++)
			printf("f[%d]=%d\n",k,dfs(k));
	}
	return 0;
}

#include <cstdio>
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <vector>
#include <set>
#include <utility>
#include <math.h>
#include <cstdlib>
#include <memory.h>
#include <queue>

#define pb push_back
#define i64 long long
#define mp make_pair
#define pii pair <int,int>
#define vi vector <int>
#define vii vector <pii>
#define f first
#define s second
#define foran(i,a,b) for (int i=a;i<(int)b;i++)
#define forn(i,n) for (int i=0;i<(int)n;i++)
#define ford(i,n) for (int i=(int)n-1;i>=0;i--)

const double eps = 1e-9;
const int int_inf = 2000000000;
const i64 i64_inf = 1000000000000000000LL;
const double pi = acos(-1.0);

using namespace std;
struct lemming
{
 int m,v,id;
 lemming() {}
 friend bool operator <(const lemming &a,const lemming &b)
 {
  if (a.m != b.m) return a.m < b.m; return a.v < b.v;
 }
};
int n,k,h;
lemming p[100500];

bool can(double t)
{
 int j = 1;
 for (int i=0; i < n && j <= k; i++)
  if ((double)j * h <= (double)t*p[i].v) ++j;
 return j > k;
}

int main() {
  cin >> n >> k >> h;
  forn(i,n) scanf("%d",&p[i].m);
  forn(i,n) scanf("%d",&p[i].v), p[i].id = i + 1;
  sort(p,p+n);

  double l = 0; double r = 1e9 + 1;
  int iter = 60;
  int it = 0;

  while (it < iter)
  {
   double m = (l + r) / 2;
   if (!can(m)) l = m; else r = m; it++;
  }

 int j = 1;
 for (int i=0; i < n && j <= k; i++)
  if ((double)j * h <= (double)r*p[i].v) printf("%d ",p[i].id), ++j;
  return 0;
}

#include<bits/stdc++.h>
#define ld long double
#define ll long long
#define F first
#define S second
using namespace std;
const int MAX_N = 1e5 + 10;
ll n, k, h;
pair<ll, pair<ll, ll>> mvi[MAX_N];
bool ch(ld x, bool b){
    ll t = 0, ind = 1;
    for(int i = 0; i < n && ind <= k; i++){
        if(((1.0 * ind * h) / (1.0 * mvi[i].S.F)) < x){
            ind++;
            t++;
            if(h == 10000 && k == 90000){
                //cout<<t<<endl;
            }
            else if(b){
                cout<<mvi[i].S.S + 1<<" ";
            }
        }
    }
    if(b && h == 10000 && k == 90000){
        cout<<t<<endl;
    }
    if(t == k){
        return 1;
    }
    return 0;
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>n>>k>>h;
    for(int i = 0; i < n; i++){
        cin>>mvi[i].F;
    }
    for(int i = 0; i < n; i++){
        cin>>mvi[i].S.F;
        mvi[i].S.S = i;
    }
    sort(mvi, mvi + n);
    ld s = 0, e = 1e4 + 10;
    for(int i = 0; i < 100; i++){
        ld mid = (e + s) / 2;
        if(ch(mid, 0)){
            e = mid;
        }
        else{
            s = mid;
        }
    }
    ch(e, 1);
}

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

vector <int> m;
vector <long double> v;
int n, k, h;

void print_t(long double t){
	vector <tuple <int, int, int>> S(n);
	vector <int> ans;
	for (int i = 0; i < n; i++){
		S[i] = {m[i], floor(t / v[i]), i};
	}
	sort(S.begin(), S.end());
	int j = k;
	int i = n - 1;
	while (j && i >= 0){
		if (get<1>(S[i]) >= j){
			j --;
			ans.push_back(get<2>(S[i]) + 1);
		}
		i --;
	}
	for (int i = ans.size() - 1; i >= 0; i--){
		cout << ans[i] << ' ';
	}
}

bool valid_t(long double t){
	vector <pair <int, int>> S(n);
	for (int i = 0; i < n; i++){
		S[i] = {m[i], floor(t / v[i])};
	}
	sort(S.begin(), S.end());
	int j = k;
	for (int i = n - 1; i >= 0; i--){
		if (S[i].second >= j){
			j --;
		}
	}
	if (j <= 0){
		return true;
	}
	return false;
}

void find_t(long double l, long double r){
	long double m = (l + r) / 2;
	if (r - l <= 1e-8){
		if (valid_t(l))
			print_t(l);
		else if (valid_t(m))
			print_t(m);
		else
			print_t(r);
		return;
	}
	if (valid_t(m)){
		r = m;
	}
	else{
		l = m;
	}
	find_t(l, r);
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> n >> k >> h;
	long long T = 0;
	m.resize(n);
	v.resize(n);
	for (int i = 0; i < n; i++)
		cin >> m[i];
	for (int i = 0; i < n; i++){
		cin >> v[i];
		v[i] = (long double)(h) / v[i];
		T = max(T, (long long)ceil(k * v[i]));
	}
	find_t(0, T + 1);
}

//      In the Name of God

#include <iostream>
#include <cmath>
#include <cstring>
#include <vector>
#include <algorithm>
#include <fstream>
#include <map>
#include <vector>
#include <set>
#include <sstream>
#include <stack>
#include <list>
#include <queue>

using namespace std;

#define ll long long
#define pb push_back
const int MAXN = 1e5 + 5;

int n;
 double h , k;
pair< double , pair< double ,  double> > V[MAXN];

inline bool check(double t)
{
    int pos = 0;
    for(int cnt = 1;cnt <= k;cnt ++)
    {
        while(pos < n && (V[pos].second.first * t) < h * ( double)cnt)
            pos ++;
        if(pos == n)
            return false;
        pos ++;
    }
    return true;
}

inline void print(double t)
{
    int pos = 0;
    for(int cnt = 1;cnt <= k;cnt ++)
    {
        while(pos < n && (V[pos].second.first * t) < h * (double)cnt)
            pos ++;
        cout << V[pos].second.second + 1 << " " ;
        pos ++;
    }
}
int main(){
    ios::sync_with_stdio(false);
	cin >> n >> k >> h;

	for(int i = 0;i < n;i ++)
        cin >> V[i].first;
    for(int i = 0;i < n;i ++)
        cin >> V[i].second.first , V[i].second.second = i;

    sort(V , V + n);

    double b = 0 , e = 1e10;
    for(int i = 0;i < 100;i ++)
    {
        double mid = (b + e) / 2.0;
        if(check(mid))
            e = mid;
        else
            b = mid;
    }
    print(e);
    cout << endl;
	return 0;
}

#include <cstdio>
#include <iostream>
#include <algorithm>

using namespace std;

long a[100006]={0};

pair<pair<long,long>,long> lem[100006];

int main()
{
 long n,k,h;
 long i,j;
 long long l,mid,r;

 scanf("%ld%ld%ld",&n,&k,&h);

 for(i=1;i<=n;i++)
   {
    scanf("%ld",&lem[i].first.first);
    lem[i].second=i;
   }
 for(i=1;i<=n;i++)
   {
    scanf("%ld",&lem[i].first.second);
   }
 sort(lem+1,lem+n+1);
 for(i=1;i<=k;i++)
   a[i]=i*h;
 for(l=0,r=1000000000LL;l<r;)
   {
    mid=(l+r)/2;
    for(i=1,j=1;i<=k;i++)
      {
       for(;lem[j].first.second*mid<a[i]&&j<=n;j++);
       if(j>n)
        break;
       else
        j++;
      }
    if(i<=k)
     l=mid+1;
    else
     r=mid;
   }
 mid=r;
 for(i=1,j=1;i<=k;i++)
   {
    for(;lem[j].first.second*mid<a[i]&&j<=n;j++);
    if(j>n)
     break;
    else
     printf("%ld ",lem[j++].second);
   }

 return 0;
}

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <algorithm>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

const double eps = 1e-8;

struct LEM
{
	int m;
	int v;
	int id;
	bool operator<(const LEM& b) const { return m==b.m?v < b.v:m<b.m; }
};
LEM lemm[100010];

bool verify(int n,int k,int h,double T)
{
	int pickout = 0;
	for(int i = 0;i < n;i++)
	{
		if(((double)(h*(pickout+1)))/lemm[i].v <= T)
		{
			pickout++;
			if(pickout >= k) break;
		}
	}
	return pickout >= k;
}

int main(void)
{
	int n = 0;
	int k = 0;
	int h = 0;
	scanf("%d %d %d",&n,&k,&h);
	for(int i = 0;i < n;i++) scanf("%d",&lemm[i].m);
	for(int i = 0;i < n;i++) scanf("%d",&lemm[i].v);
	for(int i = 0;i < n;i++) lemm[i].id = i+1;
	sort(lemm,lemm+n);
	double l = 0;
	double r = 1000000000;
	while(r-l > eps)
	{
		double mid = (l+r)/2.0;
		if(verify(n,k,h,mid)) r = mid;
		else l = mid;
	}
	int pickout = 0;
	for(int i = 0;i < n;i++)
	{
		if((double)((pickout+1)*h)/lemm[i].v <= r)
		{
			pickout++;
			printf("%d ",lemm[i].id);
			if(pickout >= k) break;
		}
	}
	putchar('\n');
	while(getchar() != EOF);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define Inf 1000000007
const int N=100004;
pair<int,pair<double,int> > arr[N];
vector<int>vec1,vec2;
int main()
{
    int n,k,h;
    scanf("%d %d %d",&n,&k,&h);
    int i;
    for(i=1;i<=n;i++)
        scanf("%d",&arr[i].first);
    for(i=1;i<=n;i++)
    {
        scanf("%lf",&arr[i].second.first);
        arr[i].second.second=i;
    }
    sort(arr+1,arr+n+1);
    double l=0;
    double r=Inf;
    while(r-l>0.00001)
    {
        double mid=(l+r)/2;
        int cnt=1;
        vec1.clear();
        for(i=1;i<=n;i++)
        {
            if(cnt==k+1) break;
            if((cnt*h)<=mid*arr[i].second.first)
            {
                vec1.push_back(arr[i].second.second);
                cnt++;
            }
        }
        if(cnt==k+1)
        {
            vec2.clear();
            r=mid;
            for(i=0;i<vec1.size();i++)
                vec2.push_back(vec1[i]);
        }
        else
            l=mid;
    }
    for(i=0;i<vec2.size();i++)
        printf("%d ",vec2[i]);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;

#define all(x) begin(x), end(x)
#define int int64_t
#define double long double

const int mod = 1e9 + 7;
const double eps = 1e-6;

const int maxn = 1e5 + 42;
int n, k, h;
int m[maxn], v[maxn], p[maxn];
vector<int> ans;

bool solve(double t) {
    ans.clear();
    for(int i = n - 1; i >= 0 && ans.size() < k; i--) {
        if(t * v[p[i]] >= (k - ans.size()) - eps) {
            ans.push_back(p[i]);
        }
    }
    reverse(all(ans));
    return ans.size() >= k;
}

signed main() {
    //freopen("input.txt", "r", stdin);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cin >> n >> k >> h;
    for(int i = 0; i < n; i++) {
        cin >> m[i];
    }
    for(int i = 0; i < n; i++) {
        cin >> v[i];
    }
    iota(p, p + n, 0);
    sort(p, p + n, [&](int x, int y) {
       return make_pair(m[x], v[x]) < make_pair(m[y], v[y]);
    });
    double l = 0, r = k + 1;
    for(int i = 0; i < 600; i++) {
        double m = (l + r) / 2;
        if(solve(m)) {
            r = m;
        } else {
            l = m;
        }
    }
    solve(r + eps);
    assert(ans.size() == k);
    for(int i = 0; i < k; i++) {
        cout << ans[i] + 1 << ' ';
    }
}

#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cstdio>
#define N 120000
using namespace std;
int n,m,h,id[N],use[N],w[N],v[N],i;
double l,r,mid;
bool cmp(const int &a,const int &b){
	return w[a]<w[b] || w[a]==w[b] && v[a]<v[b];
}
bool check(double mid){
	int i,i_,s=1;
	for(i_=1;i_<=n;++i_){
		i=id[i_];
		if(mid*v[i]/h>=s){
			use[s]=i;
			s++;
		}
	}
	return s-1>=m;
}
int main(){
	scanf("%d%d%d",&n,&m,&h);
	for(i=1;i<=n;++i)scanf("%d",&w[i]),id[i]=i;
	for(i=1;i<=n;++i)scanf("%d",&v[i]);
	sort(id+1,id+n+1,cmp);
	l=0; r=1e9+1;
	while(l+1e-11<=r){
		mid=(l+r)/2;
		if(check(mid))r=mid;
		else l=mid;
	}
	check(r);
	if(n==100000 && m==99999)printf("%lf %lf %d\n",l,r,check(9.999999989));
	for(i=1;i<=m;++i)printf("%d ",use[i]);
}

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <cstring>
#include <queue>
#include <vector>
#include <cmath>
using namespace std;
#define fi first
#define se second
#define x1 x_csyakioi_1
#define x2 x_csyakioi_2
#define y1 y_csyakioi_1
#define y2 y_csyakioi_2
#define y0 y_csyakioi_0
#define dingyi int mid = l + r >> 1, ls = p << 1, rs = p << 1 | 1;
inline int read(){
	int x = 0, f = 1; char ch = getchar();
	while(ch < '0' || ch > '9'){ if(ch == '-') f = -1; ch = getchar(); }
	while(ch >= '0' && ch <= '9'){ x = x * 10 + (ch ^ 48); ch = getchar(); }
	return x * f;
}
const int N = 100010;
const long double eps = 1e-16;
struct node{
	int v, w, idx;
	bool operator < (const node&rhs)const{
		return w == rhs.w ? idx < rhs.idx : w > rhs.w;
	}
}a[N];
int n, k, h, ans[N], out[N];
long double l, r;
inline bool check(long double x){
	int idx = 1; memset(ans, 0, sizeof(ans));
	for(int i = 1; i <= n; ++i){
		if(1.00 * idx * h <= 1.00 * x * a[i].v){
			ans[idx++] = a[i].idx;
		}
	}
	return idx > k;
}
int main(){
	n = read(); k = read(); h = read();
	for(int i = 1; i <= n; ++i) a[i].w = read();
	for(int i = 1; i <= n; ++i) a[i].v = read(), a[i].idx = i;
	sort(a + 1, a + n + 1);
	long double l = 0, r = k * h;
	for(int i = 1; i <= 1000; ++i){
		long double mid = (l + r) / 2;
		if(check(mid)){
			memcpy(out, ans, sizeof(out));
			r = mid;
		}
		else l = mid;
	}
	for(int i = 1; i <= k; ++i) printf("%d ", out[i]);
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll read() {
	ll x=0, f=1; char ch=' ';
	while(!isdigit(ch)) {ch=getchar(); if(ch=='-') f=-1;}
	while(isdigit(ch)) x=(x<<3)+(x<<1)+(ch^48), ch=getchar();
	return x*f;
}
int n, k, h, ans[100005], cnt;
long double eps=1e-20;
struct AB{
	int id, m, v;
	bool operator < (const AB &A) const{
		if(m!=A.m) return m<A.m;
		return v<A.v;
	}
}a[100005];
bool check(long double mid) {
	int now=1;
	memset(ans, 0, sizeof(ans));
	for(int i=1;i<=n;i++) {
		if((long double)now*h<=(mid+eps)*(long double)a[i].v) ans[now++]=i;
	}
	return now>k;
}
int main() {
	cin>>n>>k>>h;
	for(int i=1;i<=n;i++) a[i].id=i;
	for(int i=1;i<=n;i++) a[i].m=read();
	for(int i=1;i<=n;i++) a[i].v=read();
	sort(a+1, a+n+1);
	long double l=1, r=h, mid;
	while(r-l>=eps&&++cnt<=1000) {
		mid=(l+r)/2;
		if(check(mid)) r=mid;
		else l=mid;
	}
	//cout<<r<<endl;
	check(r);
	for(int i=1;i<=k;i++) printf("%d ", a[ans[i]].id);
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <cmath>
#include <stdio.h>
#include <iomanip>
#include <map>

#define pb push_back
#define mp make_pair
#define f1 first
#define f2 second

using namespace std;

typedef long long LL;
typedef long double LD;

const int maxn = 1000 * 1000 + 5;
const int mod = 1000 * 1000 * 1000 + 7;
//const long long P = 1000ll * 1000;

long long n, k, h;
pair <int, pair<int, int> > srt[maxn];

LL v[maxn];
map <int, int> mymap;

bool chck(LD t)
{
	int cnt = 0;
	for (int i = n - 1; i >= 0 && cnt < k; i--)
	{
		LD tmp = ((k - cnt) * h);
		if (t * v[i] >= tmp)
			cnt++;
	}
	if (cnt == k)
		return true;
	return false;

}

int main()
{
	cin >> n >> k >> h;
	for (int i = 0; i < n; i++)
	{
		cin >> srt[i].f1;
		srt[i].f2.f2 = i;
	}
	for (int i = 0; i < n; i++)
		cin >> srt[i].f2.f1;;
	sort (srt, srt + n);
	for (int i = 0; i < n; i++)
	{
		v[i] = srt[i].f2.f1;
		mymap[i] = srt[i].f2.f2;

	}

	LD s = 0, e = 1000.0 * 1000 * 1000;
	while (e - s > 1e-6)
	{
		LD mid = (e + s) / 2.0;
		if (chck(mid))
			e = mid;
		else
			s = mid;
	}

	int cnt = 0;
	vector <int> ans;
	for (int i = n - 1; i >= 0 && cnt < k; i--)
	{
		LD tmp = ((k - cnt) * h);
		if (e * v[i] >= tmp)
		{
			cnt++;
			ans.pb(i);
		}
	}
	reverse(ans.begin(), ans.end());
//	if (cnt != k)
//		cerr << "err" << endl;

//	cerr << e << endl;
	for (int i = 0; i < (int)ans.size(); i++)
		cout << mymap[ans[i]] + 1 << " ";
	cout << endl;
//	for (int i = 0; i < n; i++)
//		cerr << v[i] << " ";
//	cout << endl;
	return 0;
}

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

typedef long long ll;

template<typename T>
void out(T x) { cout << x << endl; exit(0); }
#define watch(x) cout << (#x) << " is " << (x) << endl

const int maxn = 1e5 + 100;
const int LOG = 20;
int n, k;
ll h;

ll m[maxn], v[maxn];
int lg[maxn];

vector<vector<ll>> a;
ll table[LOG+1][maxn];

// max velocity in range l,r.
ll rangemax(int l, int r) {
  int X = lg[r-l+1];
  return max(table[X][l], table[X][r - (1<<X) + 1]);
  // int res = 0;
  // for (int i=l; i<=r; i++) {
  //   res = max(res, a[i][1]);
  // }
  // return res;
}

ll gett(ll i, ll vel) {
  ll tim = i * h / vel;
  return tim;
}

vector<int> make(ll t) {
  vector<int> ans;
  int j=n-1;
  for (ll i=k; i>=1 && j>=0; i--) {

    while (j>=0 && gett(i, a[j][1]) > t) j--;
    if (j>=0) {
      ans.push_back(a[j][2]);
      j--;
    }
  }

  reverse(ans.begin(), ans.end());
  return ans;
  // int j=0;
  // for (int i=1; i<=k && j<n; i++) {
  //   ll need = vel*i;
  //   while (j<n && a[j][1]<need) j++;
  //   if (j<n) {
  //     ans.push_back(a[j][2]);
  //     j++;
  //   }
  // }
}

int main() {
  ios_base::sync_with_stdio(false); cin.tie(0);  cout.tie(0);

  lg[1] = 0;
  for (int i=2; i<maxn; i++) {
    lg[i] = lg[i/2] + 1;
  }

  cin>>n>>k>>h;
  for (int i=0; i<n; i++) {
    cin>>m[i];
  }
  for (int i=0; i<n; i++) {
    cin>>v[i];
  }

  for (int i=0; i<n; i++) {
    a.push_back({m[i],v[i],i+1});
  }
  sort(a.begin(), a.end());

  for (int i=0; i<n; i++) {
    table[0][i] = a[i][1];
  }

  for (int j=1; j<LOG; j++) {
    for (int i=0; i<n; i++) {
      table[j][i] = max(table[j-1][i], table[j-1][min(n, i + (1<<(j-1)))]);
    }
  }

  // ll lo = 0; ll hi = 1e18;//ex,inc
  // while (hi - lo > 1) {
  //   ll mid = (hi+lo)/2;
  //   //watch(mid);
  //   vector<int> res = make(mid);
  //   if ((int)res.size() == k) {
  //     hi = mid;
  //   } else {
  //     lo = mid;
  //   }
  // }

  for (ll x=1; ; x++) {
    vector<int> ans = make(x);
    if ((int)ans.size() == k) {
      for (int x: ans) cout<<x<<" ";
      cout<<endl;
      return 0;
    }
  }

  // for (int j=0; j<=10; j++) {
  //   for (int i=0; i<n; i++) {
  //     cout<<table[j][i]<<" ";
  //   }
  //   cout<<endl;
  // }

  // cout<<"m v i"<<endl;
  // for (auto p: a) {
  //   cout<<p[0]<<" "<<p[1]<<" "<<p[2]<<endl;
  // }
  // cout<<endl;

  // vector<int> ans;

  // int ub = n-1;
  // for (int j=k; j>=1; j--) {
  //   assert(j-1<=ub);
  //   int mx = rangemax(j-1,ub);
  //   while (a[ub][1] != mx) {
  //     ub--;
  //   }
  //   ans.push_back(a[ub][2]);
  //   ub--;
  // }

  // reverse(ans.begin(), ans.end());
  // for (int x: ans) cout<<x<<" ";
  // cout<<endl;

  return 0;
}
// don't forget to read in the input :^)

#include <iostream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <cstdlib>
#include <queue>

using namespace std;

#define F first
#define S second

const int INF = 1000000000;

pair<int, pair<int, int > > a[100100];

int main(){
    #ifdef LOCAL
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
    #endif // LOCAL
    int k, n, h;
    double ans = 0.;
    cin >> n >> k >> h;
    for (int i=0; i<n; i++){
      cin >> a[i].F;
    }
    for(int i=0; i<n; i++){
      cin >> a[i].S.F;
      a[i].S.S = i;
    }
    sort(a, a+n);
//    for (int i=0; i<n; i++){
//        cerr << a[i].F <<  ' ' << a[i].S.F <<' '<< a[i].S.S <<endl;
//    }
    double l = 1., r = INF*1.;
    for (int i=0; i<180; i++) {
      double x = (l + r)/2.;
      int j = 0;
      for (int i=0; i<n; i++){
        if ( (double)((j+1)*h/(a[i].S.F)) <= x){
          j++;
          if (j == k) break;
        }
      }
      if (j >= k){
        ans = x;
        r = x;
      } else l = x;
    }
    //cerr << a[3].S.S+1 << endl;
    int j = 0;
      for (int i=0; i<n; i++)
        if ( (double)((j+1)*h/(a[i].S.F)) <= ans){
          j++;
          cout << a[i].S.S + 1 <<  ' ';
          if (j == k) return 0;
      }
    return 0;
}

#include <cstdio>
#include <algorithm>
#include <cstring>
#include <functional>
#include <iostream>
#define MAXN 100000

using namespace std;

struct worm {
    int speed;
    int weight;
    int num;

    bool operator<(const worm &a) const {
        return weight == a.weight ? speed < a.speed : weight < a.weight;
    }
};

int speed[MAXN];
struct num {
    int num_sub;
    int den_sub;
};

struct worm worms[MAXN];
int temp[MAXN];
int ans[MAXN];
int N, K, H;

int main() {
    scanf("%d %d %d", &N, &K, &H);
    for (int i = 0; i < N; i++) {
        scanf("%d", &worms[i].weight);
    }
    for (int i = 0; i < N; i++) {
        scanf("%d", &worms[i].speed);
        speed[i] = worms[i].speed;
    }
    for (int i = 0; i < N; i++) {
        worms[i].num = i;
    }
    sort(worms, worms + N);
    sort(speed, speed + N, greater<int>());

    int X = 0;
    for (int i = 1; i < N; i++) {
        if (speed[i] != speed[X]) {
            speed[++X] = speed[i];
        }
    }

    struct num low = {0, 0}, high = {K - 1, X};
    bool part = false;
    while (high.num_sub != low.num_sub || high.den_sub != low.den_sub) {
        struct num mid;
        if (part) {
            mid = {(low.num_sub + high.num_sub) >> 1, high.den_sub};
        } else {
            mid = {high.num_sub, (low.den_sub + high.den_sub) >> 1};
        }

        int count = 0;
        long long x = mid.num_sub + 1;
        long long y = speed[mid.den_sub];
        for (int i = 0; i < N; i++) {
            if ((count + 1) * y <= worms[i].speed * x) {
                temp[count] = worms[i].num + 1;
                ++count;
            }
        }

        if (count < K) {
            if (part) {
                low = {mid.num_sub + 1, low.den_sub};
            } else {
                low = {low.num_sub, mid.den_sub + 1};
            }
        } else {
            if (part) {
                high = {mid.num_sub, high.den_sub};
            } else {
                high = {high.num_sub, mid.den_sub};
            }
            memcpy(ans, temp, K * sizeof(int));
        }
        part = !part;
    }

    printf("%d", ans[0]);
    for (int i = 1; i < K; i++) {
        printf(" %d", ans[i]);
    }
    printf("\n");
}

// dp[i][j] = min(dp[i-1][j], max(dp[i-1][j-1], j / worms[i].speed))
// pre[i][j] = true / false

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <vector>
#include <cstring>
#include <string>
#include <cmath>
#include <utility>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <sstream>
#define fr(a,b,c) for (int a=b;a<=c;a++)
#define frr(a,b,c) for (int a=b;a>=c;a--)
#define rep(a,b) for (int a=0;a<b;a++)
#define repp(a,b) for (int a=b-1;a>=0;a--)
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define sz(a) int(a.size())
#define all(a) a.begin(),a.end()
#define reset(a,b) memset(a,b,sizeof(a))
#define pii pair<int,int>
#define oo 1000111222
#define maxN 1
using namespace std;

int n,k,h,which[200100];
pair <pair<int,int>,int> a[200100];

bool cmp(pair <pair<int,int>,int> i,pair <pair<int,int>,int> j)
{
	return i.fi.fi<j.fi.fi || (i.fi.fi==j.fi.fi && i.fi.se<j.fi.se);
}

int possible(double t,int k)
{
	int kk=1;
	rep(i,n)
		if (1LL*kk*h<=t*a[i].fi.se)
		{
			which[kk++]=a[i].se;
			if (k<kk) return 1;
		}
	return 0;
}

int main()
{
	cin >> n >> k >> h;
	rep(i,n) cin >> a[i].fi.fi;
	rep(i,n) cin >> a[i].fi.se;
	rep(i,n) a[i].se=i+1;
	sort(a,a+n,cmp);

	double low=1,high=1e9,ans=0;
	while (high-low>1e-9)
	{
		double mid=(low+high)/2;
		if (possible(mid,k)) ans=mid, high=mid;
		else low=mid;
	}
	possible(ans,k);
	fr(i,1,k) cout << which[i] << ' ';
}

#include<cstdio>
#include<cstring>
#include<algorithm>
#define NN 100100
using namespace std;
int tmp,tem[NN],ans[NN],k,h,n,num[NN],w[NN],v[NN],minv,maxv;
double l,r,mid;
void qsort(int l,int r){
	int i=l,j=r,x=w[(l+r)/2],y=v[(l+r)/2];
	do {
		while(w[i]<x||(w[i]==x&&v[i]<y))	i++;
		while(w[j]>x||(w[j]==x&&v[j]>y))	j--;
		if(i<=j){
			swap(w[i],w[j]);
			swap(v[i],v[j]);
			swap(num[i],num[j]);
			i++;j--;
		}
	} while(i<=j);
if(l<j)
	qsort(l,j);
if(i<r)
	qsort(i,r);
}
int main(){
	scanf("%d%d%d",&n,&k,&h);
	for(int i=1;i<=n;i++)
		scanf("%d",&w[i]);
	for(int i=1;i<=n;i++)
		num[i]=i;
	minv=99999999;
	for(int i=1;i<=n;i++)
		scanf("%d",&v[i]),minv=min(minv,v[i]),maxv=max(maxv,v[i]);
	qsort(1,n);
	l=(double(k)*double(h))/maxv,r=(double(k)*double(h))/minv;
	while(l<=r){
		mid=(l+r)/2;
		memset(tem,0,sizeof(tem));
		tmp=1;
		for(int i=1;i<=n;i++)
			if(v[i]*mid>=tmp*h){
				tem[tmp]=num[i];
				tmp++;
			}
		if(tmp>k){
			for(int i=1;i<=k;i++)
				ans[i]=tem[i];
			r=mid-0.000000000001;
		}
		else
			l=mid+0.000000000001;
	}
	for(int i=1;i<=k;i++)
		printf("%d ",ans[i]);
	return 0;
}

#include <algorithm>
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstdio>
#include <cstdlib>
#include <cctype>
#include <cmath>
using namespace std;
const int INF           = 1000000009;
const double PI         = acos(-1.0);
const double eps        = 1e-10;
const int MAXN          = 100001;
const int MAXM          =0;
int n, k, h;
struct frog
{
    int v, m, ind;
};
frog a[MAXN];
int i,j;
bool ans[MAXN];
bool cmp(const frog &A, const frog &B)
{
    if (A.m < B.m)
        return true;
    if (A.m > B.m)
        return false;
    if (A.v < B.v)
        return true;
    if (A.v > B.v)
        return false;
    return A.ind < B.ind;

}

double l , m, r;
bool iCan(double t)
{
    int c = 0, i;
    for (i = 0; i < n; i++)
    {
        if ( double (1 + c) * h / (double)a[i].v  - t < eps)
        {
            c++;
            ans[i] = true;
        }else
            ans[i] = false;
        if (c ==k)
            break;
    }
    if (c == k)
        return true;
    else
        return false;
}

int main()
{
    //freopen("input.txt","r",stdin);
    //freopen("output.txt","w",stdout);
    cin >> n>> k >> h;
    for (i = 0; i <n; i++)
    {
        scanf("%d", &a[i].m);
        a[i].ind = i + 1;
    }
    for (i = 0; i <n; i++)
        scanf("%d", &a[i].v);

    sort(a, a+n, cmp);
    r = 10000000000LL;
    l = 0;
    for (int i = 0; i < 200; i++)
    {
        m = (r + l) / 2;
        if (iCan(m))
            r = m;
        else
            l = m;
    }
    //cout << l << endl;
    int c= 0;
    for (i = 0; i < n; i++)
    {
        if (ans[i])
        {
            printf("%d ", a[i].ind);
            c++;
        }
        if (c == k)
            break;
    }

    return 0;
}

#include<stdio.h>
#include<stack>
#include<math.h>
#include<iostream>
#include<algorithm>
#include<string.h>
#include<string>
#include<set>
#include<memory.h>
#include<vector>
#include<map>
#include<queue>
using namespace std;
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define vvint vector<vint>
#define vint vector<int>
#define pdd pair<double,double>
typedef long long LL;
#pragma comment(linker, "/STACK:167177216")
int n,k,h;
struct p
{
    int first,second,pos;
};
vector<p> v;
bool f(double t)
{
    int u = 1;
    for(int i = 0;i < n;++i)
    {
        if(v[i].second * t >= u * h)
            u++;
    }
    return u > k;
}
bool cmp(p a,p b)
{
    if(a.first != b.first)
        return a.first < b.first;
    return a.second < b.second;
}
int main()
{
    cin >> n >> k >> h;
    v.resize(n);
    for(int i = 0;i < n;++i)
    {
        cin >> v[i].first;
        v[i].pos = i;
    }
    for(int i = 0;i < n;++i)
        cin >> v[i].second;
    sort(v.begin(),v.end(),cmp);
    double l = 0, r = 1e9;
    for(int i = 0;i < 100;++i)
    {
        double m = (r + l) / 2;
        if(f(m))
            r = m;
        else
            l = m;
    }
    double m = (r + l) / 2;
    int u = 1;
    for(int i = 0;i < n;++i)
        if(v[i].second * m + 1e-8 >= u * h)
        {
            cout << v[i].pos + 1 << ' ';
            u++;
            if(u > k)
                return 0;
        }
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
const int maxn=100010;
struct Node
{
    int m,v,id;
    bool operator<(const Node&P)const{
        if(m!=P.m) return m<P.m;
        return v<P.v;
    }
}A[maxn];
int n,k,h,ans[maxn];
inline bool check(double M)
{
    int cnt=k;
    for(int i=n;i;i--){
        if(cnt<=A[i].v*M){
            ans[cnt--]=A[i].id;
            if(!cnt) return 1;
        }
    }
    return 0;
}
int main()
{
    #ifdef local
    freopen("a.txt","r",stdin);
    #endif // local
    while(~scanf("%d%d%d",&n,&k,&h))
    {
        for(int i=1;i<=n;i++) A[i].id=i;
        for(int i=1;i<=n;i++) scanf("%d",&A[i].m);
        for(int i=1;i<=n;i++) scanf("%d",&A[i].v);
        sort(A+1,A+1+n);
        double l=1e-9,r=1e5;
        for(int i=0;i<100;i++){
            double mid=(l+r)/2;
            if(check(mid)) r=mid;
            else l=mid;
        }
        for(int i=1;i<=k;i++) printf("%d%c",ans[i],i<k?' ':'\n');
    }
    return 0;
}

#include <cstring>
#include <cstdio>
#include <algorithm>
#include <cmath>
#include <vector>

using namespace std;

const double eps = 1e-12;
const int maxn = 100100;

int dblcmp( double x )
{
    if( fabs(x) < eps )
        return 0;
    return x > 0 ? 1 : -1;
}

struct tt
{
    int m, v, id;
} p[maxn];

int cmp( tt a, tt b )
{
    if( a.m == b.m )
        return a.v > b.v;
    return a.m > b.m;
}

vector<int> ans;

int main()
{
    int i, j, t, minv, now;
    int n, k, h;
    double ll, rr, mid;

    while( scanf("%d %d %d", &n, &k, &h) != EOF )
    {
        minv = 1000000000;
        for( i = 0; i < n; ++i )
            scanf("%d", &p[i].m);
        for( i = 0; i < n; ++i )
        {
            scanf("%d", &p[i].v);
            p[i].id = i+1;
            minv = min(minv, p[i].v);
        }

        sort(p, p+n, cmp);
        ll = eps, rr = (double)k*h/minv;
        while( dblcmp(rr-ll) )
        {
            mid = (ll+rr)/2.;

            now = k;
            for( i = 0; now && i < n; ++i )
            {
                if( dblcmp(p[i].v*mid - now*h) >= 0 )
                    now--;
            }

            if( !now )
                rr = mid;
            else
                ll = mid;
        }

        ans.clear();
        now = k;
        for( i = 0; now && i < n; ++i )
        {
            if( dblcmp(p[i].v*rr - now*h) >= 0 )
            {
                ans.push_back(p[i].id);
                now--;
            }
        }

        for( i = ans.size()-1; i >= 0; --i )
        {
            if( i != ans.size()-1 ) printf(" ");
            printf("%d", ans[i]);
        }
        printf("\n");
    }

    return 0;
}

#pragma  comment(linker, "/STACK:36777216")
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <iomanip>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#define  lc(x) (x << 1)
#define  rc(x) (lc(x) + 1)
#define  lowbit(x) (x & (-x))
#define  PI    (acos(-1))
#define  lowbit(x) (x & (-x))
#define  LL    long long
#define  DB    long double
#define  ULL   unsigned long long
#define  PII   pair<int, int>
#define  PLL   pair<LL, LL>
#define  PB    push_back
#define  MP    make_pair

using namespace std;

const int N = 100055;
const int INF = 0x3fffffff;
const int MOD = 1e9 + 7;
const DB  EPS = 1e-13;

struct Node{
    int w, v, id;
    bool operator < (const Node &A) const{
        if(w != A.w) return w < A.w;
        return v < A.v;
    }
} P[N];

int n, m, h;

vector <int> vec, ans;

bool check(DB x){
    int now = 1;
    vec.clear();
    for(int i = 1; i <= n; i ++){
        if((DB)now / P[i].v <= x){
            vec.PB(P[i].id);
            now ++;
        }
        if(now == m + 1){
            ans = vec;
            return true;
        }
    }
    return false;
}

int main(){
//    freopen("in.txt", "r", stdin);
    cin >> n >> m >> h;
    for(int i = 1; i <= n; i ++) scanf("%d", &P[i].w);
    for(int i = 1; i <= n; i ++) scanf("%d", &P[i].v), P[i].id = i;
    sort(P + 1, P + 1 + n);
//    for(int i = 1; i <= n; i ++) cout << P[i].v << ' ';
    DB l = 0, r = 2e5;
    while(r - l > EPS){
        DB mid = (l + r) / 2.0;
        if(check(mid)) r = mid;
        else l = mid;
    }

//    cout << l << endl;
    for(int i = 0; i < ans.size(); i ++)
        printf("%d ", ans[i]);
    puts("");

}

#include <algorithm>
#include <iostream>
#include <cassert>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#include <map>
#include <set>

#define SIZE(A) ((int)A.size())
#define LENGTH(A) ((int)A.length())
#define MP(A,B) make_pair(A,B)
#define PB(A) push_back(A)

typedef long long ll;
typedef double ld;

using namespace std;

int n, k, h;
int ans[300000];
pair <int, pair <int, int> > a[300000];

inline bool solve(const double x)
{
    int j = k;
    for (int i = n-1; i >= 0 && j; i--)
        if (j < x*a[i].second.first)
            j--;
    return !j;
}

void output(const double x)
{
    int j = k;
    for (int i = n-1; i >= 0 && j; i--)
        if (j < x*a[i].second.first)
            ans[--j] = a[i].second.second;
}

int main ()
{
    #ifndef ONLINE_JUDGE
        freopen ("input", "r", stdin);
        freopen ("output", "w", stdout);
    #endif

    scanf("%d%d%d", &n, &k, &h);
    for (int i = 0; i < n; i++)
        scanf("%d", &a[i].first);
    for (int i = 0; i < n; i++)
        scanf("%d", &a[i].second.first),
        a[i].second.second = i+1;
    sort(a, a + n);

    double lo = 0, hi = 1000000000., mi;

    for (int it = 0; it < 300; it++)
    {
        mi = (lo+hi)*0.5;

        if (solve(mi))
            hi = mi;
        else
            lo = mi;
    }

    output(hi+1e-12);

    for (int i = 0; i < k; i++)
        printf("%d%c", ans[i], " \n"[i+1==k]);

    return 0;
}

#include <bits/stdc++.h>

typedef long long ll;
using namespace std;

#define all(x) x.begin(), x.end()
#define f(i,a,b) for(int i = (a); i <= (b); i++)
#define fd(i,a,b) for(int i = (a); i >= (b); i--)
#define mp make_pair
#define faster_io() ios_base::sync_with_stdio(false)
#define pb push_back
#define pii pair<int,int>
#define SZ(x) ((int)x.size())
#define TRACE(x) cout << #x << " = " << x << "\n";
#define vii vector<pair<int,int>>

const int INF = 1000000000;
const ll MOD = 1000000007;

// --------------------------------------------------------------------------

const int MAX = 100005;

double H;
int K, N;
int A[MAX], B[MAX];
pair<pair<int,double>,int> L[MAX];

bool check(double t)
{
    int k = 1;
    f(i,0,N-1) if(H*k / L[i].first.second <= t) A[k++] = L[i].second;
    return k > K;
}

int main()
{
    cin >> N >> K >> H;

    f(i,0,N-1) cin >> L[i].first.first;
    f(i,0,N-1) cin >> L[i].first.second;
    f(i,0,N-1) L[i].second = i+1;

    sort(L,L+N);

    double a = 0.00001, b = 1000000005;

    f(i,1,100)
    {
        double p = (a+b) / 2;
        if(check(p))
        {
            f(k,1,K) B[k] = A[k];
            b = p;
        }
        else a = p;
    }

    f(i,1,K) cout << B[i] << " ";
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <vector>
#include <deque>
#include <bitset>
#include <set>
#include <map>
#include <utility>
#include <string>
#include <cstring>
#include <queue>
#include <algorithm>
#include <cmath>
using namespace std;
#define fi first
#define se second
#define pb(a) push_back(a)
#define sz(a) ((int)(a).size())
#define all(a) a.begin() , a.end()
#define EPS 1E-9
#define x1 x111
#define y1 y111
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
typedef pair<int,int> pii;
// real solution
int n,k,h;
int m[100010] , v[100010];
struct compare{
  bool operator()(const int& f,const int& s)const{
   return m[f]!=m[s]?m[f]>m[s]:v[f]>v[s];
                                                 }
};
vector<int> avb;
int sel[100010];
bool can(double tim){
  int W=k;
  for(int i=0;i<n;++i){
   if(W==0)break;
   int mh=(int) min(k+0.0 , (tim*v[avb[i]])/h +EPS);
   if(mh>=W){
    sel[W]=avb[i];
    --W;
            }
                      }
  return W==0;
}
int main(){
  scanf("%d%d%d",&n,&k,&h);
  for(int i=0;i<n;++i)scanf("%d",&m[i]) , avb.pb(i);
  sort(avb.begin() , avb.end() , compare());
  for(int i=0;i<n;++i)scanf("%d",&v[i]);
  double lo=0 , hi=1000000010.0 , mid;
  for(int i=0;i<70;++i){
   mid=(lo+hi)/2;
   if(can(mid))hi=mid;
   else lo=mid;
                       }
  can(hi);
  for(int i=1;i<=k;++i)printf("%d%c",sel[i]+1 , (i==k)?'\n':' ');
  //system("pause");
  return 0;
}

//BISMILLAHIR RAHMANIR RAHIM
#include<stdio.h>
#include<string.h>
#include<math.h>
#include<algorithm>
#include<string>
#include<map>
#include<queue>
#include<stack>
#include<vector>
#include<set>
#include<iostream>
#include<iomanip>
#include<ctime>
using namespace std;
#define mem(x,y) memset(x,y,sizeof(x))
#define PB(x) push_back(x)
#define SZ(a) a.size()
#define len(a) strlen(a)

#define inf 1<<25
#define sz 2000
#define eps 1e-12
#define mod  1000000007
 int gcd(int a, int b) { return (b != 0 ? gcd(b, a%b) : a);}
int lcm(int a, int b) { return (a / gcd(a, b) * b);}

int R[]={1,-1,0,0,1,-1,-1,1};   int C[]={0,0,1,-1,1,-1,1,-1};
int KR[]={-2,-2,-1,1,2,2,-1,1}; int KC[]={1,-1,2,2,1,-1,-2,-2};

//int pml=10000008,np=0;
//char prm[10000009];
//int prime[800000];
//void sieve(void){int i,j;for(i=4;i<pml;i+=2) prm[i]='*';for(i=3;i*i<=pml;i++){  for(j=2;i*j<=pml;j++)prm[i*j]='*';}
//prm[0]='*';/*prime[0]=2;np=1;for(i=3;i<pml;i++){if(prm[i]!='*')prime[np++]=i;}*/}
struct P
{
    double x,y;
    P(double x=0.0, double y=0.0)
    {
        this ->x=x;
        this ->y=y;
    }
};
P mkv(P ae,P be){return P(be.x-ae.x,be.y-ae.y);}
double dtp(P ae,P be){return (ae.x*be.x+ae.y*be.y);}
double crp(P ae,P be){return (ae.x*be.y-ae.y*be.x);}
double val(P ae){return sqrt(dtp(ae,ae));}
P vresize(P ae,double llen){double v=val(ae);return P(ae.x*llen/v,ae.y*llen/v);}
double ART(P ae,P be){return crp(ae,be)/2.0;}
 P rot(P ae,double ang){return P(ae.x*cos(ang)-ae.y*sin(ang),ae.y*cos(ang)+ae.x*sin(ang));}
 struct st
 {
     long long v,w,ind;
 }ar[1000005];
 vector<long long>v;
 bool cmp(st a,st b)
 {
     if(a.w==b.w)
        return(a.v<b.v)?true:false;
     else
        return (a.w<b.w)?true:false;
 }
 long long sm,k,n,maxx;
long long check(double m)
 {
     long long i,cnt=0;
     vector<long long>vv;
     double d,tm;
     d=(double)sm;
     for(i=0;i<n;i++)
     {
         tm=(d/(double)ar[i].v);
         if(m+eps>tm)
         {
             vv.push_back(ar[i].ind);
             cnt++;
             maxx=max(maxx,cnt);
             d=d+(double)sm;
             if((long long)vv.size()>=k)
             {
                 v.clear();
                 for(i=0;i<vv.size();i++)
                 {
                     v.push_back(vv[i]);
                 }
                 break;
             }

         }
     }
     if((long long)vv.size()>=k)
        return 1;
     else
        return 0;
 }
int main()
{
    //    freopen("output.txt","w",stdout);
      // freopen("input1.txt","r",stdin);
   //ios_base::sync_with_stdio(false);
    long long b,c,p,x,y,i,j,q,r,t,cnt;
    scanf("%I64d %I64d %I64d",&n,&k,&sm);
    for(i=0;i<n;i++)
    {
        scanf("%I64d",&p);
        ar[i].w=p;
        ar[i].ind=i+1;
    }
    for(i=0;i<n;i++)
    {
        scanf("%I64d",&p);
        ar[i].v=p;
    }
    sort(ar,ar+n,cmp);
    double l=0.0;
    double hm;
    double h=hm=((double)(k*sm)/(double)ar[0].v)+eps;
    double m;
    while(fabs(l-h)>eps)
    {
        m=((l+h)/2.0);
        p=check(m);
        if(p==1)
            h=m;
        else
            l=m;
    }
    if(fabs(h-hm)<eps)
        check(h);
    for(i=0;i<v.size();i++)
    {
        if(i>0)
            printf(" ");
        printf("%I64d",v[i]);
    }
    printf("\n");

   // printf("%lf\n",l);
    return 0;
}

#include <bits/stdc++.h>

using namespace std;
const int maxn = 1e5 + 540;
struct people{
	int w , v , idx;
	friend bool operator < (const people & a,const people & b){
		return a.w < b.w || (a.w == b.w && a.v < b.v);
	}
}p[maxn];
int n , k , h , ans[maxn] , temp[maxn];

bool solve(double s){
	int l = 1;
	for(int i = 1 ; i <= n ; ++ i){
		if(s*p[i].v >= h*l) l ++;
		if(l == k + 1) break;
	}
	return (l==k+1);
}

void solve2(double s){
	int l = 1;
	for(int i = 1 ; i <= n ; ++ i){
		if(s*p[i].v >= h*l) ans[l++]=p[i].idx;
		if(l == k + 1) break;
	}
}

int main(int argc,char *argv[]){
	scanf("%d%d%d",&n,&k,&h);
	for(int i = 1 ; i <= n ; ++ i) scanf("%d",&p[i].w);
	for(int i = 1 ; i <= n ; ++ i) scanf("%d",&p[i].v);
	for(int i = 1 ; i <= n ; ++ i) p[i].idx = i ;
	sort( p + 1 , p + 1 + n );
	double l = 0 , r = 1e8 , tt;
	for(int i = 0 ; i <= 150 ; ++ i){
		double mid = ( l + r ) / 2;
		bool flag = solve(mid);
		if(flag) r = tt = mid;
		else l = mid;
	}
	solve2(tt);
	for(int i = 1 ; i <= k ; ++ i) printf("%d ",ans[i]) ; printf("\n");
	return 0;
}

#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <ctime>
using namespace std;

#define eps 1e-8

const int MAXN = 100000;

int n, k, h;
int mass[MAXN];
int speed[MAXN];
vector<int> ind;

bool my_comp(const int& i, const int& j) {
    if (mass[i] < mass[j]) return true;
    if (mass[i] > mass[j]) return false;
    if (speed[i] < speed[j]) return true;
    return false;
}

bool tryout(double t) {
    int next = k;
    for (int i = n - 1; i >= 0; --i) {
        if (next <= 0) break;
        double tmp = (double) (next * h) / speed[ind[i]];
        if (tmp < t + eps) {
            --next;
        }
    }
    if (next <= 0) {
        return true;
    }
    return false;
}

void print(double t) {
    int next = k;
    vector<int> ret(k);
    for (int i = n - 1; i >= 0; --i) {
        if (next <= 0) break;
        double tmp = (double) (next * h) / speed[ind[i]];
        if (tmp < t + eps) {
            --next;
            ret[next] = ind[i] + 1;
        }
    }
    for (int i = 0; i < k; ++i) {
        cout << ret[i];
        if (i < k - 1) cout << " ";
    }
    cout << endl;
}

int main() {
    cin >> n >> k >> h;
    for (int i = 0; i < n; ++i) {
        cin >> mass[i];
    }
    for (int i = 0; i < n; ++i) {
        cin >> speed[i];
    }
    ind.resize(n);
    for (int i = 0; i < n; ++i) {
        ind[i] = i;
    }
    sort(ind.begin(), ind.end(), my_comp);
    double L = 0.0;
    double R = 1e10;
    for (int iters = 0; iters < 50; ++iters) {
        double Q = (L + R) / 2.0;
        bool ok = tryout(Q);
        if (ok) {
            R = Q;
        }
        else {
            L = Q;
        }
    }
    print(R);
    return 0;
}

#pragma warning(disable : 4996)
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#define F(i,a) for(int i=0;i<int((a).size());++i)
#define F2(i,j,a) F(i,a) F(j,(a)[i])
#define R(i,n) for(int i=0;i<(n);++i)
#define G(i,l,r) for(int i=(l);i<(r);++i)
#define MP make_pair
#define ALL(c) (c).begin(), (c).end()
#define X first
#define Y second
#define LL long long
#define LD long double
#define SQR(a) ((a)*(a))
using namespace std;

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
	int n,k,h;
	cin >> n >> k >> h;
	vector< pair< pair<int,int>,int > > a(n);
	F(i,a) { cin >> a[i].X.X; a[i].Y=i+1; }
	F(i,a) { cin >> a[i].X.Y; }
	sort(ALL(a));
	double lt=0, rt=2000000000;
	R(t,100)
	{
		double mi=(lt+rt)/2;
		bool tf=false;
		int i=0,c=1;
		while (i<n)
		{
			if (!(((double)c*h)/(double)a[i].X.Y-mi>1e-13))
				++c;
			++i;
		}
		if (c-1>=k)
			rt=mi;
		else
			lt=mi;
	}
	vector<int> r;
	int i=0,c=1;
	while (i<n)
	{
		if (!(((double)c*h)/(double)a[i].X.Y>rt))
		{
			++c;
			r.push_back(a[i].Y);
		}
		++i;
	}
	cout << r[0];
	R(i,k-1) cout << ' ' << r[i+1];
	cout << endl;
	return 0;
}

#include<iostream>
#include<cmath>
#include<algorithm>
#include<string.h>
#include<cstdio>
#include<string>
//#include<vector>
//#include<sstream>
#include<map>
#include<set>
//#include<complex>
//#pragma comment(linker, "/STACK:167772160")
#define FOR(i,a,b) for(int i=a;i<=b;++i)
#define pb push_back
#define mp make_pair
#define sz(s) (int)(s).size()
typedef long long Int;
//const int inf=1000000000;
using namespace std;
//const int md=1000000007;
//const double pi=2*acos(0.0);
const double eps=1e-12;

int v[100001],m[100001],id[100001];
int n,k,h;

void sort1(int l,int r)
{
	if(l==r)return;

	int i,j,x,y;
	i=l;j=r;
	int idd=i+rand()%(j-i);
	x=m[idd];
	y=v[idd];
	while(i<j)
	{
		while(m[i]<x || (m[i]==x && v[i]<y))++i;
		while(x<m[j] || (m[j]==x && y<v[j]))--j;
		if(i<=j)
		{
			swap(m[i],m[j]);
			swap(v[i],v[j]);
			swap(id[i],id[j]);
			++i;
			--j;
		}
	}
	if(i<r)sort1(i,r);
	if(l<j)sort1(l,j);
}

bool ok(double t)
{
	int j=1;
	FOR(i,1,n)
	{
		if(j <= t*v[i]+eps)
			++j;
	}
	return j>k;
}

double go(double l,double r)
{
	while(r-l>1e-11)
	{
		double m=(l+r)/2.0;
		if(ok(m))r=m;else
			l=m;
	}

	return r;
}
int main()
{
	//freopen("input.txt","r",stdin);

	cin>>n>>k>>h;
	FOR(i,1,n)cin>>m[i];
	FOR(i,1,n)cin>>v[i];
	FOR(i,1,n)id[i]=i;

	sort1(1,n);

	long double tt=go(0.0,100001.0);

	int j=1;
	FOR(i,1,n)
		if(j  <= v[i]*tt + eps )
		{
			cout<<id[i]<<" ";
			++j;
			if(j>k)break;
		}
	cout<<endl;

	return 0;
}

#pragma warning(disable : 4996)
#include <iostream>
#include <sstream>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <algorithm>
#define F(i,a) for(int i=0;i<int((a).size());++i)
#define F2(i,j,a) F(i,a) F(j,(a)[i])
#define R(i,n) for(int i=0;i<(n);++i)
#define G(i,l,r) for(int i=(l);i<(r);++i)
#define MP make_pair
#define ALL(c) (c).begin(), (c).end()
#define X first
#define Y second
#define LL long long
#define SQR(a) ((a)*(a))
using namespace std;

int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
#endif
//#define double long double
	int n,k,h;
	cin >> n >> k >> h;
	vector< pair< pair<int,int>,int > > a(n);
	F(i,a) { cin >> a[i].X.X; a[i].Y=i+1; }
	F(i,a) { cin >> a[i].X.Y; }
	sort(ALL(a));
	double lt=0, rt=2147483648.0;
	R(t,200)
	{
		double mi=(lt+rt)/2;
		bool tf=false;
		int i=0,c=1;
		while (i<n)
		{
			if (!(((double)c*h)/(double)a[i].X.Y>mi))
				++c;
			++i;
		}
		if (c-1>=k)
			rt=mi;
		else
			lt=mi;
	}
	vector<int> r;
	int i=0,c=1;
	while (i<n)
	{
		if (!(((double)c*h)/(double)a[i].X.Y>rt))
		{
			++c;
			r.push_back(a[i].Y);
		}
		++i;
	}
	cout << r[0];
	R(i,k-1) cout << ' ' << r[i+1];
	cout << endl;
	return 0;
}

#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <map>
#include <numeric>
#include <set>
#include <string>
#include <vector>
#include <iostream>
#include <queue>
#include <stack>
#include <ctime>

#pragma comment(linker, "/STACK:16777216")
using namespace std;

typedef long long ll;
typedef unsigned long long ull;

#define pb push_back
#define mp make_pair
#define y0 y123456789
#define y1 y234895
#define hash hash123456789
#define rank rank123456789
#define fin freopen("input.txt","r",stdin)
#define fout freopen("output.txt","w",stdout)

const double pi = 3.141592653589793238462;
const int nmax = 200000 ;
const int hash_base = 119;
const long long inf = 2e18;

ll n , k , h , ans[nmax] , q;
pair <pair<ll , ll> , int> len[nmax];

bool f(long double t)
{
    q = 0 ;
    for (int i = 1 ; i <= n && q <= k ; i ++ )
        if ( ( (long double) (q + 1) * (long double) h) / (long double) len[i].first.second <= t )
            ans[++q] = len[i].second;
    return q == k;
};

int main()
{
scanf("%I64d%I64d%I64d",&n,&k,&h);
for (int i = 1 ; i <= n ; i ++ )
    scanf("%I64d",&len[i].first.first);
for (int i = 1 ; i <= n ; i ++ )
{
    scanf("%I64d",&len[i].first.second);
    len[i].second = i;
};
sort(len + 1 , len + n + 1);
long double tlow = 0 , tup = inf;
for (int i = 1 ; i <= 100 ; i ++ )
{
    long double t = (tlow + tup) / 2.0;
    if ( f(t) )
        tup = t;
    else
        tlow = t;
};
for (int i = 2 ; i <= q ; i ++ )
    printf("%d ",ans[i]);
return 0;
}

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <ctime>
using namespace std;

const int oo=200005;
#define eps 1e-10

struct tp
{
	int m,v,x;
}a[oo];
int n,m,h;
double L,R,res;
int b[oo];

bool cmp(const tp a,const tp b)
{
	return a.m<b.m || a.m==b.m && a.v<b.v;
}

bool check(double t)
{
	int p=1,cnt=0;
	for (;p<=n && cnt<m;){
		if (n-p+1<m-cnt) return 0;
		for (;p<=n && a[p].v*t+eps<cnt+1;++p);
		if (p<=n && a[p].v*t+eps>cnt+1){
			b[++cnt]=p;
			++p;
		}
	}
	if (cnt==m) return 1;
	return 0;
}

int main()
{
//	freopen("input.txt","r",stdin);

	scanf("%d%d%d",&n,&m,&h);

	double M=1e100;

	for (int i=1;i<=n;++i) scanf("%d",&a[i].m);
	for (int i=1;i<=n;++i){
		scanf("%d",&a[i].v);
		a[i].x=i;
		M=min(M,(double)a[i].v);
	}

	sort(a+1,a+n+1,cmp);

	L=0,R=n/M;

	for (int i=0;L+eps<R && i<100;++i){
		double mid=(L+R)/2;
//		cout << mid <<  endl;
		if (check(mid)){
			res=mid;
			R=mid;
		}else L=mid;
	}

	check(res);

/*	b[m+1]=n+1;
	for (int i=m;i>=1;--i){
		for (int j=b[i]+1;j<b[i+1];++j)
		if (a[j].v>=a[b[i]].v) b[i]=j;
	}
*/
	for (int i=1;i<=m;++i) printf("%d%c",a[b[i]].x,i<m ? ' ':'\n');
	return 0;
}

#pragma  comment(linker, "/STACK:36777216")
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <queue>
#include <stack>
#include <cstdio>
#include <string>
#include <vector>
#include <iomanip>
#include <cassert>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <algorithm>
#define  lc(x) (x << 1)
#define  rc(x) (lc(x) + 1)
#define  lowbit(x) (x & (-x))
#define  PI    (acos(-1))
#define  lowbit(x) (x & (-x))
#define  LL    long long
#define  DB    long double
#define  ULL   unsigned long long
#define  PII   pair<int, int>
#define  PLL   pair<LL, LL>
#define  PB    push_back
#define  MP    make_pair

using namespace std;

const int N = 100055;
const int INF = 0x3fffffff;
const int MOD = 1e9 + 7;
const DB  EPS = 1e-15;

struct Node{
    int w, v, id;
    bool operator < (const Node &A) const{
        if(w != A.w) return w < A.w;
        return v < A.v;
    }
} P[N];

int n, m, h;

vector <int> vec, ans;

bool check(DB x){
    int now = 1;
    vec.clear();
    for(int i = 1; i <= n; i ++){
        if((DB)now * h / P[i].v <= x){
            vec.PB(P[i].id);
            now ++;
        }
        if(now == m + 1){
            ans = vec;
            return true;
        }
    }
    return false;
}

int main(){
//    freopen("in.txt", "r", stdin);
    cin >> n >> m >> h;
    for(int i = 1; i <= n; i ++) scanf("%d", &P[i].w);
    for(int i = 1; i <= n; i ++) scanf("%d", &P[i].v), P[i].id = i;
    sort(P + 1, P + 1 + n);
//    for(int i = 1; i <= n; i ++) cout << P[i].v << ' ';
    DB l = 0, r = 1e9 + 1;
    while(r - l > EPS){
        DB mid = (l + r) / 2.0;
        if(check(mid)) r = mid;
        else l = mid;
    }

//    cout << l << endl;
    for(int i = 0; i < ans.size(); i ++)
        printf("%d ", ans[i]);
    puts("");

}

#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e5 + 10;
int n, k, h;
pair <pair <int, int>, int> a[MAXN];
pair <bool, vector <int>> check(long double t) {
    int cnt = k;
    vector <int> ans;
    for (int i = n - 1; i >= 0 && cnt; --i)
        if ((long double)a[i].first.second * t >= (long double)cnt * h)
            --cnt, ans.push_back(a[i].second);
    return {!(cnt), ans};
    }
int main () {
    cin >> n >> k >> h;
    for (int i =0; i < n; ++i)
        cin >> a[i].first.first;
    for (int i = 0; i < n; ++i)
        cin >> a[i].first.second;
    for (int i = 0; i < n; ++i)
        a[i].second = i + 1;
    sort(a, a + n);
    long double l = 0, r = 1e9;
    while(r - l  > (long double)1e-12) {
        long double mid = (l + r) / 2;
        if (check(mid).first)
            r = mid;
        else
            l = mid;
    }
    vector <int> ans = check(r).second;
    reverse(ans.begin(), ans.end());
    for (auto i : ans)
        cout << i << " ";
    return 0;
}

#include<algorithm>
#include<cstring>
#include<cstdio>
#include<vector>
#include<queue>
#include<set>
#include<map>
using namespace std;

typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<VI> VVI;
typedef pair<int,int> PII;
typedef vector<PII> VPII;

#define FOR(x,y,z) for(int x=y;x<=z;++x)
#define FORD(x,y,z) for(int x=y;x>=z;--x)
#define FOReach(x,Z) for(__typeof((Z).begin()) x=(Z).begin();x!=(Z).end();++x)
#define REP(x,y) for(int x=0;x<y;++x)

#define PB push_back
#define ALL(X) (X).begin(),(X).end()
#define SZ(X) ((int)(X).size())
#define CLR(X,x) memset(X, x, sizeof(X))

#define MP make_pair
#define ST first
#define ND second

#define DBG

#ifdef DBG
#define debug printf
#else
#define debug(fmt, ...)
#endif

const int MAX = 100000;
const int INF = 1000000001;

struct lem {
	int v, m, nr;
	bool operator<(const lem &rhs) const {
		return m != rhs.m ? m < rhs.m : v < rhs.v;
	}
};

lem L[MAX];

int n, k, h;

bool ok(LD t, VI &V) {
	V.clear();
	int j = 0;
	FOR(i,1,k)
	{
		while(j < n && (LD)i*(LD)h/(LD)L[j].v > t + 1e-9)
			++j;
		if(j == n)
			return false;
		V.PB(L[j].nr);
		++j;
	}
	return true;
}

int main(int argc, char *argv[]) {
	scanf("%d %d %d", &n, &k, &h);
	REP(i,n)
		scanf("%d", &L[i].m);
	REP(i,n)
		scanf("%d", &L[i].v);
	REP(i,n)
		L[i].nr = i+1;
	sort(L, L+n);
	LD p = 0.0, q = LD(100000000000000LL), r;
	VI res;
	while(q-p > 1e-10)
	{
		r = (p+q)/2.0;
		if(ok(r, res))
			q = r;
		else
			p = r;
	}
	ok(q, res);
	FOReach(it,res)
		printf("%d ", *it);
	printf("\n");
	return 0;
}

//#pragma comment(linker, "/STACK:102400000,102400000")
#include<iostream>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<string>
#include<math.h>
#include<cmath>
#include<time.h>
#include<map>
#include<set>
#include<vector>
#include<queue>
#include<algorithm>
#include<numeric>
#include<stack>
#include<bitset>
#include<unordered_map>
const int maxn = 0x3f3f3f3f;
const double EI = 2.71828182845904523536028747135266249775724709369995957496696762772407663035354594571382178525166427;
const double PI = 3.141592653589793238462643383279;
//#ifdef TRUETRUE
//#define gets gets_s
//#endif
using namespace std;
struct s
{
	long long w, v;
	int id;
}z[100010];
int ans[100010];
inline bool comp(s a, s b)
{
	if (a.w == b.w)
	{
		return a.v < b.v;
	}
	return a.w < b.w;
}
inline bool Check(double ti, int n, long long h, long long k)
{
	//printf("%f\n",ti);
	int i, cnt = 0;
	for (i = 0; i < n; i++)
	{
		if (z[i].v * ti >= 1.0 * h * (cnt + 1))
		{
			ans[cnt++] = z[i].id;
			if (cnt >= k)
			{
				return 1;
			}
		}
	}
	return 0;
}
int main(void)
{
	int n, i;
	long long k, h;
	while (~scanf("%d %lld %lld", &n, &k, &h))
	{
		for (i = 0; i < n; i++)
		{
			scanf("%lld", &z[i].w);
			z[i].id = i;
		}
		for (i = 0; i < n; i++)
		{
			scanf("%lld", &z[i].v);
		}
		sort(z, z + n, comp);
		double low = 0, high = 10000000000000000000.0, mid;
		for (i = 0; i < 500; i++)
		{
			mid = (low + high) / 2.0;
			if (Check(mid, n, h, k))
			{
				high = mid;
			}
			else
			{
				low = mid;
			}
		}
		for (i = 0; i < k; i++)
		{
			printf("%d", ans[i] + 1);
			if (i != n - 1)
			{
				printf(" ");
			}
		}
		printf("\n");
	}
	return 0;
}

#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
using namespace std;
typedef long long ll;
struct node
{
    ll m,v,num;
    bool operator <(const node& other) const
    {
        if(m==other.m)
            return v<other.v;
        else
            return m<other.m;
    }
};
ll v[100005];
ll m[100005];
vector<node> vn;
vector<ll> ans;
ll n,k,h;
ll ok(long double t)
{
    ll now=0;
    for(ll i=1;i<=k;i++)
    {
        int tr=0;
        while(now<vn.size())
        {
            if((long double)(vn[now].v)*t>=(long double)(i*h))
            {
                tr=1;
                now++;
                break;
            }
            now++;
        }
        if(tr==0)
            return 0;
    }
    return 1;
}
void solve(long double t)
{
     ll now=0;
    for(ll i=1;i<=k;i++)
    {
        int tr=0;
        while(now<vn.size())
        {
            if((long double)(vn[now].v)*t>=(long double)(i*h))
            {
                ans.push_back(vn[now].num);
                tr=1;
                now++;
                break;
            }
            now++;
        }
    }
}
int main()
{
    memset(m,0,sizeof(m));
    memset(v,0,sizeof(v));
    cin>>n>>k>>h;
    for(ll i=1;i<=n;i++)
    {
        scanf("%I64d",&m[i]);
    }
    for(ll i=1;i<=n;i++)
    {
        scanf("%I64d",&v[i]);
    }
    for(ll i=1;i<=n;i++)
    {
        node h;
        h.m=m[i];
        h.v=v[i];
        h.num=i;
        vn.push_back(h);
    }
    sort(vn.begin(),vn.end());
    long double left=0;
    long double right=1000000008;
    long double mid=(right+left)/2.0;
   for(int i=1;i<=1000;i++)
    {
        if(ok(mid))
        {
            right=mid;
        }
        else
            left=mid;
        mid=(right+left)/2.0;
    }
solve(mid+1e-18);
for(int i=0;i<ans.size();i++)
{
    if(i!=ans.size()-1)
        cout<<ans[i]<<" ";
    else
        cout<<ans[i]<<endl;
}
    return 0;
}

#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;

tuple<int,int,int> a[100005];

int main(){
    int n,m,s;
    scanf("%d%d%d",&n,&m,&s);
    for(int i=0;i<n;i++) scanf("%d",&get<0>(a[i]));
    for(int i=0;i<n;i++){
        scanf("%d",&get<1>(a[i]));
        get<2>(a[i])=i;
    }
    sort(a,a+n);
    double lo=0,hi=2e9,ans=0;
    for(int o=0;o<100;o++){
        double at=(lo+hi)/2;
        int cnt=0;
        for(int i=0;i<n;i++) if(get<1>(a[i])*at>=cnt*s+s) cnt++;
        if(cnt>=m) ans=hi=at; else lo=at;
    }
    int cnt=0;
    vector<int> u;
    for(int i=0;i<n;i++) if(get<1>(a[i])*ans*(1+1e-8)>=cnt*s+s){
        u.push_back(get<2>(a[i])+1);
        if(++cnt==m) break;
     }
     for(size_t i=0;i+1<u.size();i++) printf("%d ",u[i]);
     printf("%d\n",u.back());
}

#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
#include<numeric>
#include<iomanip>

using namespace std;

typedef long double ld;
typedef long long ll;

const ll MAXN = 1e5 + 10;
const ll MAXH = 1e4 + 10;

ll n, k, h, w[MAXN], vv[MAXN], vec[MAXN], ans[MAXN];

bool cmp(ll u, ll v){
	if (w[u] != w[v])
		return w[u] < w[v];
	return	vv[u] < vv[v];
}

bool ok(ld mid){
	ll x = h, cur = 0;
	for (ll i = 0; i < n; i++){
		ld t = ld(x)/ ld(vv[vec[i]]);
		if (t <= mid || abs(t - mid) < 1e-15)
			x += h, ans[cur++] = vec[i];
		if (cur >= k)	break;
	}
	return	cur >= k;
}

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> n >> k >> h;
	for (ll i = 0; i < n; i++)	cin >> w[i];
	for (ll i = 0; i < n; i++)	cin >> vv[i];
	iota(vec, vec + n, 0);
	sort(vec, vec + n, cmp);

	ld b = 0, e = 1e18;
	for (int i = 0; i < 400; i++){
		ld mid = (b + e)/ ld(2);
		if (ok(mid))
			e = mid;
		else
			b = mid;
	}
	ok(b + 1e-15);
	for (ll i = 0; i < k; i++)
		cout << ans[i] + 1 << " ";
	cout << "\n";
	return	0;
}

#include <functional>
#include <algorithm>
#include <stdexcept>
#include <iostream>
#include <sstream>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <cstdlib>
#include <cstring>
#include <utility>
#include <cctype>
#include <vector>
#include <string>
#include <bitset>
#include <cmath>
#include <queue>
#include <stdio.h>
#include <stack>
#include <ctime>
#include <list>
#include <map>
#include <set>
#include <assert.h>
#define REP(i,n) for(int i=0;i<n;i++)
#define TR(i,x) for(typeof(x.begin()) i=x.begin();i!=x.end();i++)
#define ALL(x) x.begin(),x.end()
#define SORT(x) sort(ALL(x))
#define CLEAR(x) memset(x,0,sizeof(x))
#define FILL(x,c) memset(x,c,sizeof(x))

using namespace std;

const double eps = 1e-8;

#define PB push_back
#define MP make_pair

typedef map<int,int> MII;
typedef map<string,int> MSI;
typedef vector<int> VI;
typedef vector<string> VS;
typedef vector<long double> VD;
typedef pair<int,int> PII;
typedef long long int64;
typedef long long ll;
typedef unsigned int UI;
typedef long double LD;
typedef unsigned long long ULL;

int n, k, h, ans[1000007];
pair<pair<int, int> , int> v[100007];

bool ok(long double time)
{
    int pick = 0, now = 0;
    for (int i = 0; i < n; ++i)
    {
        if ((now + 1) * h * 1.0 / v[i].first.second - time < 1e-12)
        {
            ans[now] = i;
            ++now;
        }
        if (now == k) return true;
    }
    return false;
}

int main()
{
    cin >> n >> k >> h;
    int a, b;
    REP(i, n)
    {
        scanf("%d", &a);
        v[i].first.first = a;
        v[i].second = i;
    }
    int mini = 0x7f7f7f7f;
    REP(i, n)
    {
        scanf("%d", &a);
        v[i].first.second  = a;
        mini = min(mini, a);
    }
    sort(v, v+n);
    long double left = 0.00, right = (k * h)*1.0 / mini;
    while (fabs(right - left) > 1e-12)
    {
        long double mid = (left + right) / 2.0;
        if (ok(mid))
            right = mid;
        else left = mid;
    }
  //  cout << left << endl;
    ok(left+1e-12);
    for (int i = 0;i < k; ++i)
    {
        if (i) printf(" ");
        printf("%d",v[ans[i]].second+1);
    }
    cout << endl;
    return 0;
}

/*
* Name :
* Source : VK Cup 2012 Round 2
* Date : 2012.03.25
* OJ : Codeforces
*/

#include <iostream>
#include <algorithm>

using namespace std;

const double EPS = 1e-6;
const int MAXN = 100000;

struct SLem
{
    int m;
    int v;
    int num;
};

SLem lem[MAXN];
int ans[MAXN];
int n, h, k;

inline bool cmp(const SLem &a, const SLem &b)
{
    return a.m > b.m;
}

bool check(double limit)
{
    int now = k;
    for (int i = 0; i < n; i++)
    {
        if ((double)h * now / lem[i].v <= limit)
        {
            ans[now] = i;
            if (--now == 0)
            {
                return true;
            }
        }
    }
    return false;
}

void init(void)
{
    cin >> n >> k >> h;
    for (int i = 0; i < n; i++)
    {
        cin >> lem[i].m;
    }
    for (int i = 0; i < n; i++)
    {
        cin >> lem[i].v;
        lem[i].num = i + 1;
    }
}

void solve(void)
{
    sort(lem, lem + n, cmp);
    double l = 0, r = 1e9;
    while (r - l > EPS)
    {
        double m = (l + r) / 2;
        check(m) ? r = m -  EPS : l = m + EPS;
    }
    check(l + EPS);
    cout << lem[ans[1]].num;
    for (int i = 2; i <= k; i++)
    {
        cout << ' ' << lem[ans[i]].num;
    }
    cout << endl;
}

int main(void)
{
    ios::sync_with_stdio(false);
    init();
    solve();
    return 0;
}

#include <bits/stdc++.h>
#define endl "\n"
#define FOR(x, y, z) for (int x = (y); x < (z); ++x)
#define FORR(x, y, z) for (int x = (y); x > (z); --x)
#define GET(a, n) for (int i = 0; i < (n); ++i) cin >> a[i];
#define GETM(a, n, m) for (int i = 0; i < (n); ++i) for (int j = 0; j < m; ++j) cin >> a[i][j];
#define PRINTM(a, n, m) for (int i = 0; i < (n); ++i) { for (int j = 0; j < m; ++j) cout << a[i][j] << " ";  cout << endl; };
#define PRINT(a, n) for (int i = 0; i < (n); ++i) cout << a[i] << " ";
#define IT(a) a.begin(), a.end()
#define DEB(a) cout << #a << " = " << a << endl; cout.flush();
#define DEBA(a) for (auto i: a) cout << i << " "; cout << endl;
#define IFDEB(b, a) if (b) { cout << #a << " = " << a << endl; cout.flush(); }
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
typedef vector <int> VI;
typedef vector <vector <int>> VVI;
typedef pair <int, int> PII;
const int MOD = 1000000007;
template <class T> typename T::value_type arr_sum(const T& v, int n) { typename T::value_type sum = 0; FOR(i, 0, n) sum += v[i]; return sum; }
struct Sync_stdio { Sync_stdio() { cin.tie(NULL); ios_base::sync_with_stdio(false); } } _sync_stdio;

struct Z
{
    LL v;
    LL m;
    int i;
};

long double EPS = 1e-15;

long double
bsearch_answer(long double l, long double r, int (*f)(long double t))
{
    while (r - l > EPS) {
        long double t = (l + r) / 2;
        int p = f(t);
        if (!p) {
            l = t;
            break;
        } else if (p > 0) {
            r = t;
        } else {
            l = t;
        }
    }
    return l;
}

vector <int> res;
vector <Z> v;
LL n, k, h;

int
f(long double t)
{
    res.erase(IT(res));
    LL j = 1;
    for (auto i: v) {
        if ((long double)(j * h) / i.v <= t) {
            ++j;
            res.push_back(i.i);
        }
    }
    if (res.size() < k) {
        return -1;
    }
    return 1;
}

int main()
{
    cin >> n >> k >> h;
    v.resize(n);
    FOR (i, 0, n) {
        v[i].i = i;
        cin >> v[i].m;
    }
    FOR (i, 0, n) {
        cin >> v[i].v;
    }
    sort(IT(v), [] (const Z &a, const Z &b) { return a.m == b.m ? a.v > b.v : a.m < b.m; });
    long double t = bsearch_answer(0, (long double)2000000000000000000.0, f);
    f(t + 3 * EPS);
    FOR (i, 0, k) {
        cout << res[i] + 1 << " ";
    }
    cout << endl;
}

#include<string>
#include<iostream>
#include<sstream>
#include<assert.h>
#include<cstdio>
#include<map>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<queue>
#include<functional>
#include<set>
#include<stack>
#include<cstdlib>
#include<cstring>
typedef long long int64;
#define long int64
#define var(q,s) typeof(s) q = s
#define for_each(q,s) for(var(q,(s).begin()); q!=(s).end(); q++)
using namespace std;

//=========================================================
// program:
//
/* lemmings*/ /*ledges*/ /*height factor*/
int n,k,h;
int m[100000];
int v[100000];

int ledge[100000];

pair<int,int> byVel[100000];

bool makeLedges(double t, bool deb = false)
{
    /*if (deb) {
        fill(ledge, ledge+k, -2);
        cout<<"::"<<t<<endl;
    }*/
    int j = n-1;
    set< pair<int,int> > lemmingWeight;
    int mostWeight = 2000000000;
    for (int i=k-1; i>=0; i--) {
        while (j>=0) {
            int weight = m[byVel[j].second];
            int vel    =   byVel[j].first;

            //maximum position we can place lemming i in.

            //pick max pos such that (pos+1)/vi <= t
            //                     (pos+1)    <= t * vi
            //                      pos       <= t * vi - 1
            int maxPos = floor(min<double>(t * vel,k) ) - 1;
            if (maxPos < i) {
                break;
            } else {
                if ( weight <= mostWeight ) {
                    lemmingWeight.insert( make_pair(-weight, byVel[j].second  ) );
                }
                j--;
            }
        }
        var(it, lemmingWeight.begin() );
        while ( (it != lemmingWeight.end()) && (-it->first > mostWeight) ) {
            lemmingWeight.erase(it);
            it = lemmingWeight.begin();
        }
        if (it != lemmingWeight.end()) {
            mostWeight = -it->first;
            ledge[i] = it->second;
            lemmingWeight.erase(it);
        } else {
            return false;
        }
    }
    return true;
}
/* height is useless */

void solve()
{
    for (int i=0; i<n; i++) {
        byVel[i] = make_pair(v[i],i);
    }
    sort(byVel,byVel+n);
    double hi = 100001.0, lo = 0;
    // { possible(hi) }
    // { impossible(lo) }
    for (int iter=0; iter<30; iter++) {
        double t = (hi+lo) / 2;
        if (makeLedges(t)) {
            hi = t;
        } else {
            lo = t;
        }

    }
    makeLedges(hi, true);
    for (int i=0; i<k; i++) {
        cout << (i?" ":"") << (ledge[i]+1);
    }
    cout << endl;

}

inline void init(){}
//=========================================================
// I/O:
//
int main()
{
    init();

    bool prev = false;
    while( cin >> n >> k >> h ) {
        if (prev) {
            cout << endl;
        }
        prev = true;
        for (int i=0; i<n; i++) {
            cin >> m[i];
        }
        for (int j=0; j<n; j++) {
            cin >> v[j];
        }
        solve();

    }
    return 0;
}

#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <utility>
#include <vector>

#define F first
#define S second
#define EPS 1e-8
#define INF 2000000000

#define SIZE_N 100010

typedef long long lnt ;
typedef std::pair< lnt , lnt > pll ;
typedef std::pair< int , int > pii ;

pii mp(int a , int b){return std::make_pair(a , b) ;}

int n , k , h ;
int mas[SIZE_N] ;
pll lem[SIZE_N] ;

double dp[SIZE_N] ;
std::vector< pii > dp1[SIZE_N] ;

int ans[SIZE_N] ;

int cmp_lem(pll a , pll b)
{
	//return a.F < b.F ;
	if(mas[a.S] == mas[b.S]) return a.F < b.F ; return mas[a.S] < mas[b.S] ;
}

int bs1(int le , int ri , double tar)
{
	if(le == ri) return le ;
	int mi = (le + ri >> 1) ;
	double val = dp[mi] ;
	//if(val + EPS < tar) return bs1(mi + 1 , ri , tar) ;
	if(val > tar + EPS) return bs1(le , mi , tar) ;
	return bs1(mi + 1 , ri , tar) ;
}

int chk(double tim)
{
	//printf("%.15llf\n" , tim) ;
	/*
	for(int i = 1 ; i <= n + 1 ; ++i)
	{
		dp[i] = INF , dp1[i].clear() ;
		dp1[i].push_back(mp(INF , INF)) ;
	}

	dp1[0].push_back(mp(-1 , -1)) ;

	int max = 0 ;
	for(int i = 0 ; i < n ; ++i)
	{
		double tem = tim * lem[i].F ;
		int p = bs1(0 , n , tem) ;
		if(p * h <= tem)// + EPS)
		{
			max = std::max(max , p) ;
			dp[p] = tem ;
			//dp1[p] = lem[i].S ;
			dp1[p].push_back(mp(lem[i].S , dp1[p - 1].size() - 1)) ;
		}
	}
	/**/
	/*
	for(int i = 1 ; i <= max ; ++i)
		printf("%.15llf " , dp[i]) ;
	puts("") ;
	for(int i = 1 ; i <= max ; ++i)
		printf("%d " , dp1[i]) ;
	puts("\n") ;
	/**/

	for(int i = 1 , j = 0 ; i <= k ; ++i)
	{
		while(j < n && i * h > tim * lem[j].F) ++j ;
		if(j == n) return 0 ;
		ans[i] = lem[j].S ;
		++j ;
	}

	return 1 ;
}

double bs(double le , double ri)
{
	if(le - EPS <= ri && ri <= le + EPS)
	{
		chk(ri) ;
		return ri ;
	}
	double mi = (le + ri) / 2 ;
	int val = chk(mi) ;
	if(val == 1) return bs(le , mi) ;
	if(val == 0) return bs(mi , ri) ;
}

int main(void)
{
	scanf("%d%d%d" , &n , &k , &h) ;
	for(int i = 0 ; i < n ; ++i)
		scanf("%I64d" , &mas[i]) ;
	for(int i = 0 ; i < n ; ++i)
		scanf("%I64d" , &lem[i].F) , lem[i].S = i ;

	std::sort(lem , lem + n , cmp_lem) ;
	/*
	for(int i = 0 ; i < n ; ++i)
		printf("%d " , lem[i].S) ;
	puts("") ;
	/**/
	bs(0 , INF) ;

	//print
	/*
	for(int i = k , p = 1 ; i >= 1 ; --i)
	{
		ans[i] = dp1[i][p].F ;
		p = dp1[i][p].S ;
	}
	/**/
	for(int i = 1 ; i <= k ; ++i)
		printf("%d " , ans[i] + 1) ;

	return 0 ;
}

#include <iostream>
#include <cstring>
#include <cstdio>
#include <algorithm>
using namespace std;
const int Maxn=1e5+10;

const int N=100009;

struct node
{
    int id,v;
    bool operator < (const node &r) const
    {
        if(v==r.v) return id<r.id;
        return v<r.v;
    }
} in[N];

int sum[21][N],tree[21][N];
long long _sum[N],lsum[21][N];

void b_tree(int l,int r,int dep)
{
    if(l==r)
    {
        tree[dep][l]=in[l].id;
        sum[dep][l]=lsum[dep][l]=0;
        return ;
    }
    int mid=(l+r)>>1;
    b_tree(l,mid,dep+1);b_tree(mid+1,r,dep+1);
    int lc=l,rc=mid+1,cnt=0;
    long long ss=0;
    for(int i=l; i<=r; i++)
    {
        if(lc<=mid && rc<=r)
        {
            if(tree[dep+1][lc]<tree[dep+1][rc]) ss+=_sum[tree[dep+1][lc]],cnt++,tree[dep][i]=tree[dep+1][lc++];
            else tree[dep][i]=tree[dep+1][rc++];
        }
        else if(lc<=mid) ss+=_sum[tree[dep+1][lc]],cnt++,tree[dep][i]=tree[dep+1][lc++];
        else tree[dep][i]=tree[dep+1][rc++];
        sum[dep][i]=cnt;
        lsum[dep][i]=ss;
    }
}

long long query_kth(int l,int r,int dep,int k,int tl,int tr)
{
    if(l==r) return tree[dep][l]?(_sum[tree[dep][l]]-_sum[tree[dep][l]-1]):_sum[tree[dep][l]];
    int mid=(l+r)>>1,tmp=((tl==l)?0:sum[dep][tl-1]);
    int cnt=sum[dep][tr]-tmp;
    if(cnt>=k) return query_kth(l,mid,dep+1,k,l+tmp,l+sum[dep][tr]-1);
    return query_kth(mid+1,r,dep+1,k-cnt,tl-l+1-tmp+mid,tr-l+1-sum[dep][tr]+mid);
}

struct Lem
{
    int m,v;
    int id;
    bool operator <(const Lem &a)const
    {
        if(m==a.m)return v<a.v;
        return m<a.m;
    }
}len[Maxn];
int n,k,h;
bool check(int mid)
{
    double l=1;
    for(int i=0;i<n;++i)
    {
        if(len[i].v>=l/k*mid)
        {
            l++;
        }
    }
    return l>k;
}
void work(int n,int k,int h)
{
    for(int i=0;i<n;++i)
        {
            scanf("%d",&len[i].m);
            len[i].id=i+1;
        }
        for(int i=0;i<n;++i)scanf("%d",&len[i].v);
        sort(len,len+n);
        int l=1,r=(int)1e9;
        while(l<=r)
        {
            int mid=(l+r)>>1;
            if(check(mid))l=mid+1;
            else r=mid-1;
        }
        double la=1;
        for(int i=0;i<n;++i)
        {
            if(len[i].v>=la/k*r)
            {
                la++;

                printf("%d ",len[i].id);
                 if(la>k)break;
            }
        }
        printf("\n");
}
int main()
{
//    freopen("in.txt","r",stdin);
    while(scanf("%d%d%d",&n,&k,&h)!=EOF)
    {
        work(n,k,h);
    }
    return 0;
}

#pragma GCC optimize ("O3")
#include <bits/stdc++.h>
#define loop(i,n) for(int i = 0;i < (n);i++)
#define all(A) A.begin(),A.end()
#define pb push_back
#define mp make_pair
#define sz(A) ((int)A.size())
typedef std::vector<int> vi;
typedef std::pair<int,int> pi;
typedef std::vector<pi> vp;
typedef long long ll;
#define popcnt(x) __builtin_popcount(x)
#define LSOne(x) ((x) & (-(x)))
#define print(A,t) cerr << #A << ": "; copy(all(A),ostream_iterator<t>(cerr," " )); cerr << endl
#define prArr(A,n,t)  cerr << #A << ": "; copy(A,A + n,ostream_iterator<t>(cerr," " )); cerr << endl
#define PRESTDIO() cin.tie(0),cerr.tie(0),ios_base::sync_with_stdio(0)
#define what_is(x) cerr << #x << " is " << x << endl
#define bit_lg(x) (assert(x > 0),__builtin_ffsll(x) - 1)
const double PI = acos(-1);
template<class A,class B>
std::ostream& operator << (std::ostream& st,const std::pair<A,B> p) {
	st << "(" << p.first << ", " << p.second << ")";
	return st;
}
using namespace std;

const double eps = 1e-14;
vi aux;
int n, K, h;

bool can(double t, const vector<pair<pi, int>> & A){
	aux.clear();
	for(auto [p, i] : A){
		auto [_, v] = p;
		ll big = floor(t*v);
		if(big > sz(aux)){
			aux.pb(i);
		}
		if(sz(aux) == K) return true;
	}
	return false;
}

int main(){
#ifdef HOME
	freopen("in.in", "r", stdin);
#endif
	scanf("%d %d %d", &n, &K, &h);
	vector<pair<pi, int>> A(n);
	loop(i, n) A[i].second = i+1;
	for(auto & [p, _] : A) scanf("%d", &p.first);
	for(auto & [p, _] : A) scanf("%d", &p.second);
	sort(all(A));
	double s = 0, e = 1e9;
	for(int t = 0; e-s > eps && t < 200; t++){
		double m = s + (e-s)/2.0;
		if(can(m, A)) e = m;
		else s = m;
	}
	s -= eps;
	while(!can(s, A)) s += eps;
//	cerr << "time is " << s << endl;
	loop(i, K) printf("%d ", aux[i]);
	puts("");
	return 0;
}

#include <iostream>
#include <algorithm>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <string>
#include <cmath>
#include <stack>
#include <queue>
#include <vector>
#include <map>
#include <set>
#include <bitset>
#include <ctime>
using namespace std;
#define ll long long
#define ull unsigned long long
#define mst(a,b) memset((a),(b),sizeof(a))
#define pii pair<int,int>
#define pII pair<ll,ll>
#define pi acos(-1)
#define pb push_back
const double eps = 1e-6;
const int inf = 0x3f3f3f3f;
const ll INF = 0x3f3f3f3f3f3f3f3f;
const int MAXN = 1e5 + 10;
const int MAXM = 1e6 + 10;

int n,k,h;

struct node {
    int m,v,id;
}a[MAXN];

bool cmp(node x,node y) {
    if(x.m != y.m) return x.m < y.m;
    return x.v < y.v;
}

bool judge(double tim) {
    int sum = 0;
    for(int i=0; i<n; i++) {
        if(a[i].v * tim >= (sum + 1) * h) sum++;
        if(sum >= k) return true;
    }
    return false;
}

int main() {
#ifdef local
    freopen("data.txt","r",stdin);
//    freopen("data.txt","w",stdout);
#endif
    int minv = 1e9;
    scanf("%d%d%d",&n,&k,&h);
    for(int i=0; i<n; i++)
        scanf("%d",&a[i].m);
    for(int i=0; i<n; i++) {
        scanf("%d",&a[i].v);
        minv = min(minv,a[i].v);
        a[i].id = i;
    }
    double l = 0, r = 1e9;
    double ans;
    sort(a,a+n,cmp);
    for(int i=0; i<200; i++) {
        double mid = (l + r) / 2;
        if(judge(mid)) {
            ans = mid;
            r = mid;
        }
        else l = mid;
    }
    if(n == 1000)
    printf("%lf\n",ans);
    int sum = 0;
    for(int i=0; i<n; i++) {
        if(a[i].v * ans >= (sum + 1) * h) {
            sum++;
            printf("%d ",a[i].id + 1);
        }
        if(sum >= k) break;
    }
    return 0;
}

#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
#include <cstring>
#include <cstdio>
#include <cstdlib>
#include <queue>
#include <map>
using namespace std;

struct blok
{
	int m;
	int v;
	int nom;
};

bool comp(blok b1, blok b2)
{
	if(b1.m == b2.m)
	{
		return b1.v < b2.v;
	}
	return b1.m < b2.m;
}

int n, k, h;

blok u[100005];
vector<int> ans;
vector<int> tmp_ans;

bool get_ans(double t)
{
	int i;
	int kk = 0;
	int cur_h = h;
	tmp_ans.clear();
	for(i = 0; i < n && kk < k; i++)
	{
		if(!((double(cur_h) / u[i].v + 1e-8) > t))
		{
			tmp_ans.push_back(u[i].nom);
			kk++;
			cur_h += h;
		}
	}
	if(kk >= k)
	{
		ans = tmp_ans;
		return true;
	}
	return false;
}

int main()
{
	scanf("%d%d%d", &n, &k, &h);
	int i;
	for(i = 0; i < n; i++)
	{
		scanf("%d", &u[i].m);
		u[i].nom = i + 1;
	}
	for(i = 0; i < n; i++)
	{
		scanf("%d", &u[i].v);
	}
	sort(u, u + n, comp);
	double st = 0;
	double end = 2000000000.0;
	while(st + (1e-8) < end)
	{
		double t = (st + end) / 2.0;
		if(get_ans(t))
		{
			end = t;
		}
		else
		{
			st = t;
		}
	}
	for(i = 0; i < k; i++)
	{
		printf("%d", ans[i]);
		if(i < k - 1) printf(" ");
	}
	printf("\n");
	return 0;
}

#include <algorithm>
#include <iostream>
#include <cstdio>

using namespace std;

int N, K, H;

int t[200000];

struct LEM
{
    int w, v, no;
    LEM(){}
    LEM(int _w, int _v){ w = _w; v = _v; }

    bool operator<(const LEM &p) const
    {
        return w < p.w || w == p.w && v < p.v;
    }
}lem[200000];

bool test(double p)
{
    int Ni = 0, Ki = 0;
    for( ; Ni < N && Ki < K; Ni++)
        if( (double)(lem[Ni].v)*p >= (double)(Ki+1)*(double)(H)*100 )
            t[Ki++] = lem[Ni].no;

    if( Ki == K ) return true;
    else return false;
}

int main()
{
    scanf("%d %d %d", &N, &K, &H);

    for(int Ni = 0; Ni < N; Ni++) lem[Ni].no = Ni+1;
    for(int Ni = 0; Ni < N; Ni++) scanf("%d", &lem[Ni].w);
    for(int Ni = 0; Ni < N; Ni++) scanf("%d", &lem[Ni].v);

    sort(lem, lem+N);

    double l = 0, r = 100000000000, mid;

    while( l+0.000000001 < r )
    {
        mid = (l+r)/2;

        if( test(mid) ) r = mid;
        else l = mid;
    }

    test(r);

    for(int Ki = 0; Ki < K; Ki++)
    {
        if( Ki ) printf(" ");
        printf("%d", t[Ki]);
    }
    puts("");
}

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

struct Fraction {
  long long n;  // numerator.
  long long d;  // denominator.

  Fraction(long long num, long long den) : n(num), d(den) {
    const long long g = __gcd(num, den);
    n /= g;
    d /= g;
  }

  bool operator<(const Fraction& f) const {
    return n * f.d < f.n * d;
  }

  bool operator<=(const Fraction& f) const {
    return n * f.d <= f.n * d;
  }

  bool operator>(const Fraction& f) const {
    return n * f.d > f.n * d;
  }

  bool operator>=(const Fraction& f) const {
    return n * f.d >= f.n * d;
  }

  bool operator==(const Fraction& f) const {
    return n == f.n && d == f.d;
  }

  bool operator!=(const Fraction& f) const {
    return n != f.n || d != f.d;
  }
};

struct Lemming {
  long long w;
  long long v;
  int index;
};

// Is it possible to distribute the lemmings over the ledges
// in <= t seconds.
// Complexity: O(N * log(N))
// If possible, lemmings_weights will contain the ideal configuration.
bool possible(const vector<Lemming>& lemmings,
              long long K, long long H, double t,
              vector<int>& config) {
  const int N = lemmings.size();
  long long num_placed = 0;
  for (int i = 0; i < N; ++i) {
    const double time_lemming = (num_placed + 1) * H / lemmings[i].v;
    if (time_lemming <= t) {
      config[num_placed] = lemmings[i].index;
      ++num_placed;
      if (num_placed == K) {
        return true;
      }
    }
  }
  return false;
}

int main() {
  long long N, K, H;
  cin >> N >> K >> H;
  vector<Lemming> lemmings(N);
  for (int i = 0; i < N; ++i) {
    cin >> lemmings[i].w;
    lemmings[i].index = i + 1;  // 1-based indexing.
  }
  for (int i = 0; i < N; ++i) {
    cin >> lemmings[i].v;
  }

  sort(lemmings.begin(), lemmings.end(), [] (const Lemming& a, const Lemming& b) {
    if (a.w != b.w) {
      return a.w < b.w;
    } else {
      return a.v < b.v;
    }
  });

  // // Binary search over Stern-Brocot tree to find smallest
  // // time (as a rational number) for which it's possible.
  // Fraction lo(0, 1);
  // Fraction hi(1, 0);
  // vector<int> lemmings_config_indices(K);
  // while (lo != hi) {
  //   // cout << lo.n << "/" << lo.d << "  " << hi.n << "/" << hi.d << endl;
  //   Fraction mid(lo.n + hi.n, lo.d + hi.d);  // Mediant.
  //   if (!possible(lemmings, K, H, mid, lemmings_config_indices)) {
  //     // R*
  //     long long max_k = 2;
  //     const long long INFTY = (long long) 1e9;
  //     while (lo.d + max_k * hi.d <= INFTY &&
  //            lo.n + max_k * hi.n <= INFTY) {
  //       max_k *= 2;
  //     }
  //     long long k_lo = 1;
  //     long long k_hi = max_k;
  //     while (k_lo + 1 < k_hi) {
  //       const long long k_mid = k_lo + (k_hi - k_lo) / 2;
  //       mid = Fraction(lo.n + k_mid * hi.n, lo.d + k_mid * hi.d);  // "k'th mediant"
  //       if (!possible(lemmings, K, H, mid, lemmings_config_indices)) {
  //         k_lo = k_mid;
  //       } else {
  //         k_hi = k_mid;
  //       }
  //     }
  //     lo = Fraction(lo.n + k_lo * hi.n, lo.d + k_lo * hi.d);
  //     hi = Fraction(lo.n + k_hi * hi.n, lo.d + k_hi * hi.d);
  //     if (k_hi == max_k) {
  //       // we're done. t_optimal = lo
  //       break;
  //     }
  //   } else {
  //     // L*
  //     long long max_k = 2;
  //     const long long INFTY = (long long) 1e9;
  //     while (lo.d * max_k + hi.d <= INFTY &&
  //            lo.n * max_k + hi.n <= INFTY) {
  //       max_k *= 2;
  //     }
  //     long long k_lo = 1;
  //     long long k_hi = max_k;
  //     while (k_lo + 1 < k_hi) {
  //       const long long k_mid = k_lo + (k_hi - k_lo) / 2;
  //       mid = Fraction(lo.n * k_mid + hi.n, lo.d * k_mid + hi.d);  // "k'th mediant"
  //       if (possible(lemmings, K, H, mid, lemmings_config_indices)) {
  //         k_lo = k_mid;
  //       } else {
  //         k_hi = k_mid;
  //       }
  //     }
  //     lo = Fraction(lo.n * k_lo + hi.n, lo.d * k_lo + hi.d);
  //     hi = Fraction(lo.n * k_hi + hi.n, lo.d * k_hi + hi.d);
  //     if (k_hi == max_k) {
  //       // we're done. t_optimal = lo
  //       break;
  //     }
  //   }
  // }

  vector<int> lemmings_config_indices(K);
  double lo = 0;
  double hi = 1e18;
  for (int i = 0; i < 200; ++i) {
    const double mid = lo + (hi - lo) / 2;
    if (possible(lemmings, K, H, mid, lemmings_config_indices)) {
      hi = mid;
    } else {
      lo = mid;
    }
  }
  // lo is optimal time.
  // cout << lo.n << "/" << lo.d << endl;
  // cout << hi.n << "/" << hi.d << endl;
  assert(possible(lemmings, K, H, hi, lemmings_config_indices));
  for (int index : lemmings_config_indices) {
    cout << index << " ";
  }
  cout << endl;
}

//In the name of God
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;

struct element
{
  int number;
  int weight;
  int speed;
};

const int MAXN=1e5+100;
int n,h;

element all[MAXN];

bool st(element a,element b)
{
  if(a.weight!=b.weight)
    return (a.weight<b.weight);
  else
    return (a.speed<b.speed);
}

bool canfill(long long maxtime,int k)
{
  //cerr<<"canfill"<<endl;
  long long cost=h*k;
  int index=n-1;
  while(cost>0)
    {
      if(index<0)
	{
	  // cerr<<"end1"<<endl;
	return false;
	}
      if(maxtime*all[index].speed>=cost)
	cost-=h;
      index--;
    }
  // cerr<<"end"<<endl;
  return true;
}

void print(long long maxtime,int k)
{
  vector<element> a;
  long long cost=h*k;
  int index=n-1;
  while(cost>0)
    {
      if(maxtime*all[index].speed>=cost)
	{
	cost-=h;
	a.push_back(all[index]);
	}
      index--;
    }
  for(int i=a.size()-1;i>=0;--i)
    cout<<a[i].number<<" ";
}

int main()
{
  int k;
  cin>>n>>k>>h;
  for(int i=0;i<n;++i)
    {
      cin>>all[i].weight;
      all[i].number=i+1;
    }
  for(int i=0;i<n;++i)
    cin>>all[i].speed;
  sort(all,all+n,st);
  long long up=1e10,down=0;
  long long mid;
  long long best=-1ull/2;
  while(up>=down)
    {
      mid=(up+down)/2;
      // cerr<<"mid:"<<mid<<endl;
      if(canfill(mid,k))
	{
	  best=min(best,mid);
	  up=mid-1;
	}
      else
	down=mid+1;
    }
  //cerr<<"b:"<<best<<endl;
  print(best,k);
  return 0;
}

#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <ctime>
using namespace std;

const int oo=200005;
#define eps 1e-10

struct tp
{
	int m,v,x;
}a[oo];
int n,m,h;
double L,R,res;
int b[oo];

bool cmp(const tp a,const tp b)
{
	return a.m<b.m || a.m==b.m && a.v<b.v;
}

bool check(double t)
{
	int p=1,cnt=0;
	for (;p<=n && cnt<m;){
		if (n-p+1<m-cnt) return 0;
		for (;p<=n && a[p].v*t+eps<cnt+1;++p);
		if (p<=n && a[p].v*t+eps>cnt+1){
			b[++cnt]=p;
			++p;
		}
	}
	if (cnt==m) return 1;
	return 0;
}

int main()
{
//	freopen("input.txt","r",stdin);

	scanf("%d%d%d",&n,&m,&h);

	for (int i=1;i<=n;++i) scanf("%d",&a[i].m);
	for (int i=1;i<=n;++i){
		scanf("%d",&a[i].v);
		a[i].x=i;
	}

	sort(a+1,a+n+1,cmp);

	L=0,R=n;

	for (int i=0;L+eps<R && i<100;++i){
		double mid=(L+R)/2;
//		cout << mid <<  endl;
		if (check(mid)){
			res=mid;
			R=mid;
		}else L=mid;
	}

	check(res);

/*	b[m+1]=n+1;
	for (int i=m;i>=1;--i){
		for (int j=b[i]+1;j<b[i+1];++j)
		if (a[j].v>=a[b[i]].v) b[i]=j;
	}
*/
	for (int i=1;i<=m;++i) printf("%d%c",a[b[i]].x,i<m ? ' ':'\n');
	return 0;
}

#include<iostream>
#include<string.h>
#include<algorithm>
#include<string>
#include<vector>
#include<stdio.h>
#include<math.h>
using namespace std;
int b[100010],c[100010];
pair<pair<int ,int > ,int> a[100001];
int main(){
    vector<int> v1,v2,v3;

    int n,k,m,h,v,i,j,l,p;
    double t,max1,min1,t2,t1=100000000000000,t3=1000000000000000;

    cin>>n>>k>>h;
    for(i=1;i<=n;i++)
    {
        cin>>b[i];
    }
    for(i=1;i<=n;i++)
    {
        cin>>c[i];

    }
    for(i=1;i<=n;i++)
    {

        a[i]=make_pair(make_pair(b[i],c[i]),i);

    }
    sort(a+1,a+n+1);
    max1=100000000000;
    min1=0;

    while(1){t=(max1+min1)/2;
        l=1;
        if(abs(t1-t)<0.000001)
            break;
        for(i=1;i<=n;i++){
            p=a[i].first.second;
            if(((double)(l*h)/p)<=t)
            {
                v1.push_back(a[i].second);
                l++;
            }}
            if(v1.size()==k)
            {
                if(t<t3){
                    v3=v1;t3=t;

                }
                max1=t;
                v1=v2;
            }
            else
                if(v1.size()<k)
                {
                    min1=t;
                    v1=v2;

                }
                else{
                    max1=t;
                    v1=v2;}
                t1=t;
        }

    for(i=0;i<v3.size();i++)
        cout<<v3[i]<<" ";

//system("pause");
    return 0;
}

#include <iostream>
#include <cmath>
#include <vector>
#include <string>
#include <set>
#include <map>
#include <algorithm>
#include <queue>

using namespace std;

int v[100146], m[100146];
priority_queue<pair<int, int> > s;
vector<int> ans;
bool used[100146];
int p[100146];
int n, k, h;

bool cmp(const int & a, const int & b)
{
    return v[a] < v[b];
}

bool doubleMoreOrEqual(double a, double b)
{
    return a > b || fabs(a - b) < 1e-9;
}

void solve(double t)
{
    while(!s.empty())
        s.pop();
    ans.clear();
    int cur = n - 1;
    int lastLem = 1000000001;
    memset(used, false, sizeof(used));
    for(int i = k; i >= 1; i--)
    {
        while(cur >= 0 && doubleMoreOrEqual(t * v[p[cur]], i * h))
        {
            s.push(make_pair(m[p[cur]], p[cur]));
            cur--;
        }
//      printf("%d\n", cur);
        while(!s.empty() && (s.top().first > lastLem || used[s.top().second]))
            s.pop();
        if(s.empty())
            return;
        ans.push_back(s.top().second);
        lastLem = s.top().first;
        s.pop();
    }
}

int main()
{
    scanf("%d%d%d", &n, &k, &h);
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &m[i]);
    }
    for(int i = 0; i < n; i++)
    {
        scanf("%d", &v[i]);
    }
    for(int i = 0; i < n; i++)
        p[i] = i;
    sort(p, p + n, cmp);
    double l = 0;
    double r = 1e9;
    for(int _ = 0; _ < 60; _++)
    {
        double mid = (l + r) / 2;
        solve(mid);
        //printf("%.10lf: %d\n", mid, ans.size());
        if((int)ans.size() == k)
            r = mid;
        else
            l = mid;
    }
    solve(r);
    reverse(ans.begin(), ans.end());
//  printf("%.10lf\n", l);
    for(int i = 0; i < ans.size(); i++)
        printf("%d ", ans[i] + 1);
}

#include<bits/stdc++.h>
using namespace std;
#define ll long long
ll read() {
	ll x=0, f=1; char ch=' ';
	while(!isdigit(ch)) {ch=getchar(); if(ch=='-') f=-1;}
	while(isdigit(ch)) x=(x<<3)+(x<<1)+(ch^48), ch=getchar();
	return x*f;
}
int n, k, h, ans[100005], cnt;
long double eps=1e-20;
struct AB{
	int id, m, v;
	bool operator < (const AB &A) const{
		if(m!=A.m) return m<A.m;
		return v<A.v;
	}
}a[100005];
bool check(long double mid) {
	int now=1;
	memset(ans, 0, sizeof(ans));
	for(int i=1;i<=n;i++) {
		if((long double)now*h<=(mid+eps)*(long double)a[i].v) ans[now++]=i;
	}
	return now>k;
}
int main() {
	cin>>n>>k>>h;
	for(int i=1;i<=n;i++) a[i].id=i;
	for(int i=1;i<=n;i++) a[i].m=read();
	for(int i=1;i<=n;i++) a[i].v=read();
	sort(a+1, a+n+1);
	long double l=1, r=k*h, mid;
	while(r-l>=eps&&++cnt<=1000) {
		mid=(l+r)/2;
		if(check(mid)) r=mid;
		else l=mid;
	}
	//cout<<r<<endl;
	check(r);
	for(int i=1;i<=k;i++) printf("%d ", a[ans[i]].id);
}

#include <iostream>
#include <algorithm>
using namespace std;
const int N = 101010;
const double eps = 1e-6;
int n, k, h;
int ans[N];
int stk[N];
int top;
struct Node
{
    int m, ind;
    int v;
}data[N];

bool operator < (const Node &A, const Node &B)
{
    if (A.m != B.m)
        return A.m < B.m;
    return A.v < B.v;
}

bool judge (double key)
{
    int i;
    top = 0;
    for (i = 0; i < n; i ++)
    {
        if (1.0 * (top + 1) / data[i].v < key + eps)
        {
            stk[top ++] = data[i].ind;
            if (top == k)
                break;
        }
    }
    return top == k;
}

int main ()
{
    while (scanf ("%d%d%d", &n, &k, &h) != EOF)
    {
        int i;
        for (i = 0; i < n; i ++)
            scanf ("%d", &data[i].m);
        for (i = 0; i < n; i ++)
        {
            int temp;
            scanf ("%d", &temp);
            data[i].v = temp;
            data[i].ind = i + 1;
        }
        sort (data, data + n);
        double ll = 0;
        double rr = k * 1.0 + 1;
        double dd;
        while (rr - ll > eps)
        {
            dd = (ll + rr) / 2;
            if (judge (dd))
                rr = dd;
            else
                ll = dd;
        }
        judge(rr);
        for (i = 0; i < top - 1; i ++)
            printf ("%d ", stk[i]);
        printf ("%d\n", stk[i]);
    }
}

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

struct Fraction {
  long long n;  // numerator.
  long long d;  // denominator.

  Fraction(long long num, long long den) : n(num), d(den) {
    const long long g = __gcd(num, den);
    n /= g;
    d /= g;
  }

  bool operator<(const Fraction& f) const {
    return n * f.d < f.n * d;
  }

  bool operator<=(const Fraction& f) const {
    return n * f.d <= f.n * d;
  }

  bool operator>(const Fraction& f) const {
    return n * f.d > f.n * d;
  }

  bool operator>=(const Fraction& f) const {
    return n * f.d >= f.n * d;
  }

  bool operator==(const Fraction& f) const {
    return n == f.n && d == f.d;
  }

  bool operator!=(const Fraction& f) const {
    return n != f.n || d != f.d;
  }
};

struct Lemming {
  long long w;
  long long v;
  int index;
};

// Is it possible to distribute the lemmings over the ledges
// in <= t seconds.
// Complexity: O(N * log(N))
// If possible, lemmings_weights will contain the ideal configuration.
bool possible(const vector<Lemming>& lemmings,
              long long K, long long H, const Fraction& t,
              vector<int>& config) {
  const int N = lemmings.size();
  int num_placed = 0;
  for (int i = 0; i < N; ++i) {
    const Fraction t_lemming((num_placed + 1) * H, lemmings[i].v);
    if (t_lemming <= t) {
      config[num_placed] = lemmings[i].index;
      ++num_placed;
      if (num_placed == K) {
        return true;
      }
    }
  }
  return false;
}

int main() {
  long long N, K, H;
  cin >> N >> K >> H;
  vector<Lemming> lemmings(N);
  for (int i = 0; i < N; ++i) {
    cin >> lemmings[i].w;
    lemmings[i].index = i + 1;  // 1-based indexing.
  }
  for (int i = 0; i < N; ++i) {
    cin >> lemmings[i].v;
  }

  sort(lemmings.begin(), lemmings.end(), [] (const Lemming& a, const Lemming& b) {
    if (a.w != b.w) {
      return a.w < b.w;
    } else {
      return a.v < b.v;
    }
  });

  // Binary search over Stern-Brocot tree to find smallest
  // time (as a rational number) for which it's possible.
  Fraction lo(0, 1);
  Fraction hi(1, 0);
  vector<int> lemmings_config_indices(K);
  while (lo != hi) {
    // cout << lo.n << "/" << lo.d << "  " << hi.n << "/" << hi.d << endl;
    Fraction mid(lo.n + hi.n, lo.d + hi.d);  // Mediant.
    if (!possible(lemmings, K, H, mid, lemmings_config_indices)) {
      // R*
      long long max_k = 2;
      const long long INFTY = (long long) 1e9;
      while (lo.d + max_k * hi.d <= INFTY &&
             lo.n + max_k * hi.n <= INFTY) {
        max_k *= 2;
      }
      long long k_lo = 1;
      long long k_hi = max_k;
      while (k_lo + 1 < k_hi) {
        const long long k_mid = k_lo + (k_hi - k_lo) / 2;
        mid = Fraction(lo.n + k_mid * hi.n, lo.d + k_mid * hi.d);  // "k'th mediant"
        if (!possible(lemmings, K, H, mid, lemmings_config_indices)) {
          k_lo = k_mid;
        } else {
          k_hi = k_mid;
        }
      }
      lo = Fraction(lo.n + k_lo * hi.n, lo.d + k_lo * hi.d);
      hi = Fraction(lo.n + k_hi * hi.n, lo.d + k_hi * hi.d);
      if (k_hi == max_k) {
        // we're done. t_optimal = lo
        break;
      }
    } else {
      // L*
      long long max_k = 2;
      const long long INFTY = (long long) 1e9;
      while (lo.d * max_k + hi.d <= INFTY &&
             lo.n * max_k + hi.n <= INFTY) {
        max_k *= 2;
      }
      long long k_lo = 1;
      long long k_hi = max_k;
      while (k_lo + 1 < k_hi) {
        const long long k_mid = k_lo + (k_hi - k_lo) / 2;
        mid = Fraction(lo.n * k_mid + hi.n, lo.d * k_mid + hi.d);  // "k'th mediant"
        if (possible(lemmings, K, H, mid, lemmings_config_indices)) {
          k_lo = k_mid;
        } else {
          k_hi = k_mid;
        }
      }
      lo = Fraction(lo.n * k_lo + hi.n, lo.d * k_lo + hi.d);
      hi = Fraction(lo.n * k_hi + hi.n, lo.d * k_hi + hi.d);
      if (k_hi == max_k) {
        // we're done. t_optimal = lo
        break;
      }
    }
  }

  // vector<int> lemmings_config_indices(K);
  // double lo = 0;
  // double hi = 1e18;
  // while ((hi - lo) > 1e-15) {
  //   const double mid = lo + (hi - lo) / 2;
  //   if (possible(lemmings, K, H, mid, lemmings_config_indices)) {
  //     hi = mid;
  //   } else {
  //     lo = mid;
  //   }
  // }
  // lo is optimal time.
  // cout << (double) lo.n / lo.d << endl;
  assert(possible(lemmings, K, H, lo, lemmings_config_indices));
  for (int index : lemmings_config_indices) {
    cout << index << " ";
  }
  cout << endl;
}

#include <fstream>
#include <iostream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>

using namespace std;

const long mod=1000000007;

struct str
{
	long m;
	long double v;
	long num;
};

bool mf(str a, str b)
{
	return (a.m==b.m ? a.v<b.v : a.m<b.m);
}

int main()
{
	//ifstream cin("input.txt");
	//ofstream out("output.txt");
	long double k,n,h;
	cin>>n>>k>>h;
	vector < str > mass(n);
	for(long i=0;i<n;i++)
	{
		cin>>mass[i].m;
		mass[i].num=i+1;
	}
	for(long i=0;i<n;i++)
		cin>>mass[i].v;

	sort(mass.begin(),mass.end(),mf);
	long double l=0, r=n*h, m, kol;
	while(r-l>=0.00000001)
	{
		m=(l+r)/2;
		kol=0;
		for(long i=0;i<n;i++)
			if((kol+1)*h/mass[i].v<=m)
				kol++;
		if(kol<k)
			l=m;
		else
			r=m;
	}
	kol=0;
	for(long i=0;i<n && kol<k;i++)
		if((kol+1)*h/mass[i].v<=r)
		{
			cout<<mass[i].num<<" ";//<<((kol+1)*h+mass[i].v-1)/mass[i].v<<"\n";
			kol++;
		}
}

#include <cstdio>
#include <iostream>
#include <algorithm>

#define eps 0

using namespace std;

struct case1
{
 long m,v,num;
}lem[200005]={0};

bool cmp(case1 a,case1 b)
{
 return a.m<b.m||a.m==b.m&&a.v<b.v;
}

int main()
{
 long n,k,h;
 long i,j;
 double l,r,t;
 long tt=0;

 scanf("%ld%ld%ld",&n,&k,&h);
 for(i=1;i<=n;i++)
   scanf("%ld",&lem[i].m);
 for(i=1;i<=n;i++)
   scanf("%ld",&lem[i].v);
 for(i=1;i<=n;i++)
   lem[i].num=i;
 sort(lem+1,lem+n+1,cmp);
 for(l=0,r=1000000000;tt<=100;tt++)
   {
    t=(l+r)/2;
    for(i=1,j=1;i<=k;i++)
      {
       for(;(double)lem[j].v*t-eps<(double)i*h&&j<=n;j++);
       if(j>n)
        {
         l=t;
         goto loop;
        }
       j++;
      }
    r=t;
    loop:;
   }
 t=r;
 for(i=1,j=1;i<=k;i++)
      {
       for(;(double)lem[j].v*t-eps<(double)i*h&&j<=n;j++);
       printf("%ld ",lem[j].num);
       j++;
      }

 return 0;
}

#include<cstdio>
#include<cstdlib>
#include<vector>
#include<map>
#include<set>
#include<queue>
#include<stack>
#include<functional>
#include<algorithm>
#include<limits>
#include<utility>
#define PB push_back
#define MP make_pair
#define _F first
#define _S second
#define PP system("PAUSE");
#define EPS 1e-9

using namespace std;

struct XD{
    int first, No;
    double second;
    bool operator <(XD A) const{
        if(first == A.first) return second < A.second;
        return first < A.first;
        }
    };

int N, K, H;
XD P[100010];
int ans[100010];

bool chk(double tar){//printf("%lf\n", tar);printf("==>%lf\n", (K*H)/P[N-1]._S);system("PAUSE");
    ans[0] = ans[1] = -1;
    int nowpos = K;
    int nowlem = N-1;
    while(1){
        if(nowpos==0 || nowlem==-1) break;
        if((nowpos*H)/P[nowlem]._S <= tar){
            ans[nowpos] = nowlem;
            nowpos--;
            }
        nowlem--;
        }
    if(ans[1] == -1) return false;
    return true;
    }

int main(void){
    scanf("%d%d%d", &N, &K, &H);
    for(int i = 0; i < N; i++)
        scanf("%d", &P[i]._F);
    for(int i = 0; i < N; i++)
        scanf("%lf", &P[i]._S);
    for(int i = 0; i < N; i++)
        P[i].No = i;
    sort(P, P+N);
    /*for(int i = 0; i < N; i++)
        printf("%d ", P[i].No);puts("");*/
    double L, R, Mid;
    L = 0, R = 1000000001;
    double tempans;
    while(R-L > EPS){
        Mid = (L+R)/2;
        if(chk(Mid)){R = Mid; tempans = Mid;}
        else{L = Mid+(1e-8); tempans = Mid+(1e-8);}
        }//printf("t=%lf\n", tempans);
    chk(tempans);
    printf("%d", P[ans[1]].No+1);
    for(int i = 2; i <= K; i++) printf(" %d", P[ans[i]].No+1);
    return 0;
    }

#include <vector>
#include <map>
#include <set>
#include <list>
#include <deque>
#include <queue>
#include <string>
#include <algorithm>
#include <utility>
#include <sstream>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <iostream>

using namespace std;

const long double EPS = 1e-15;
int n, k, h;

bool poss(long double m, vector<pair<int, pair<int, int> > >& lems, vector<int>& res)
{
    int j = 1;

    for (int i = 0; i < n && j <= k; ++i) {
        if (j * h <= m * lems[i].second.first)
        {
            res[j - 1] = lems[i].second.second;
            ++j;
        }
    }

    if (j > k) {
        return true;
    } else {
        return false;
    }
}

int main(void)
{
    long double l , r, m;
    int mass, v;

    vector<pair<int, pair<int, int> > > lems;
    vector<int> res;

    cin >> n >> k >> h;

    res.assign(k, 0);

    for (int i = 0; i < n; ++i) {
        cin >> mass;
        lems.push_back(make_pair(mass, make_pair(0, i)));
    }

    for (int i = 0; i < n; ++i) {
        cin >> v;
        lems[i].second.first = v;
    }

    sort(lems.begin(), lems.end());

    l = 0, r = 1e9;

    while (r - l > EPS) {
        m = l + (r - l) / 2.;

        if (poss(m, lems, res)) {
            r = m;
        } else {
            l = m;
        }

    }

    poss(r, lems, res);

    for (int i = 0; i < k; ++i) {
        cout << (res[i] + 1) << " ";
    }

    cout << "\n";

    return 0;
}

/*
I ain't got a fever got a permanent disease
It'll take more than a doctor to prescribe a remedy
I got lots of money but it isn't what I need
Gonna take more than a shot to get this poison out of me
I got all the symptoms count 'em 1,2,3

First you need
That's what you get for falling in love
Then you bleed
You get a little but it's never enough
On your knees
That's what you get for falling in love
And now this boy's addicted cause your kiss is the drug

Your love is like bad madicine
Bad medicine is what I need
Shake it up, just like bad madicine
There ain't no doctor that can
Cure my disease

Bad, bad medicine
Bad, bad medicine

I don't need no needle
To be giving me a thrill
And I don't need no anesthesia
Or a nurse to bring a pill
I got a dirty down addiction
It doesn't leave a track
I got a jone for your affection
Like a monkey on my back

There ain't no paramedic
Gonna save this heart attack

When you need
That's what you get for falling in love
Then you bleed
You get a little but it's never enough
On your knees
That's what you get for falling in love
Now I'm addicted and your kiss is the drug

Your love is like bad madicine
Bad medicine is what I need
Shake it up, just like bad madicine
So let's play doctor, baby
Cure my disease

Bad, bad medicine
Bad, bad medicine

I need a respirator cause I'm running out of breath
You're an all night generator wrapped is stockings and a dress
When you find your medicine you take what you can get
Cause if there's something better baby well thay haven't found it yet

Your love is like bad madicine
Bad medicine is what I need
Shake it up, just like bad madicine
There ain't no doctor that can
Cure my disease

Your love is like bad madicine
Bad medicine is what I need
Shake it up, just like bad madicine
Your love's the potion that
Can cure my disease

Bad, bad medicine
Bad, bad medicine
*/

#include <iostream>
#include <fstream>
#include <string>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>

#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define INF 1000000000
#define eps 1e-10
#define M_PI 3.141592653589793

//#define mx 1000000000000ll
#define bs 1000000007
//#define szz 400
//#define pb push_back

using namespace std;
vector <long> ans;
long n,q,k,h,m[200000],v[200000];
pair <long, long> p;
pair <pair <long, long> ,long > pp;
vector <pair <pair <long, long> ,long > > ve;
long double l,mm,r;

int main(){
//freopen("C:/aver.txt","r",stdin);
//freopen("C:/output.txt","w",stdout);
cin>>n>>k>>h;

for (int i=1;i<=n;i++)
{
    cin>>m[i];
}

for (int i=1;i<=n;i++)
{
    cin>>v[i];
}

for (int i=1;i<=n;i++)
{p=make_pair(m[i],v[i]);
pp=make_pair(p,i);
ve.push_back(pp);
}

l=0;
r=1000000001;

sort(ve.begin(),ve.end());

long iters=0;

while (iters<100)
{
      ++iters;
      q=0;
      mm=l+r;
      mm/=2;

      for (int i=0;i<ve.size();i++)
      {
          if (q<k)
          if (h*1.0*(q+1)<=mm*ve[i].first.second)q++;
      }
      if (q==k)r=mm; else l=mm;
}

//cout<<mm<<endl;
q=0;
mm=l;
    for (int i=0;i<ve.size();i++)
      {
          if (q<k)
          if (h*1.0*(q+1.0)/(ve[i].first.second)<mm+eps){q++;ans.push_back(ve[i].second);}
      }

for (int i=0;i<ans.size();i++)
{if (i)cout<<" ";
 cout<<ans[i];}

 cout<<endl;

cin.get();cin.get();
return 0;}

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

const int N = 1e5 + 5;
dou v[N];
dou m[N];
int n, k, h;
int idex[N];
int resu[N];

bool cmp(int i, int j) {
    return m[i] < m[j] || (m[i] == m[j] && v[i] < v[j]);
}

void Enter() {
    cin >> n >> k >> h;
    for (int i = 1; i <= n; i++)
        cin >> m[i];
    for (int i = 1; i <= n; i++)
        cin >> v[i];
    for (int i = 1; i <= n; i++)
        idex[i] = i;
    sort(idex + 1, idex + n + 1, &cmp);
}

bool kiemtra(dou t) {
    int iter = 1;
    for (int i = 1; i <= n; i++)
        if (v[idex[i]] * t >= (dou) iter * h)
            resu[iter++] = idex[i];
    return iter > k;
}

void Solve() {
    dou l = 0, r = h * k, mid;
    for (int i = 1; i <= 100; i++) {
        mid = (l + r) / 2;
        if (kiemtra(mid)) r = mid;
        else              l = mid;
    }
    kiemtra(r);
}

void Print() {
    for (int i = 1; i <= k; i++)
        cout << resu[i] << ' ';
}

int main() {
    ios_base::sync_with_stdio(0);
    //freopen("a.inp", "r", stdin);
    cin.tie(0); cout.tie(0);
        Enter();
        Solve();
        Print();
    return 0;
}

#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
using namespace std;

const double eps = 1e-9;

int m[100005], v[100005], srt[100005];
int ans[100005], ansCur[100005];
int n, k, h;

bool cmp (int d1, int d2) {
	if (m[d1] == m[d2])
		return v[d1] < v[d2];
	return m[d1] < m[d2];
}

bool isGood (double curTime) {
	int i, curI;

	int ptr = 0;

	for (i = 0;i < n && ptr < k;i++) {
		curI = srt[i];
		if (h * 1LL * (ptr + 1) < curTime * v[curI] + eps) {
			ansCur[ptr] = curI;
			ptr++;
		}
	}

	return ptr == k;
}

int main () {
	//freopen("input.txt", "rt", stdin);
	//freopen("output.txt", "wt", stdout);
	int i;

	scanf("%d%d%d", &n, &k, &h);
	for (i = 0;i < n;i++) {
		scanf("%d", &m[i]);
	}
	for (i = 0;i < n;i++) {
		scanf("%d", &v[i]);
	}

	for (i = 0;i < n;i++)
		srt[i] = i;
	sort(srt, srt + n, cmp);

	double l = 0, r = 1e9, mid;
	double res = 0;

	int it = 0;
	while (it < 200) {
		mid = (l + r) / 2;
		if (isGood(mid)) {
			for (i = 0;i < k;i++)
				ans[i] = ansCur[i];
			r = mid;
		}else
		{
			l = mid;
		}
		it++;
	}

	for (i = 0;i < k;i++) {
		if (i)
			printf(" ");
		printf("%d", ans[i] + 1);
	}
	return 0;
}

#include<bits/stdc++.h>
using namespace std;
#define all(x) begin(x), end(x)
using ll = long long;
const int maxn = 101;
int k, n, h;
vector<array<int, 3>> a;
vector<int> can(ll t) {
	auto b = a;
	reverse(all(b));
	vector<int> ans;
	for(int i = 1; i <= k; i++) {
		while(!b.empty() && b.back()[1]*t <= h*i) b.pop_back();
		if(b.empty()) return {};
		ans.push_back(b.back()[2]);
		b.pop_back();
	}
	return ans;
}
int main() {
	cin.tie(0)->sync_with_stdio(0);
	cin >> n >> k >> h;
	a = vector<array<int, 3>> (n);
	int tmp = 0;
	for(auto &i : a) cin >> i[0], i[2] = tmp++;
	for(auto &i : a) cin >> i[1];
	sort(all(a));
	int ans = 0;
	for(int i = 1<<30; i>>=1;) ans += !can(ans+i).empty();
	for(auto &i : can(ans)) cout << i+1 << " ";
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <iomanip>
using namespace std;

typedef pair <int, int>  pii;

const int MAXN = 1e5 + 5, inf = 1e18 + 7;
int n, k;
long double h;
int Arr[MAXN];
long double eps = 1e-5;
pair <pair <int, long double>, int> v[MAXN];
vector <int> ans;

bool can(long double t) {
    for (int i = 0; i < n; i++)
        Arr[i] = (t * v[i].first.second) / h;
    int f = k;
    for (int i = n - 1; i > -1; i--) {
        if (Arr[i] >= f)
            f--;
        if (!f)
            break;
    }
    return !f;
}

int main() {
    cin >> n >> k >> h;
    for (int i = 0; i < n; i++)
        cin >> v[i].first.first;
    for (int i = 0; i < n; i++) {
        cin >> v[i].first.second;
        v[i].second = i + 1;
    }
    sort(v, v + n);
    long double s = 0, e = 1e9 + 7;
    for (int i = 0; i < 100; i++) {
        long double m = (e + s) / 2;
        if (can(m))
            e = m;
        else
            s = m;
    }
    if (n == 100) {
        cout << fixed << setprecision(6) << "\n";
    }
    for (int i = 0; i < n; i++)
        Arr[i] = (e * v[i].first.second) / h;
    int f = k;
    for (int i = n - 1; i > -1; i--) {
        if (Arr[i] >= f) {
            ans.push_back(v[i].second);
            f--;
        }
        if (!f)
            break;
    }
    for (int i =  k - 1; i > -1; i--)
        cout << ans[i] << " ";
    return 0;
}

#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <algorithm>
using namespace std;

typedef long long ll;
typedef pair<int,int> pii;

struct LEM
{
    int m;
    int v;
    int id;
    bool operator<(const LEM& b) const { return m==b.m?v < b.v:m<b.m; }
};
LEM lemm[100010];

bool verify(int n,int k,int h,double T)
{
    //int output=rand()%1;
    int pickout = 0;
    for(int i = 0;i < n;i++)
    {
        if(((double)(h*(pickout+1))) <= (double)lemm[i].v*T)
        {
            //if(output) puts("FUCK THIS PROBLEM. JUST GO TO THE HELLLLLLL.");
            pickout++;
            if(pickout >= k) break;
        }
    }
    return pickout >= k;
}

int main(void)
{
    int n = 0;
    int k = 0;
    int h = 0;
    scanf("%d %d %d",&n,&k,&h);
    for(int i = 0;i < n;i++) scanf("%d",&lemm[i].m);
    for(int i = 0;i < n;i++) scanf("%d",&lemm[i].v);
    for(int i = 0;i < n;i++) lemm[i].id = i+1;
    sort(lemm,lemm+n);
    double l = 0;
    double r = 10000000000;
    int fuck = 200;
    while(fuck--)
    {
        double mid = (l+r)/2.0;
        if(verify(n,k,h,mid)) r = mid;
        else l = mid;
    }
    int pickout = 0;
    for(int i = 0;i < n;i++)
    {
        if((double)((pickout+1)*h) <= (double)lemm[i].v*r)
        {
            printf("%d ",lemm[i].id);
            pickout++;
            if(pickout >= k) break;
        }
    }
    putchar('\n');
    while(getchar() != EOF);
    return 0;
}

#pragma comment(linker,"/STACK:64000000")
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <map>
#include <set>
#include <sstream>
#include <cmath>
#include <ctime>
#include <memory.h>

#define WR printf
#define RE scanf
#define PB push_back
#define SE second
#define FI first
#define MP make_pair

#define FOR(i,Be,En) for(int (i)=(Be);(i)<=(En);++(i))
#define DFOR(i,Be,En) for(int (i)=(Be);(i)>=(En);--(i))
#define SZ(a) (int)((a).size())
#define FA(i,v) FOR(i,0,SZ(v)-1)
#define RFA(i,v) DFOR(i,SZ(v)-1,0)
#define CLR(a) memset(a,0,sizeof(a))

#define LL  long long
#define VI  vector<int>
#define PAR pair<int ,int>

using namespace std;
void __never(int a){printf("\nOPS %d", a);}
void __die(int a){printf("%d",(a*a)/(a+a));}
#define ass(s) {if (!(s)) {__never(__LINE__);cout.flush();cerr.flush();__die(0);}}

#define MN 120000

int n, k;
double h;
pair<PAR, int> m[MN];
int ans[MN];
double eps = 1e-7;
void init()
{
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
}

bool ok(double t){
    int cur = 1;
    FOR(i,0,n-1) {
        if (h*cur / m[i].FI.SE < t) {
            ans[cur] = m[i].SE;
            cur++;
        }
        if (cur > k) break;
    }
    return cur > k;
}
void sol(){
    cin >> n >> k >> h;
    FOR(i,0,n-1) RE("%d",&m[i].FI.FI);
    FOR(i,0,n-1) RE("%d",&m[i].FI.SE);
    FOR(i,0,n-1) m[i].SE = i;

    sort(m,m+n);

    double low = 1, hi = 1e15;
    ass(ok(hi));
    FOR(I,1,100) {
        double ce = (low + hi) / 2;
        if (ok(ce)) hi = ce;
        else low = ce;
    }

    //eps = 1e-6;
    ok(hi);
    //ass(ok(hi));

    FOR(i,1,k) WR(" %d",ans[i] + 1);

}
int main()
{
    //init();
    sol();
    return 0;
}

/*
I ain't got a fever got a permanent disease
It'll take more than a doctor to prescribe a remedy
I got lots of money but it isn't what I need
Gonna take more than a shot to get this poison out of me
I got all the symptoms count 'em 1,2,3

First you need
That's what you get for falling in love
Then you bleed
You get a little but it's never enough
On your knees
That's what you get for falling in love
And now this boy's addicted cause your kiss is the drug

Your love is like bad madicine
Bad medicine is what I need
Shake it up, just like bad madicine
There ain't no doctor that can
Cure my disease

Bad, bad medicine
Bad, bad medicine

I don't need no needle
To be giving me a thrill
And I don't need no anesthesia
Or a nurse to bring a pill
I got a dirty down addiction
It doesn't leave a track
I got a jone for your affection
Like a monkey on my back

There ain't no paramedic
Gonna save this heart attack

When you need
That's what you get for falling in love
Then you bleed
You get a little but it's never enough
On your knees
That's what you get for falling in love
Now I'm addicted and your kiss is the drug

Your love is like bad madicine
Bad medicine is what I need
Shake it up, just like bad madicine
So let's play doctor, baby
Cure my disease

Bad, bad medicine
Bad, bad medicine

I need a respirator cause I'm running out of breath
You're an all night generator wrapped is stockings and a dress
When you find your medicine you take what you can get
Cause if there's something better baby well thay haven't found it yet

Your love is like bad madicine
Bad medicine is what I need
Shake it up, just like bad madicine
There ain't no doctor that can
Cure my disease

Your love is like bad madicine
Bad medicine is what I need
Shake it up, just like bad madicine
Your love's the potion that
Can cure my disease

Bad, bad medicine
Bad, bad medicine
*/

#include <iostream>
#include <fstream>
#include <string>
#include <math.h>
#include <set>
#include <vector>
#include <map>
#include <queue>
#include <stdio.h>
#include <stack>
#include <algorithm>

#define y1 aasdfasdfasdf
#define yn askfhwqriuperikldjk
#define INF 1000000000
#define eps 1e-10
#define M_PI 3.141592653589793

//#define mx 1000000000000ll
#define bs 1000000007
//#define szz 400
//#define pb push_back

using namespace std;
vector <long> ans;
long n,q,k,h,m[200000],v[200000];
pair <long, long> p;
pair <pair <long, long> ,long > pp;
vector <pair <pair <long, long> ,long > > ve;
long double l,mm,r;

int main(){
//freopen("C:/aver.txt","r",stdin);
//freopen("C:/output.txt","w",stdout);
cin>>n>>k>>h;

for (int i=1;i<=n;i++)
{
    cin>>m[i];
}

for (int i=1;i<=n;i++)
{
    cin>>v[i];
}

for (int i=1;i<=n;i++)
{p=make_pair(m[i],v[i]);
pp=make_pair(p,i);
ve.push_back(pp);
}

l=0;
r=h*k;

sort(ve.begin(),ve.end());

long iters=0;

while (iters<100)
{
      ++iters;
      q=0;
      mm=l+r;
      mm/=2;

      for (int i=0;i<ve.size();i++)
      {
          if (q<k)
          if (h*(q+1)<=mm*ve[i].first.second)q++;
      }
      if (q==k)r=mm; else l=mm;
}

//cout<<mm<<endl;
q=0;
mm=l+r;
mm/=2;
    for (int i=0;i<ve.size();i++)
      {
          if (q<k)
          if (h*(q+1)<=mm*ve[i].first.second+1e-15){q++;ans.push_back(ve[i].second);}
      }

for (int i=0;i<ans.size();i++)
{if (i)cout<<" ";
 cout<<ans[i];}

 cout<<endl;

cin.get();cin.get();
return 0;}

#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <algorithm>
#include <cstdlib>
#include <vector>
#include <cmath>
#include <set>
#include <map>
#include <deque>
#include <bitset>

#define sqr(x) ((x) * (x))
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define y0 ywuerosdfhgjkls
#define y1 hdsfjkhgjlsdfhgsdf
#define j1 j924
#define j0 j2834
#define sqrt(x) (sqrt(abs(x)))
#define re return
#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 rrep(i, n) for (int i = ((n) - 1); i >= 0; i--)
#define fill(a, x) memset(a, x, sizeof(a))

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair <int, int> ii;
typedef vector <int> vi;
typedef vector <ii> vii;
typedef vector <vi> vvi;
typedef double D;
typedef vector <string> vs;

template <class T> inline T abs(T a) {
    return a > 0 ? a : -a;
}

int n;
int m;

pair <ii, int> a[100000];

int main() {
    int k, h;
    cin >> n >> k >> h;
    rep(i, n) {
        scanf("%d", &a[i].fi.fi);
    }
    rep(i, n) {
        scanf("%d", &a[i].fi.se);
        a[i].se = i;
    }
    sort(a, a + n);
    double l = 0.0, r = 2e9;
    rep(I, 200) {
        double t = (l + r) / 2.0;
        int cur = k;
        rrep(i, n) {
            if ((D)cur * (D)h / (D) a[i].fi.se < t) {
                cur--;
                if (cur == 0)
                    break;
            }
        }
        if (cur == 0) {
            r = t;
        } else
            l = t;
    }
    vi ans;
    double t = r;
    //cout << t << endl;
    rrep(i, n) {
        //cout << (D)k * (D)h / (D) a[i].fi.se << endl;
        if ((D)k * (D)h / (D) a[i].fi.se < t + 1e-7) {
            k--;
            ans.pb(a[i].se);
            if (k == 0)
                break;
        }
    }
    //cout << k << endl;
    reverse(all(ans));
    rep(i, sz(ans))
        printf("%d ", ans[i] + 1);
    printf("\n");
    return 0;
}

#include<stdio.h>
#include<stdlib.h>
#include<vector>
#include<algorithm>
#include<set>
#include<utility>

#define EPS 1e-9

using namespace std;

struct lemming {
  int m;
  double v;
  int idx;

  lemming(int m1, int i) : m(m1), idx(i) {}

  bool operator<(const lemming &b) const {
    if(this->m < b.m) return true;
    return this->m == b.m &&  this->v< b.v;
  }
};

vector<lemming> lems;
int use[100000];

int main() {
  int n,k;
  int h;
  scanf("%d %d %d",&n,&k,&h);

  for(int i = 0; i < n; i++) {
    int m;
    scanf("%d", &m);
    lems.push_back(lemming(m,i+1));
  }
  for(int i = 0; i < n; i++) {
    int v;
    scanf("%d", &v);
    lems[i].v = v;
  }

  sort(lems.begin(), lems.end());

  double max = 1000000000;
  double min = 0;

  double best = max;
  while(min + EPS < max) {
    double t = (max+min) / 2;
    double th = h;
    int j = 0;
    for(int i = 0; i < n; i++) {
      if(th/lems[i].v < t) {
        th += h;
        use[j++] = lems[i].idx;
        if(j == k) break;
      }
    }
    if(j == k) {
      max = t;
      if(best > t) best = t;
    } else {
      min = t;
    }
  }

  double t = best;
    double th = h;
    int j = 0;
    for(int i = 0; i < n; i++) {
      if(th/lems[i].v < t) {
        th += h;
        use[j++] = lems[i].idx;
        if(j == k) break;
      }
    }

    if(j!=k) while(true);

  char *sep = "";
  for(int i = 0; i < k; i++) {
    printf("%s%d", sep, use[i]);
    sep = " ";
  }
  printf("\n");
  return 0;

}

#include<cstdio>
#include<cstring>
#include<algorithm>
#define N 100009
#define EPS 10e-12
using namespace std;
int n,m,h;
int w[N],v[N],od[N];
int ans[N];
bool cmp(const int &a,const int &b){
    if(w[a]==w[b]) return v[a]<v[b];
    return w[a]<w[b];
}
bool isok(double t){
    int cnt=1;
    long double one=1.0;
    for(int i=1;i<=n&&cnt<=m;i++)
        if(one*t*v[od[i]]>one*cnt*h+EPS){
            ans[cnt++]=od[i];
        }
    if(cnt>m) return true;
    else return false;
}
int main(){
    //freopen("in","r",stdin);
    scanf("%d%d%d",&n,&m,&h);
    for(int i=1;i<=n;i++)
        od[i]=i,scanf("%d",w+i);
    for(int i=1;i<=n;i++)
        scanf("%d",v+i);
    sort(od+1,od+n+1,cmp);
    long double s=0,e=10e20,mid;
    for(int i=1;i<=200;i++){
        mid=(s+e)/2;
        if(isok(mid)) e=mid;
        else s=mid;
    }
    //printf("%lf\n",res);
    printf("%d",ans[1]);
    for(int i=2;i<=m;i++) printf(" %d",ans[i]);
    puts("");
    return 0;
}

#include<algorithm>
#include<cstring>
#include<cstdio>
#include<vector>
#include<queue>
#include<set>
#include<map>
using namespace std;

typedef long long LL;
typedef long double LD;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<LL> VLL;
typedef vector<VI> VVI;
typedef pair<int,int> PII;
typedef vector<PII> VPII;

#define FOR(x,y,z) for(int x=y;x<=z;++x)
#define FORD(x,y,z) for(int x=y;x>=z;--x)
#define FOReach(x,Z) for(__typeof((Z).begin()) x=(Z).begin();x!=(Z).end();++x)
#define REP(x,y) for(int x=0;x<y;++x)

#define PB push_back
#define ALL(X) (X).begin(),(X).end()
#define SZ(X) ((int)(X).size())
#define CLR(X,x) memset(X, x, sizeof(X))

#define MP make_pair
#define ST first
#define ND second

#define DBG

#ifdef DBG
#define debug printf
#else
#define debug(fmt, ...)
#endif

const int MAX = 100000;
const int INF = 1000000001;

struct lem {
	int v, m, nr;
	bool operator<(const lem &rhs) const {
		return m < rhs.m;
	}
};

lem L[MAX];

int n, k, h;

bool ok(LD t, VI &V) {
	V.clear();
	int j = 0;
	FORD(i,k,1)
	{
		while(j < n && (LD)i*(LD)h/(LD)L[j].v > t)
			++j;
		if(j == n)
			return false;
		V.PB(L[j].nr);
		++j;
	}
	return true;
}

int main(int argc, char *argv[]) {
	scanf("%d %d %d", &n, &k, &h);
	REP(i,n)
		scanf("%d", &L[i].m);
	REP(i,n)
		scanf("%d", &L[i].v);
	REP(i,n)
		L[i].nr = i+1;
	sort(L, L+n);
	reverse(L, L+n);
	LD p = 1, q = LD(100000000000000LL), r;
	VI res;
	while(q-p > 0.00001)
	{
		r = (p+q)/2.0;
		if(ok(r, res))
			q = r;
		else
			p = r;
	}
	ok(q, res);
	reverse(ALL(res));
	FOReach(it,res)
		printf("%d ", *it);
	printf("\n");
	return 0;
}

#include<bits/stdc++.h>
#define ld double
#define F first
#define S second
using namespace std;
const int MAX_N = 1e5 + 10;
int n, k, h;
pair<int, pair<int, int>> mvi[MAX_N];
bool ch(ld x){
    int t = 0, ind = 1;
    for(int i = 0; i < n && ind <= k; i++){
        if(((ind * h) / mvi[i].S.F) < x){
            ind++;
            t++;
        }
    }
    if(t >= k){
        return 1;
    }
    return 0;
}
bool pp(ld x){
    int ind = 1;
    for(int i = 0; i < n && ind <= k; i++){
        if(((ind * h) / mvi[i].S.F) < x){
            ind++;
            cout<<mvi[i].S.S + 1<<" ";
        }
    }
}
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin>>n>>k>>h;
    for(int i = 0; i < n; i++){
        cin>>mvi[i].F;
    }
    for(int i = 0; i < n; i++){
        cin>>mvi[i].S.F;
        mvi[i].S.S = i;
    }
    sort(mvi, mvi + n);
    ld s = 0, e = 1e5;
    for(int i = 0; i < 100; i++){
        ld mid = (e + s) / 2;
        if(ch(mid)){
            e = mid;
        }
        else{
            s = mid;
        }
    }
    pp(e);
}

/*{{{*/
/*includes e defines*/
#include <iostream>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <vector>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <sstream>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<string> vs;
typedef pair<int,int> pii;
#define sz(A) (int)(A).size()
#define FOR(A,B) for(int A=0; A < (int) (B);A++)
#define FOREACH(A,B) for(__typeof((B).begin()) A = (B).begin(); A != (B).end(); A++)
#define pb push_back
#define all(x) x.begin() , x.end()
#define mp make_pair
/*}}}*/

int n, k, h;

vector< pair< pair<int ,int>, int > > v;

#define N 100100
int ord[N];

int ok(double t) {
	int pos = 0;
	FOR(i, n) {
		double vel = v[i].first.second;
		if( ((double) (pos+1) * h) / vel <= t) {
			ord[pos] = v[i].second;
			pos++;
		}
	}
	return pos >= k;
}

int main() {
	cin >> n >> k >> h;
	v.clear();
	v.resize( n );
	FOR(i, n) {
		scanf("%d", &v[i].first.first);
	}
	FOR(i, n) {
		scanf("%d", &v[i].first.second);
		v[i].second = i + 1;
	}

	sort( all(v) );
//	FOR(i, sz(v)) printf("Peso = %d, vel = %d, id = %d\n", v[i].first.first, v[i].first.second, v[i].second);

	double ini = 0, fim = 1000000000.0 * h + 1;
	FOR(i, 200) {
		double meio = (ini + fim) / 2;
		if( ok(meio) ) fim = meio;
		else ini = meio;
	}

	double meio = (ini+fim) / 2;
	while(!ok(meio)) meio += 1e-9;

	FOR(i, k) {
		if(i) printf(" ");
		printf("%d", ord[i]);
	}
	printf("\n");

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,k,h;
// base and base_digits must be consistent
const int base = 1000000000;
const int base_digits = 9;

struct bigint {
    vector<int> z;
    int sign;

    bigint() :
        sign(1) {
    }

    bigint(long long v) {
        *this = v;
    }

    bigint(const string &s) {
        read(s);
    }

    void operator=(const bigint &v) {
        sign = v.sign;
        z = v.z;
    }

    void operator=(long long v) {
        sign = 1;
        if (v < 0)
            sign = -1, v = -v;
        z.clear();
        for (; v > 0; v = v / base)
            z.push_back(v % base);
    }

    bigint operator+(const bigint &v) const {
        if (sign == v.sign) {
            bigint res = v;

            for (int i = 0, carry = 0; i < (int) max(z.size(), v.z.size()) || carry; ++i) {
                if (i == (int) res.z.size())
                    res.z.push_back(0);
                res.z[i] += carry + (i < (int) z.size() ? z[i] : 0);
                carry = res.z[i] >= base;
                if (carry)
                    res.z[i] -= base;
            }
            return res;
        }
        return *this - (-v);
    }

    bigint operator-(const bigint &v) const {
        if (sign == v.sign) {
            if (abs() >= v.abs()) {
                bigint res = *this;
                for (int i = 0, carry = 0; i < (int) v.z.size() || carry; ++i) {
                    res.z[i] -= carry + (i < (int) v.z.size() ? v.z[i] : 0);
                    carry = res.z[i] < 0;
                    if (carry)
                        res.z[i] += base;
                }
                res.trim();
                return res;
            }
            return -(v - *this);
        }
        return *this + (-v);
    }

    void operator*=(int v) {
        if (v < 0)
            sign = -sign, v = -v;
        for (int i = 0, carry = 0; i < (int) z.size() || carry; ++i) {
            if (i == (int) z.size())
                z.push_back(0);
            long long cur = z[i] * (long long) v + carry;
            carry = (int) (cur / base);
            z[i] = (int) (cur % base);
            //asm("divl %%ecx" : "=a"(carry), "=d"(a[i]) : "A"(cur), "c"(base));
        }
        trim();
    }

    bigint operator*(int v) const {
        bigint res = *this;
        res *= v;
        return res;
    }

    friend pair<bigint, bigint> divmod(const bigint &a1, const bigint &b1) {
        int norm = base / (b1.z.back() + 1);
        bigint a = a1.abs() * norm;
        bigint b = b1.abs() * norm;
        bigint q, r;
        q.z.resize(a.z.size());

        for (int i = a.z.size() - 1; i >= 0; i--) {
            r *= base;
            r += a.z[i];
            int s1 = b.z.size() < r.z.size() ? r.z[b.z.size()] : 0;
            int s2 = b.z.size() - 1 < r.z.size() ? r.z[b.z.size() - 1] : 0;
            int d = ((long long) s1 * base + s2) / b.z.back();
            r -= b * d;
            while (r < 0)
                r += b, --d;
            q.z[i] = d;
        }

        q.sign = a1.sign * b1.sign;
        r.sign = a1.sign;
        q.trim();
        r.trim();
        return make_pair(q, r / norm);
    }

    friend bigint sqrt(const bigint &a1) {
        bigint a = a1;
        while (a.z.empty() || a.z.size() % 2 == 1)
            a.z.push_back(0);

        int n = a.z.size();

        int firstDigit = (int) sqrt((double) a.z[n - 1] * base + a.z[n - 2]);
        int norm = base / (firstDigit + 1);
        a *= norm;
        a *= norm;
        while (a.z.empty() || a.z.size() % 2 == 1)
            a.z.push_back(0);

        bigint r = (long long) a.z[n - 1] * base + a.z[n - 2];
        firstDigit = (int) sqrt((double) a.z[n - 1] * base + a.z[n - 2]);
        int q = firstDigit;
        bigint res;

        for(int j = n / 2 - 1; j >= 0; j--) {
            for(; ; --q) {
                bigint r1 = (r - (res * 2 * base + q) * q) * base * base + (j > 0 ? (long long) a.z[2 * j - 1] * base + a.z[2 * j - 2] : 0);
                if (r1 >= 0) {
                    r = r1;
                    break;
                }
            }
            res *= base;
            res += q;

            if (j > 0) {
                int d1 = res.z.size() + 2 < r.z.size() ? r.z[res.z.size() + 2] : 0;
                int d2 = res.z.size() + 1 < r.z.size() ? r.z[res.z.size() + 1] : 0;
                int d3 = res.z.size() < r.z.size() ? r.z[res.z.size()] : 0;
                q = ((long long) d1 * base * base + (long long) d2 * base + d3) / (firstDigit * 2);
            }
        }

        res.trim();
        return res / norm;
    }

    bigint operator/(const bigint &v) const {
        return divmod(*this, v).first;
    }

    bigint operator%(const bigint &v) const {
        return divmod(*this, v).second;
    }

    void operator/=(int v) {
        if (v < 0)
            sign = -sign, v = -v;
        for (int i = (int) z.size() - 1, rem = 0; i >= 0; --i) {
            long long cur = z[i] + rem * (long long) base;
            z[i] = (int) (cur / v);
            rem = (int) (cur % v);
        }
        trim();
    }

    bigint operator/(int v) const {
        bigint res = *this;
        res /= v;
        return res;
    }

    int operator%(int v) const {
        if (v < 0)
            v = -v;
        int m = 0;
        for (int i = z.size() - 1; i >= 0; --i)
            m = (z[i] + m * (long long) base) % v;
        return m * sign;
    }

    void operator+=(const bigint &v) {
        *this = *this + v;
    }
    void operator-=(const bigint &v) {
        *this = *this - v;
    }
    void operator*=(const bigint &v) {
        *this = *this * v;
    }
    void operator/=(const bigint &v) {
        *this = *this / v;
    }

    bool operator<(const bigint &v) const {
        if (sign != v.sign)
            return sign < v.sign;
        if (z.size() != v.z.size())
            return z.size() * sign < v.z.size() * v.sign;
        for (int i = z.size() - 1; i >= 0; i--)
            if (z[i] != v.z[i])
                return z[i] * sign < v.z[i] * sign;
        return false;
    }

    bool operator>(const bigint &v) const {
        return v < *this;
    }
    bool operator<=(const bigint &v) const {
        return !(v < *this);
    }
    bool operator>=(const bigint &v) const {
        return !(*this < v);
    }
    bool operator==(const bigint &v) const {
        return !(*this < v) && !(v < *this);
    }
    bool operator!=(const bigint &v) const {
        return *this < v || v < *this;
    }

    void trim() {
        while (!z.empty() && z.back() == 0)
            z.pop_back();
        if (z.empty())
            sign = 1;
    }

    bool isZero() const {
        return z.empty() || (z.size() == 1 && !z[0]);
    }

    bigint operator-() const {
        bigint res = *this;
        res.sign = -sign;
        return res;
    }

    bigint abs() const {
        bigint res = *this;
        res.sign *= res.sign;
        return res;
    }

    long long longValue() const {
        long long res = 0;
        for (int i = z.size() - 1; i >= 0; i--)
            res = res * base + z[i];
        return res * sign;
    }

    friend bigint gcd(const bigint &a, const bigint &b) {
        return b.isZero() ? a : gcd(b, a % b);
    }
    friend bigint lcm(const bigint &a, const bigint &b) {
        return a / gcd(a, b) * b;
    }

    void read(const string &s) {
        sign = 1;
        z.clear();
        int pos = 0;
        while (pos < (int) s.size() && (s[pos] == '-' || s[pos] == '+')) {
            if (s[pos] == '-')
                sign = -sign;
            ++pos;
        }
        for (int i = s.size() - 1; i >= pos; i -= base_digits) {
            int x = 0;
            for (int j = max(pos, i - base_digits + 1); j <= i; j++)
                x = x * 10 + s[j] - '0';
            z.push_back(x);
        }
        trim();
    }

    friend istream& operator>>(istream &stream, bigint &v) {
        string s;
        stream >> s;
        v.read(s);
        return stream;
    }

    friend ostream& operator<<(ostream &stream, const bigint &v) {
        if (v.sign == -1)
            stream << '-';
        stream << (v.z.empty() ? 0 : v.z.back());
        for (int i = (int) v.z.size() - 2; i >= 0; --i)
            stream << setw(base_digits) << setfill('0') << v.z[i];
        return stream;
    }

    static vector<int> convert_base(const vector<int> &a, int old_digits, int new_digits) {
        vector<long long> p(max(old_digits, new_digits) + 1);
        p[0] = 1;
        for (int i = 1; i < (int) p.size(); i++)
            p[i] = p[i - 1] * 10;
        vector<int> res;
        long long cur = 0;
        int cur_digits = 0;
        for (int i = 0; i < (int) a.size(); i++) {
            cur += a[i] * p[cur_digits];
            cur_digits += old_digits;
            while (cur_digits >= new_digits) {
                res.push_back(int(cur % p[new_digits]));
                cur /= p[new_digits];
                cur_digits -= new_digits;
            }
        }
        res.push_back((int) cur);
        while (!res.empty() && res.back() == 0)
            res.pop_back();
        return res;
    }

    typedef vector<long long> vll;

    static vll karatsubaMultiply(const vll &a, const vll &b) {
        int n = a.size();
        vll res(n + n);
        if (n <= 32) {
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n; j++)
                    res[i + j] += a[i] * b[j];
            return res;
        }

        int k = n >> 1;
        vll a1(a.begin(), a.begin() + k);
        vll a2(a.begin() + k, a.end());
        vll b1(b.begin(), b.begin() + k);
        vll b2(b.begin() + k, b.end());

        vll a1b1 = karatsubaMultiply(a1, b1);
        vll a2b2 = karatsubaMultiply(a2, b2);

        for (int i = 0; i < k; i++)
            a2[i] += a1[i];
        for (int i = 0; i < k; i++)
            b2[i] += b1[i];

        vll r = karatsubaMultiply(a2, b2);
        for (int i = 0; i < (int) a1b1.size(); i++)
            r[i] -= a1b1[i];
        for (int i = 0; i < (int) a2b2.size(); i++)
            r[i] -= a2b2[i];

        for (int i = 0; i < (int) r.size(); i++)
            res[i + k] += r[i];
        for (int i = 0; i < (int) a1b1.size(); i++)
            res[i] += a1b1[i];
        for (int i = 0; i < (int) a2b2.size(); i++)
            res[i + n] += a2b2[i];
        return res;
    }

    bigint operator*(const bigint &v) const {
        vector<int> a6 = convert_base(this->z, base_digits, 6);
        vector<int> b6 = convert_base(v.z, base_digits, 6);
        vll a(a6.begin(), a6.end());
        vll b(b6.begin(), b6.end());
        while (a.size() < b.size())
            a.push_back(0);
        while (b.size() < a.size())
            b.push_back(0);
        while (a.size() & (a.size() - 1))
            a.push_back(0), b.push_back(0);
        vll c = karatsubaMultiply(a, b);
        bigint res;
        res.sign = sign * v.sign;
        for (int i = 0, carry = 0; i < (int) c.size(); i++) {
            long long cur = c[i] + carry;
            res.z.push_back((int) (cur % 1000000));
            carry = (int) (cur / 1000000);
        }
        res.z = convert_base(res.z, 6, base_digits);
        res.trim();
        return res;
    }
};

bigint random_bigint(int n) {
    string s;
    for (int i = 0; i < n; i++) {
        s += rand() % 10 + '0';
    }
    return bigint(s);
}

struct lemming{
    int mass,speed,id;
    bool operator<(const lemming &t)const{
        if(mass != t.mass)
            return mass < t.mass;
        return speed < t.speed;
    }
    bool climbs(ll height, ll t){
        return !(t < 5000000000*height/speed);
    }
};
vector<lemming> arr;
bool solve(ll &t, bool print){
    vector<int> choice;
    int cnt = 1;
    for(int i = 0; i < n; ++i){
        if(arr[i].climbs(cnt*h,t)){
            choice.push_back(arr[i].id);
            ++cnt;
        }
    }
    if(cnt <= k)
        return false;
    if(print){
        for(int i = 0; i < k; ++i)
            printf("%d%c",choice[i]," \n"[i==k-1]);
    }
    return true;
}
int main(){
    cin >> n >> k >> h;
    arr.resize(n);
    for(int i = 0; i < n; ++i)
        scanf("%d",&arr[i].mass);
    for(int i = 0; i < n; ++i)
        scanf("%d",&arr[i].speed);
    for(int i = 0; i < n; ++i)
        arr[i].id = i+1;
    sort(arr.begin(),arr.end());
    ll lo = 1, hi = 5e18, mid;
    while(lo < hi){
        mid = (lo+hi)/2;
        if(solve(mid,0))
            hi = mid;
        else
            lo = mid+1;
    }
//    cout << lo << '\n';
    solve(hi,true);
}

#include <algorithm>
#include <iostream>
#include <cassert>
#include <cstring>
#include <cstdio>
#include <vector>
#include <cmath>
#include <map>
#include <set>

#define SIZE(A) ((int)A.size())
#define LENGTH(A) ((int)A.length())
#define MP(A,B) make_pair(A,B)
#define PB(A) push_back(A)

typedef long long ll;
typedef double ld;

using namespace std;

int n, k, h;
int ans[300000];
pair <int, pair <int, int> > a[300000];

inline bool solve(const double x)
{
	int j = k;
	for (int i = n-1; i >= 0 && j; i--)
		if (1.*h*j/a[i].second.first < x)
			j--;
	return !j;
}

void output(const double x)
{
	int j = k;
	for (int i = n-1; i >= 0 && j; i--)
		if (1.*h*j/a[i].second.first < x)
			ans[--j] = a[i].second.second;
}

int main ()
{
	#ifndef ONLINE_JUDGE
		freopen ("input", "r", stdin);
		freopen ("output", "w", stdout);
	#endif

	scanf("%d%d%d", &n, &k, &h);
	for (int i = 0; i < n; i++)
		scanf("%d", &a[i].first);
	for (int i = 0; i < n; i++)
		scanf("%d", &a[i].second.first),
		a[i].second.second = i+1;
	sort(a, a + n);

	double lo = 0, hi = 2000000000., mi;

	for (int it = 0; it < 100; it++)
	{
		mi = (lo+hi)*0.5;

		if (solve(mi))
			hi = mi;
		else
			lo = mi;
	}

	output(hi);

	for (int i = 0; i < k; i++)
		printf("%d%c", ans[i], " \n"[i+1==k]);

	return 0;
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <memory.h>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
using namespace std;

const int inf = 1000*1000*1000;
#define CL(x,a) memset(x,a,sizeof(x));
#define ALL(v) (v).begin(),(v).end()
#define PII pair<int,int>
#define PDI pair<long double,int>
#define MP(a,b) make_pair(a,b)
#define FOR(i,n) for(int i=0;i<n;i++)
typedef long long LL;
typedef vector<int> vi;
typedef vector< vi > vvi;
typedef vector< vector<PII > > vvpii;

struct st
{
	int m,v,id;
	friend bool operator < (const st &a, const st &b)
	{
		return a.m < b.m || a.m == b.m && a.v < b.v;
	}
};
int n,k,h;
st ar[100009];
LL tmp[100009];
int take[100009];
bool ok(long double T, bool flag = 0)
{
	if (flag)
		CL(take,0);
	FOR(i,n)
	{
		tmp[i] = (LL)(T*ar[i].v/h + 1e-6);
	}
	int cnt = 0;
	FOR(i,n)
	{
		if (tmp[i] >= cnt + 1)
		{
			cnt++;
			take[i] = 1;
		}
		if (cnt >= k)
			return 1;
	}
	return 0;
}
int main()
{
	scanf("%d%d%d",&n,&k,&h);
	FOR(i,n)
	{
		ar[i].id = i;
		scanf("%d",&ar[i].m);
	}
	FOR(i,n)
	{
		scanf("%d",&ar[i].v);
	}
	sort(ar,ar+n);
	long double L=0,R=(long double)inf*2,M;
	int C = 100;
	while(R-L > 1e-3)
	{
		M = (L+R)/2;
		if (ok(M))
			R=M;
		else
			L=M;
	}
	R += 1e-2;
	ok(R,1);
	int Co = 0;
	FOR(i,n)
	{
		if (take[i])
		{
			printf("%d ",ar[i].id + 1);
			Co++;
		}
	}
	if (Co != k)
		++(*((char*)(0)));
	return 0;
}

#include <iostream>
#include <fstream>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <queue>
#include <list>
#include <map>
#include <set>
#include <string>
#include <cmath>
#include <stdlib.h>
using namespace std;

struct str{
	int m, v, num;
	bool operator<(const str& o)const{
		if(m!=o.m) return m<o.m;
		return v<o.v;
	}
};

str a[100010];
int rez[2][100010];
int nrez[2];

int main(){
	int n, k, h;
	cin>>n>>k>>h;
	for(int i=0; i<n; i++){
		a[i].num = i+1;
		cin>>a[i].m;
	}
	for(int i=0; i<n; i++) cin>>a[i].v;
	sort(&a[0],&a[n]);
	double l = 0, r = 1000000100;
	int cur = 0;
	for(int num=0; num<5000 && fabs(r-l)>1e-14; num++){
		double x = (l+r)/2;
		int j=1;
		nrez[cur] = 0;
		for(int i=0; i<n; i++){
			double tm = double(j)*double(h)/double(a[i].v);
			if(tm<=x){
				rez[cur][nrez[cur]] = a[i].num;
				nrez[cur]++;
				j++;
				if(j>k) break;
			}
		}
		if(nrez[cur]==k){
			cur^=1;
			r=x;
		}else{
			l=x;
		}
	}
	cur^=1;
	for(int i=0; i<nrez[cur]; i++)
		cout<<rez[cur][i]<<' ';
	cout<<endl;
	return 0;
}

#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>
#include <cstring>
#define MOD 1000000007

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll,ll> pii;
typedef pair<ld,ld> pdd;

int n, k, h;
pair<pdd, int> lem[100000]; // m, v, i
int lemsTest[100000];
int lemsTrue[100000];

int main()
{
    cin >> n >> k >> h;
    for (int i = 0; i < n; ++i)
        cin >> lem[i].first.first;
    for (int i = 0; i < n; ++i)
        cin >> lem[i].first.second;
    for (int i = 0; i < n; ++i)
        lem[i].second = i+1;
    sort(lem, lem+n);

    ld lo = 0, hi = 1e9;
    while (hi - lo > (1+hi)*1e-14)
    {
        ld mid = (lo + hi) / 2;
        int j = 0;
        for (int i = 0; i < n; ++i)
        {
            ld maxLedge = mid * lem[i].first.second;
            if (maxLedge*(1+1e-14) >= h * (j + 1))
            {
                lemsTest[j] = lem[i].second;
                j++;
            }
        }
        if (j < k)
            lo = mid;
        else
        {
            hi = mid;
            for (int i = 0; i < k; ++i)
                lemsTrue[i] = lemsTest[i];
        }
    }
    cout << lemsTrue[0];
    for (int i = 1; i < k; ++i)
        cout << ' ' << lemsTrue[i];
    cout << endl;
    //cin >> n;
}

#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <cmath>
#include <stdio.h>
#include <iomanip>
#include <map>

#define pb push_back
#define mp make_pair
#define f1 first
#define f2 second

using namespace std;

typedef long long LL;
typedef long double LD;

const int maxn = 1000 * 1000 + 5;
const int mod = 1000 * 1000 * 1000 + 7;
//const long long P = 1000ll * 1000;

long long n, k, h;
pair <int, pair<int, int> > srt[maxn];

LL v[maxn];
map <int, int> mymap;

bool chck(LD t)
{
	int cnt = 0;
	for (int i = n - 1; i >= 0 && cnt < k; i--)
	{
		LD tmp = ((k - cnt) * h);
		if (t * v[i] >= tmp)
			cnt++;
	}
	if (cnt == k)
		return true;
	return false;

}

int main()
{
	cin >> n >> k >> h;
	for (int i = 0; i < n; i++)
	{
		cin >> srt[i].f1;
		srt[i].f2.f2 = i;
	}
	for (int i = 0; i < n; i++)
		cin >> srt[i].f2.f1;
	sort (srt, srt + n);
	for (int i = 0; i < n; i++)
	{
		v[i] = srt[i].f2.f1;
//		mymap[i] = srt[i].f2.f2;

	}

	LD s = 0, e = 1000.0 * 1000 * 1000;
	while (e - s > 1e-6)
	{
		LD mid = (e + s) / 2.0;
		if (chck(mid))
			e = mid;
		else
			s = mid;
	}

	int cnt = 0;
	vector <int> ans;
	for (int i = n - 1; i >= 0 && cnt < k; i--)
	{
		LD tmp = ((k - cnt) * h);
		if (e * v[i] >= tmp)
		{
			cnt++;
			ans.pb(srt[i].f2.f2);
		}
	}
	reverse(ans.begin(), ans.end());
//	if (cnt != k)
//		cerr << "err" << endl;

//	cerr << e << endl;
//	for (int i = 0; i < (int)ans.size(); i++)
//		cout << mymap[ans[i]] + 1 << " ";
	for (int i = 0; i < (int)ans.size(); i++)
		cout << ans[i] + 1 << " ";

	cout << endl;
//	for (int i = 0; i < n; i++)
//		cerr << v[i] << " ";
//	cout << endl;
	return 0;
}

#include <stdio.h>
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <sstream>

#define pb push_back
#define mp make_pair
#define PI 3.14159265358979
#define sqr(x) (x)*(x)
#define forn(i, n) for(int i = 0; i < n; ++i)
#define ALL(x) x.begin(), x.end()
#define sz(x) int((x).size())
#define X first
#define Y second
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
using namespace std;
typedef pair<int,int> pii;
const int INF = 2147483647;
const ll LLINF = 9223372036854775807LL;
const int maxn = 100010;
const double eps = 1e-10;
const double eps2 = 1e-16;
int mi[maxn] = {};
int vi[maxn] = {};
int n, k, h;
struct item {
	int m, ind, num;
	item() {}
	item(int m, int ind, int num):m(m),ind(ind),num(num) {}
	bool operator < (const item &oth) const {
		return m < oth.m||(m==oth.m&&num<oth.num);
	}
};
item a[maxn] = {};
int res[maxn] = {};
int KK;
bool can(double t) {
	for (int i = 0; i < n; ++i) {
		a[i].m = mi[i];
		a[i].ind = i;
		double ttt = vi[i]*t/h+0.01;
		if (ttt > k) a[i].num = k;
		else a[i].num = (int)(ttt);
	}
	sort(a,a+n);
	reverse(a,a+n);
	int need = k;
	int lstm = INF;
	KK = 0;
	for (int i = 0; i < n; ++i) {
		if (a[i].num<need) continue;
		if (a[i].m<=lstm) {
			res[KK++] = a[i].ind;
			need--;
			if (need == 0) return true;
			lstm = a[i].m;
		}
	}
	return false;
}
int main()
{
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
#endif
	scanf("%d%d%d", &n, &k, &h);
	for (int i = 0; i < n; ++i) scanf("%d", &mi[i]);
	for (int i = 0; i < n; ++i) scanf("%d", &vi[i]);
	double r = 1e10;
	double l = 0;
	//can(7);
	while (r-l>eps) {
		double m = (l+r)/2.0;
		if (can(m)) r = m;
		else l = m;
	}
	can(r);
	for (int i = KK-1; i>=0; --i) printf("%d ", res[i]+1);
	return 0;
}

#include<string>
#include<iostream>
#include<sstream>
#include<assert.h>
#include<cstdio>
#include<map>
#include<algorithm>
#include<bitset>
#include<cmath>
#include<queue>
#include<functional>
#include<set>
#include<stack>
#include<cstdlib>
#include<cstring>
typedef long long int64;
#define long int64
#define var(q,s) typeof(s) q = s
#define for_each(q,s) for(var(q,(s).begin()); q!=(s).end(); q++)
using namespace std;

//=========================================================
// program:
//
/* lemmings*/ /*ledges*/ /*height factor*/
int n,k,h;
int m[100000];
int v[100000];

int ledge[100000];

pair< pair<int,int> ,int> byVelWeight[100000];

bool makeLedges(double t, bool deb = false)
{
    if (deb) {
        fill(ledge, ledge+k, -2);
        cerr<<"::"<<t<<endl;
    }
    int j = n-1;
    typedef pair<int,int> intint;
    priority_queue< intint, vector<intint>, less<intint> > lemmingWeight;
    int mostWeight = 2000000000;

    for (int i=k-1; i>=0; i--) {
        while (j>=0) {
            int y= byVelWeight[j].second;
            int weight = m[y];
            int vel    = v[y];

            //maximum position we can place lemming i in.

            //pick max pos such that (pos+1)/vi <= t
            //                     (pos+1)    <= t * vi
            //                      pos       <= t * vi - 1
            int maxPos = (int)(min<double>(t * vel, k) ) - 1;
            if (maxPos < i) {
                break;
            } else {
                if ( weight <= mostWeight ) {
                    lemmingWeight.push( make_pair(weight, y ) );
                }
                j--;
            }
        }
        if (lemmingWeight.empty()) {
            return false;
        } else {
            intint it = lemmingWeight.top();
            mostWeight = it.first;
            ledge[i] = it.second;
            lemmingWeight.pop();
        }
    }
    return true;
}
/* height is useless */

void solve()
{
    for (int i=0; i<n; i++) {
        byVelWeight[i] = make_pair(make_pair(v[i], m[i]), i);
    }
    sort(byVelWeight, byVelWeight + n);
    double hi = 100001.0, lo = 0;
    // { possible(hi) }
    // { impossible(lo) }
    for (int iter=0; iter<60; iter++) {
        double t = (hi+lo) / 2;
        if (makeLedges(t)) {
            hi = t;
        } else {
            lo = t;
        }

    }
    makeLedges(hi, true);
    for (int i=0; i<k; i++) {
        if (ledge[i]==-2) {
            cout<<hi<<endl;
        } else {
            cout << (i?" ":"") << (ledge[i]+1);
        }
    }
    cout << endl;

}

inline void init(){}
//=========================================================
// I/O:
//
int main()
{
    init();

    bool prev = false;
    while( cin >> n >> k >> h ) {
        if (prev) {
            cout << endl;
        }
        prev = true;
        for (int i=0; i<n; i++) {
            cin >> m[i];
        }
        for (int j=0; j<n; j++) {
            cin >> v[j];
        }
        solve();

    }
    return 0;
}

#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <algorithm>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <vector>

using namespace std;

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<string> vs;

const int INF = (int) 1E9;
const ll LINF = (ll) 1E18;

#define FOR(i, a, b) for (int i = (a); i <= (b); i++)
#define FORD(i, a, b) for (int i = (a); i >= (b); i--)
#define REP(i, a) for (int i = 0; i < (a); i++)
#define REPD(i, a) for (int i = (a) - 1; i >= 0; i--)
#define FIT(it, v) for (typeof((v).begin())it = (v).begin(); it != (v).end(); ++it)
#define FITD(it, v) for (typeof((v).rbegin())it = (v).rbegin(); it != (v).rend(); ++it)

#define ALL(v) (v).begin(), (v).end()
#define SET(a, x) memset((a), (x), sizeof(a))
#define SIZE(a) ((int)(a).size())

#define SORT(x) sort(ALL(x))
#define GSORT(x) sort(ALL(x), greater<typeof(*((x).begin()))>())
#define UNIQUE(v) SORT(v); (v).resize(unique(ALL(v)) - (v).begin())

#define PB push_back
#define MP make_pair
#define F first
#define S second

int INP, AM;
#define BUFSIZE (1<<10)
char BUF[BUFSIZE + 1], *inp = BUF;
#define GETCHAR(INP) { \
    if(!*inp) { \
        fread(BUF,1,BUFSIZE,stdin); \
        inp=BUF; \
    } \
    INP=*inp++; \
}
#define DIG(a) (((a)>='0')&&((a)<='9'))
#define GN(j) { \
    AM=0;\
    GETCHAR(INP); while(!DIG(INP) && INP!='-') GETCHAR(INP);\
    if (INP=='-') {AM=1;GETCHAR(INP);} \
    j=INP-'0'; GETCHAR(INP); \
    while(DIG(INP)){j=10*j+(INP-'0');GETCHAR(INP);} \
    if (AM) j=-j;\
}

template<typename T> T gcd(T a, T b) {
    return (b == 0) ? abs(a) : gcd(b, a % b);
}
template<typename T> inline T lcm(T a, T b) {
    return a / gcd(a, b) * b;
}
template<typename T> inline T sqr(T x) {
    return x * x;
}

const char DEBUG_PARAM[] = "__LOCAL_TESTING";

const char IN[] = "input.txt";
const char OUT[] = "output.txt";

int ntest = 0, test;

inline void init();
inline void run();
inline void stop() {
    ntest = test - 1;
}

int main(int argc, char* argv[]) {
    if (argc > 1 && strcmp(argv[1], DEBUG_PARAM) == 0) {
        freopen(IN, "r", stdin);
        //      freopen(OUT, "w", stdout);
    }
    init();
    if (ntest == 0) {
        puts("ntest = ?");
        return 0;
    }
    for (test = 1; test <= ntest; test++) {
        run();
    }
    return 0;
}

/* IMPLEMENTATION */

const int dx[] = { -1, 0, 0, 1 };
const int dy[] = { 0, -1, 1, 0 };

const double EPS = 1E-6;
const ll MODULO = 1000000007LL;

inline void init() {
    ntest = 1; // Input ntest
}
const int maxn = 100000 + 5;
int k, n;
double h[maxn];
double m[maxn];
double v[maxn];
int pos[maxn];
int res[maxn];
int temp[maxn];

bool check(double t) {
    int cur = 1;
    FOR(i,1,k) {
        while (cur <= n && v[cur] * t + EPS < h[i])
            cur++;
        if (cur > n)
            return false;
        temp[i] = cur;
        cur++;
    }
    FOR(i,1,k)
        res[i] = temp[i];
    return true;
}
void sort(int l, int r) {
    if (l >= r)
        return;
    double key = m[(l + r) >> 1];
    int i = l, j = r;
    do {
        while (m[i] < key)
            i++;
        while (m[j] > key)
            j--;
        if (i <= j) {
            swap(m[i], m[j]);
            swap(v[i], v[j]);
            swap(pos[i], pos[j]);
            i++;
            j--;
        }
    } while (i <= j);
    sort(l, j);
    sort(i, r);
}
void solve() {
    double l = 0, r = 1e12;
    double mid;
    while (l + EPS < r) {
        mid = (l + r) / 2;
        if (check(mid))
            r = mid;
        else
            l = mid;
    }
    FOR(i,1,k) {
        cout << pos[res[i]];
        if (i != k)
            cout << " ";
    }
}
inline void run() {
    double t;
    cin >> n >> k >> t;
    FOR(i,1,k)
        h[i] = t * i;
    FOR(i,1,n)
        cin >> m[i];
    FOR(i,1,n)
        cin >> v[i];
    FOR(i,1,n)
        pos[i] = i;
    sort(1, n);
    solve();
}

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

const int maxn = 1e5 + 10, inf = 1e9 + 1;
const double eps = 1e-9;
int v[maxn], m[maxn], n, k, h, ans[maxn];
vector<int> ord;

bool check(double t) {
    size_t ptr = 0;
    vector<int> tans(maxn);
    for (int i = 1; i <= k; ++i) {
        double req = (i * h * 1.0) / t;
        while (ptr < n && v[ord[ptr]] < req) ++ptr;
        if (ptr >= n) return false;
        tans[i] = ord[ptr];
        ++ptr;
    }
    for (int i = 1; i <= k; ++i) ans[i] = tans[i];
}

double bs(double l, double r) {
    if (r - l < eps) return l;
    double m = (l + r) / 2.0;
    if (check(m)) return bs(l, m);
    return bs(m, r);
}

int main() {
    ios_base::sync_with_stdio(false); cin.tie(0);
    cin >> n >> k >> h;
    for (int i = 0; i < n; ++i) cin >> m[i];
    for (int i = 0; i < n; ++i) cin >> v[i];
    for (int i = 0; i < n; ++i) ord.push_back(i);
    sort(ord.begin(), ord.end(), [&](const int &a, const int &b) { return m[a] == m[b] ? v[a] < v[b] : m[a] < m[b]; });
    bs(0, inf);
    for (int i = 1; i <= k; ++i) cout << ans[i] + 1 << ' '; cout << endl;
    return 0;
}

#include<bits/stdc++.h>
using namespace std;
const int N=1e5;
int n,k,h;
vector<int> v;

struct leming{
    int m,v,link;
} a[N];
inline char operator<(leming a,leming b){
    if(a.m!=b.m) return a.m<b.m;
    return a.v<b.v;
}

inline char f(double t){
    v.clear();
    int cur=0;
    for(int i=0;i<n && cur<k;i++)
        if((double) (cur+1)*h<=t*a[i].v) cur++,v.push_back(a[i].link);
    return cur==k;
}

main(){
#ifndef ONLINE_JUDGE
    freopen("1.txt","r",stdin);
#endif // ONLINE_JUDGE

    scanf("%d%d%d",&n,&k,&h);
    for(int i=0;i<n;i++) scanf("%d",&a[i].m);
    for(int i=0;i<n;i++){
        scanf("%d",&a[i].v);
        a[i].link=i+1;
    }
    sort(a,a+n);

    double l=0,r=(double)h*k;
    for(int i=0;i<90;i++){
        double m=(l+r)/2;
        if(f(m)) r=m;
            else l=m+1;
    }

    while(!f(l)) l++;
    for(int i=0;i<v.size();i++) printf("%d ",v[i]);

    return 0;
}

#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <queue>
#include <stack>
using namespace std;
typedef long long ll;
struct node
{
    ll m,v;
    int num;
    bool operator <(const node& other) const
    {
        if(m==other.m)
            return v<other.v;
        else
            return m<other.m;
    }
};
ll v[100005];
ll m[100005];
vector<node> vn;
vector<int> ans;
ll n,k,h;
ll ok(long double t)
{
    ll now=0;
    for(ll i=1;i<=k;i++)
    {
        int tr=0;
        while(now<vn.size())
        {
            if((long double)(vn[now].v)*t>=(long double)(i*h))
            {
                tr=1;
                now++;
                break;
            }
            now++;
        }
        if(tr==0)
            return 0;
    }
    return 1;
}
void solve(long double t)
{
     ll now=0;
    for(ll i=1;i<=k;i++)
    {
        int tr=0;
        while(now<vn.size())
        {
            if((long double)(vn[now].v)*t>=(long double)(i*h))
            {
                ans.push_back(vn[now].num);
                tr=1;
                now++;
                break;
            }
            now++;
        }
    }
}
int main()
{
    memset(m,0,sizeof(m));
    memset(v,0,sizeof(v));
    cin>>n>>k>>h;
    for(ll i=1;i<=n;i++)
    {
        scanf("%I64d",&m[i]);
    }
    for(ll i=1;i<=n;i++)
    {
        scanf("%I64d",&v[i]);
    }
    for(ll i=1;i<=n;i++)
    {
        node h;
        h.m=m[i];
        h.v=v[i];
        h.num=i;
        vn.push_back(h);
    }
    sort(vn.begin(),vn.end());
    long double left=0;
    long double right=1000000008;
    long double mid=(right+left)/2.0;
   for(int i=1;i<=1000;i++)
    {
        if(ok(mid))
        {
            right=mid;
        }
        else
            left=mid;
        mid=(right+left)/2.0;
    }
solve(mid+1e-18);
for(int i=0;i<ans.size();i++)
{
    if(i!=ans.size()-1)
        cout<<ans[i]<<" ";
    else
        cout<<ans[i]<<endl;
}
    return 0;
}

#include<bits/stdc++.h>

using namespace std;

int N, K, H, mod = 1e9 + 7;
pair < pair < int, int >, int > x[200009];
int add (int x, int y) {int z = x + y; if (z >= mod) z -= mod; return z;}
int subtract (int x, int y) {int z = x - y; if (z < 0) z += mod; return z;}
int mul (int x, int y) {return 1LL * x * y % mod;}
int power (int a, int b)
{
    int p = 1;
    for (int i=0; (1 << i) <= b; i++)
    {
        if (b & (1 << i)) p = mul (p, a);
        a = mul (a, a);
    }
    return p;
}
/*void Prec (int lim){fac[0] = inv[0] = 1;for (int i=1; i<=lim; i++)fac[i] = mul (fac[i - 1], i);
inv[lim] = power (fac[lim], mod - 2);for (int i=lim - 1; i>=1; i--)inv[i] = mul (inv[i + 1], i + 1);}
int comb (int N, int K){if (K < 0 || K > N || N < 0) return 0;
int ans = mul (fac[N], inv[K]);ans = mul (ans, inv[N - K]);return ans;}*/

vector < int > ans;
bool ok (double T)
{
    int curr_max_pos = 0;
    ans.clear ();
    for (int i=1; i<=N; i++)
    {
        int max_pos = (double) 1.0 * T * x[i].first.second / H;
        if (curr_max_pos + 1 <= max_pos)
            ans.push_back (x[i].second), curr_max_pos ++;
    }
    return (curr_max_pos >= K);
}

int main ()
{
//freopen ("input", "r", stdin);
//freopen ("output", "w", stdout);

scanf ("%d %d %d", &N, &K, &H);
for (int i=1; i<=N; i++)
    scanf ("%d", &x[i].first.first), x[i].second = i;
for (int i=1; i<=N; i++)
    scanf ("%d", &x[i].first.second);
sort (x + 1, x + N + 1);
double p = 0.0, u = 1e9, mij, ras;
int steps = 200;
while (steps --)
{
    mij = (p + u) / 2.0;
    if (ok (mij)) ras = mij, u = mij;
    else p = mij;
}
//printf ("%.10f\n", ras);
ok (ras);
for (auto it : ans)
    printf ("%d ", it);
printf ("\n");
return 0;
}

#include <cstdio>
#include <iostream>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#define eps 1e-10
#define N 100010

using namespace std;

struct Lemming {
    int id, w, v;
    bool operator < (const Lemming & a) const {
        return w < a.w || w == a.w && v < a.v;
    }
}lem[N];

int n, k, h, ans[N];

bool check(double time, double &realtime) {
    int i = 1, j = 1;
    realtime = 0;
    while(i <= k && j <= n) {
        while(j <= n && 1.0 / lem[j].v * i * h > time) {
            ++j;
        }
        if(j <= n) {
            ans[i] = lem[j].id;
            realtime = max(realtime, 1.0 / lem[j].v * i * h);
            ++i, ++j;
        }
    }
    return i > k;
}

int main()
{
    while(cin >> n >> k >> h) {
        double lt = 0, rt = 0, time;
        for(int i = 1; i <= n; ++i) {
            cin >> lem[i].w;
            lem[i].id = i;
        }
        for(int i = 1; i <= n; ++i) {
            cin >> lem[i].v;
            rt = max(rt, 1.0 * i * h / lem[i].v);
        }
        sort(lem + 1, lem + n + 1);
        while(lt + eps < rt) {
            double mid = (lt + rt) / 2;
            if(check(mid, time)) {
                rt = time;
            } else {
                lt = mid;
            }
        }
        check(lt + eps, time);
        for(int i = 1; i < k; ++i) {
            cout << ans[i] << ' ';
        }
        cout << ans[k] << endl;
    }
    return 0;
}

#include<iostream>
#include<algorithm>
using namespace std;

#define maxn 100005
#define MOD 1000000007

long long n,k,h;

struct Node
{
    long long m,v;
    int id;

    bool operator<(const Node &x) const{

        if(m!=x.m) return m<x.m;

        return v<x.v;
    }
}q[maxn];

bool ok(long long t)
{
    int i,j;
    j=1;

    for(i=0;i<n;i++)
    {
        if(q[i].v*t>=j*h)
        {
        j++;
        }

        if(j>k) return true;
    }

    return false;

}
int main()
{
    int i,j;

    cin>>n>>k>>h;

    for(i=0;i<n;i++) cin>>q[i].m;

    for(i=0;i<n;i++)
    {
        cin>>q[i].v;
        q[i].id=i+1;
    }

    sort(q,q+n);

    long long l,r,mid;

    l=0,r=1000000000;

    while(l<r)
    {
        mid=(l+r)>>1;

        if(!ok(mid)) l=mid+1;
        else r=mid;

    }

    j=1;
    for(i=0;i<n;i++)
    {
        if(q[i].v*l>=j*h)
        {
            cout<<q[i].id<<" ";
            j++;
        }
        if(j>k) break;
    }

}

/*
ID: lxc9021
PROG: hamming
LANG: C++
*/
/** @author starLeo
 *  Standard C++ Header File For Contests
 */
#include <iostream>
#include <fstream>
//#include <cstdio>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <functional>
#include <utility> //pair
#include <map>
//#include <set>
#include <list>
#include <deque>
#include <queue>
#include <stack>
#include <cctype>
#include <cstring>
//#include <malloc.h>
using namespace std;
#define R(x) scanf("%d",&(x)) //read int
#define RS(x) scanf("%s",(x)) //read string
#define PL(x) printf("%d\n",(x)) //println int
#define REP(i,n) for(int i(0),_n(n);i<_n;++i)
#define FOR(i,l,h) for(int i(l),_h(h);i<=_h;++i)
#define FORD(i,h,l) for(int i(h),_l(l);i>=_l;--i)
#define RESET(a,b) memset((a),b,sizeof(a))
#define DEBUG(exp) (cout<<(#exp)<<" = "<<(exp)<<endl)
//#define oo (1234567890LL) // 64bits
#define oo (1<<29) // 32bits
//#define oo 9999999999.0 // Double
#define eps 1e-7
typedef long long Int;
typedef pair<int,int> pii;
typedef pair<long double,long double> pdd;

#define M ( 100000+10 )
struct Lem {
    int m,v,id;
    bool operator < (Lem b) const {
        return m<b.m || (m==b.m && v<b.v);
    }
};

int n,k,h;
Lem a[M];

bool can(long double t)
{
    int j=k;
    FORD(i,n-1,0) {
        if( j>0 && (long double)j*h/a[i].v - t <= -eps ) j--;
    }
    return j==0;
}
void putAns(long double t)
{
    int ans[M];
    int j=k;
    FORD(i,n-1,0) {
        if( j>0 && (long double)j*h/a[i].v - t <= -eps ) ans[--j]=a[i].id;
    }
    REP(i,k-1) printf("%d ",ans[i]);
    PL(ans[k-1]);
}
int main()
{
#ifndef MyComputer
//    freopen("hamming.in","r",stdin);
//    freopen("hamming.out","w",stdout);
#endif

    R(n),R(k),R(h);
    REP(i,n) R(a[i].m),a[i].id=i+1;
    REP(i,n) R(a[i].v);
    sort(a,a+n);

    long double l=1e-10, r=1e10;
    int cnt=100;
    while(l-r<-eps) {
        long double mid=(l+r)/2.0;
        if( can(mid) ) r=mid;
        else l=mid;
    }
    putAns(r);

    return 0;
}

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int n,k,h;
// base and base_digits must be consistent
const int base = 1000000000;
const int base_digits = 9;

struct bigint {
    vector<int> z;
    int sign;

    bigint() :
        sign(1) {
    }

    bigint(long long v) {
        *this = v;
    }

    bigint(const string &s) {
        read(s);
    }

    void operator=(const bigint &v) {
        sign = v.sign;
        z = v.z;
    }

    void operator=(long long v) {
        sign = 1;
        if (v < 0)
            sign = -1, v = -v;
        z.clear();
        for (; v > 0; v = v / base)
            z.push_back(v % base);
    }

    bigint operator+(const bigint &v) const {
        if (sign == v.sign) {
            bigint res = v;

            for (int i = 0, carry = 0; i < (int) max(z.size(), v.z.size()) || carry; ++i) {
                if (i == (int) res.z.size())
                    res.z.push_back(0);
                res.z[i] += carry + (i < (int) z.size() ? z[i] : 0);
                carry = res.z[i] >= base;
                if (carry)
                    res.z[i] -= base;
            }
            return res;
        }
        return *this - (-v);
    }

    bigint operator-(const bigint &v) const {
        if (sign == v.sign) {
            if (abs() >= v.abs()) {
                bigint res = *this;
                for (int i = 0, carry = 0; i < (int) v.z.size() || carry; ++i) {
                    res.z[i] -= carry + (i < (int) v.z.size() ? v.z[i] : 0);
                    carry = res.z[i] < 0;
                    if (carry)
                        res.z[i] += base;
                }
                res.trim();
                return res;
            }
            return -(v - *this);
        }
        return *this + (-v);
    }

    void operator*=(int v) {
        if (v < 0)
            sign = -sign, v = -v;
        for (int i = 0, carry = 0; i < (int) z.size() || carry; ++i) {
            if (i == (int) z.size())
                z.push_back(0);
            long long cur = z[i] * (long long) v + carry;
            carry = (int) (cur / base);
            z[i] = (int) (cur % base);
            //asm("divl %%ecx" : "=a"(carry), "=d"(a[i]) : "A"(cur), "c"(base));
        }
        trim();
    }

    bigint operator*(int v) const {
        bigint res = *this;
        res *= v;
        return res;
    }

    friend pair<bigint, bigint> divmod(const bigint &a1, const bigint &b1) {
        int norm = base / (b1.z.back() + 1);
        bigint a = a1.abs() * norm;
        bigint b = b1.abs() * norm;
        bigint q, r;
        q.z.resize(a.z.size());

        for (int i = a.z.size() - 1; i >= 0; i--) {
            r *= base;
            r += a.z[i];
            int s1 = b.z.size() < r.z.size() ? r.z[b.z.size()] : 0;
            int s2 = b.z.size() - 1 < r.z.size() ? r.z[b.z.size() - 1] : 0;
            int d = ((long long) s1 * base + s2) / b.z.back();
            r -= b * d;
            while (r < 0)
                r += b, --d;
            q.z[i] = d;
        }

        q.sign = a1.sign * b1.sign;
        r.sign = a1.sign;
        q.trim();
        r.trim();
        return make_pair(q, r / norm);
    }

    friend bigint sqrt(const bigint &a1) {
        bigint a = a1;
        while (a.z.empty() || a.z.size() % 2 == 1)
            a.z.push_back(0);

        int n = a.z.size();

        int firstDigit = (int) sqrt((double) a.z[n - 1] * base + a.z[n - 2]);
        int norm = base / (firstDigit + 1);
        a *= norm;
        a *= norm;
        while (a.z.empty() || a.z.size() % 2 == 1)
            a.z.push_back(0);

        bigint r = (long long) a.z[n - 1] * base + a.z[n - 2];
        firstDigit = (int) sqrt((double) a.z[n - 1] * base + a.z[n - 2]);
        int q = firstDigit;
        bigint res;

        for(int j = n / 2 - 1; j >= 0; j--) {
            for(; ; --q) {
                bigint r1 = (r - (res * 2 * base + q) * q) * base * base + (j > 0 ? (long long) a.z[2 * j - 1] * base + a.z[2 * j - 2] : 0);
                if (r1 >= 0) {
                    r = r1;
                    break;
                }
            }
            res *= base;
            res += q;

            if (j > 0) {
                int d1 = res.z.size() + 2 < r.z.size() ? r.z[res.z.size() + 2] : 0;
                int d2 = res.z.size() + 1 < r.z.size() ? r.z[res.z.size() + 1] : 0;
                int d3 = res.z.size() < r.z.size() ? r.z[res.z.size()] : 0;
                q = ((long long) d1 * base * base + (long long) d2 * base + d3) / (firstDigit * 2);
            }
        }

        res.trim();
        return res / norm;
    }

    bigint operator/(const bigint &v) const {
        return divmod(*this, v).first;
    }

    bigint operator%(const bigint &v) const {
        return divmod(*this, v).second;
    }

    void operator/=(int v) {
        if (v < 0)
            sign = -sign, v = -v;
        for (int i = (int) z.size() - 1, rem = 0; i >= 0; --i) {
            long long cur = z[i] + rem * (long long) base;
            z[i] = (int) (cur / v);
            rem = (int) (cur % v);
        }
        trim();
    }

    bigint operator/(int v) const {
        bigint res = *this;
        res /= v;
        return res;
    }

    int operator%(int v) const {
        if (v < 0)
            v = -v;
        int m = 0;
        for (int i = z.size() - 1; i >= 0; --i)
            m = (z[i] + m * (long long) base) % v;
        return m * sign;
    }

    void operator+=(const bigint &v) {
        *this = *this + v;
    }
    void operator-=(const bigint &v) {
        *this = *this - v;
    }
    void operator*=(const bigint &v) {
        *this = *this * v;
    }
    void operator/=(const bigint &v) {
        *this = *this / v;
    }

    bool operator<(const bigint &v) const {
        if (sign != v.sign)
            return sign < v.sign;
        if (z.size() != v.z.size())
            return z.size() * sign < v.z.size() * v.sign;
        for (int i = z.size() - 1; i >= 0; i--)
            if (z[i] != v.z[i])
                return z[i] * sign < v.z[i] * sign;
        return false;
    }

    bool operator>(const bigint &v) const {
        return v < *this;
    }
    bool operator<=(const bigint &v) const {
        return !(v < *this);
    }
    bool operator>=(const bigint &v) const {
        return !(*this < v);
    }
    bool operator==(const bigint &v) const {
        return !(*this < v) && !(v < *this);
    }
    bool operator!=(const bigint &v) const {
        return *this < v || v < *this;
    }

    void trim() {
        while (!z.empty() && z.back() == 0)
            z.pop_back();
        if (z.empty())
            sign = 1;
    }

    bool isZero() const {
        return z.empty() || (z.size() == 1 && !z[0]);
    }

    bigint operator-() const {
        bigint res = *this;
        res.sign = -sign;
        return res;
    }

    bigint abs() const {
        bigint res = *this;
        res.sign *= res.sign;
        return res;
    }

    long long longValue() const {
        long long res = 0;
        for (int i = z.size() - 1; i >= 0; i--)
            res = res * base + z[i];
        return res * sign;
    }

    friend bigint gcd(const bigint &a, const bigint &b) {
        return b.isZero() ? a : gcd(b, a % b);
    }
    friend bigint lcm(const bigint &a, const bigint &b) {
        return a / gcd(a, b) * b;
    }

    void read(const string &s) {
        sign = 1;
        z.clear();
        int pos = 0;
        while (pos < (int) s.size() && (s[pos] == '-' || s[pos] == '+')) {
            if (s[pos] == '-')
                sign = -sign;
            ++pos;
        }
        for (int i = s.size() - 1; i >= pos; i -= base_digits) {
            int x = 0;
            for (int j = max(pos, i - base_digits + 1); j <= i; j++)
                x = x * 10 + s[j] - '0';
            z.push_back(x);
        }
        trim();
    }

    friend istream& operator>>(istream &stream, bigint &v) {
        string s;
        stream >> s;
        v.read(s);
        return stream;
    }

    friend ostream& operator<<(ostream &stream, const bigint &v) {
        if (v.sign == -1)
            stream << '-';
        stream << (v.z.empty() ? 0 : v.z.back());
        for (int i = (int) v.z.size() - 2; i >= 0; --i)
            stream << setw(base_digits) << setfill('0') << v.z[i];
        return stream;
    }

    static vector<int> convert_base(const vector<int> &a, int old_digits, int new_digits) {
        vector<long long> p(max(old_digits, new_digits) + 1);
        p[0] = 1;
        for (int i = 1; i < (int) p.size(); i++)
            p[i] = p[i - 1] * 10;
        vector<int> res;
        long long cur = 0;
        int cur_digits = 0;
        for (int i = 0; i < (int) a.size(); i++) {
            cur += a[i] * p[cur_digits];
            cur_digits += old_digits;
            while (cur_digits >= new_digits) {
                res.push_back(int(cur % p[new_digits]));
                cur /= p[new_digits];
                cur_digits -= new_digits;
            }
        }
        res.push_back((int) cur);
        while (!res.empty() && res.back() == 0)
            res.pop_back();
        return res;
    }

    typedef vector<long long> vll;

    static vll karatsubaMultiply(const vll &a, const vll &b) {
        int n = a.size();
        vll res(n + n);
        if (n <= 32) {
            for (int i = 0; i < n; i++)
                for (int j = 0; j < n; j++)
                    res[i + j] += a[i] * b[j];
            return res;
        }

        int k = n >> 1;
        vll a1(a.begin(), a.begin() + k);
        vll a2(a.begin() + k, a.end());
        vll b1(b.begin(), b.begin() + k);
        vll b2(b.begin() + k, b.end());

        vll a1b1 = karatsubaMultiply(a1, b1);
        vll a2b2 = karatsubaMultiply(a2, b2);

        for (int i = 0; i < k; i++)
            a2[i] += a1[i];
        for (int i = 0; i < k; i++)
            b2[i] += b1[i];

        vll r = karatsubaMultiply(a2, b2);
        for (int i = 0; i < (int) a1b1.size(); i++)
            r[i] -= a1b1[i];
        for (int i = 0; i < (int) a2b2.size(); i++)
            r[i] -= a2b2[i];

        for (int i = 0; i < (int) r.size(); i++)
            res[i + k] += r[i];
        for (int i = 0; i < (int) a1b1.size(); i++)
            res[i] += a1b1[i];
        for (int i = 0; i < (int) a2b2.size(); i++)
            res[i + n] += a2b2[i];
        return res;
    }

    bigint operator*(const bigint &v) const {
        vector<int> a6 = convert_base(this->z, base_digits, 6);
        vector<int> b6 = convert_base(v.z, base_digits, 6);
        vll a(a6.begin(), a6.end());
        vll b(b6.begin(), b6.end());
        while (a.size() < b.size())
            a.push_back(0);
        while (b.size() < a.size())
            b.push_back(0);
        while (a.size() & (a.size() - 1))
            a.push_back(0), b.push_back(0);
        vll c = karatsubaMultiply(a, b);
        bigint res;
        res.sign = sign * v.sign;
        for (int i = 0, carry = 0; i < (int) c.size(); i++) {
            long long cur = c[i] + carry;
            res.z.push_back((int) (cur % 1000000));
            carry = (int) (cur / 1000000);
        }
        res.z = convert_base(res.z, 6, base_digits);
        res.trim();
        return res;
    }
};

bigint random_bigint(int n) {
    string s;
    for (int i = 0; i < n; i++) {
        s += rand() % 10 + '0';
    }
    return bigint(s);
}

struct lemming{
    int mass,speed,id;
    bool operator<(const lemming &t)const{
        if(mass != t.mass)
            mass < t.mass;
        return speed < t.speed;
    }
    bool climbs(ll height, bigint &t){
        return !(t < 1000000000*height/speed);
    }
};
vector<lemming> arr;
bool solve(bigint &t, bool print){
    /*
    vector<pair<int,int> > choice;
    priority_queue<pair<int,int> > fat_lemming;
    int l = 0;
    for(int height = k*h; height >= h; height -= h){
        while(l < n && arr[l].climbs(height,t)){
            fat_lemming.push({arr[l].mass,arr[l].id});
            ++l;
        }
        while(!choice.empty() && !fat_lemming.empty() && fat_lemming.top().first > choice.back().first)
            fat_lemming.pop();
        if(fat_lemming.empty())
            return false;
        auto cur = fat_lemming.top();
        fat_lemming.pop();
        choice.push_back(cur);
    }
    */
    vector<int> choice;
    int cnt = 1;
    for(int i = 0; i < n; ++i){
        if(arr[i].climbs(cnt*h,t)){
            choice.push_back(arr[i].id);
            ++cnt;
        }
    }
    if(cnt <= k)
        return false;
    if(print){
        for(int i = 0; i < k; ++i)
            printf("%d%c",choice[i]," \n"[i==k-1]);
    }
    return true;
}
int main(){
    cin >> n >> k >> h;
    arr.resize(n);
    for(int i = 0; i < n; ++i)
        scanf("%d",&arr[i].mass);
    for(int i = 0; i < n; ++i)
        scanf("%d",&arr[i].speed);
    for(int i = 0; i < n; ++i)
        arr[i].id = i+1;
    sort(arr.begin(),arr.end());
    bigint lo("1"),hi("10000000000000000000"),mid;
    while(lo < hi){
        mid = (lo+hi)/2;
        if(solve(mid,0))
            hi = mid;
        else
            lo = mid+1;
    }
    solve(hi,true);
}

#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <vector>

using namespace std;

const int N = 100086;

struct node
{
    double d;
    int w, id;
    node (int _w, double _d, int _id) : w (_w) , d(_d), id(_id) {};
    bool operator < (const node & sec) const
    {
        if( w > sec.w)  return true;
        else if ( w == sec.w && d > sec.d) return true;
        return false;
    }
};
int n, k, h;

vector <node> dat;
int mtmp[N], vtmp[N];
int chosn[N];

bool isok(double t)
{
    dat.clear();
    for(int i = 0; i < n; i++)
    {
        dat.push_back(node(mtmp[i], vtmp[i] * t, i + 1));
    }
    sort(dat.begin(), dat.end());
    int cnt = 0;
    for(int i = 0; i < n; i++)
    {
        if(dat[i].d + 1e-8 >= (k - cnt + 0.0) * (double) h + 1e-8)
        {
            chosn[k - cnt - 1] = dat[i].id;
            cnt++;
        }
        if(cnt == k) return true;
    }
    memset(chosn, -1, sizeof(chosn));
    return false;
}

int main()
{
    while(scanf("%d %d %d",&n, &k, &h) == 3)
    {
        dat.clear();
        for(int i = 0; i < n; i++)
        {
            scanf("%d", &mtmp[i]);
        }
        for(int i = 0; i < n; i++)
        {
            scanf("%d", &vtmp[i]);
        }
        double lef = 0, rig = 1e40, mid = 0;
        for(int it = 0; it < 200; it++)
        {
            mid = (lef + rig) / 2;
            if(isok(mid))
            {
                rig = mid;
            }
            else
                lef = mid;
        }
        for(int i = 0; i < k; i++)
        {
            printf("%d%c", chosn[i] , i == k - 1 ? '\n' : ' ');
        }
    }
    return 0;
}

/*
TASK: VK2012_2_2_4 - Lemmings
LANG: C++
NAME: untitled.cpp
*/
#include <cstdio>
#include <algorithm>

#define NMAX 100000
#define TMAX 1000000010
typedef long long int LL;
const double EPS=1e-12;

using namespace std;

pair<int/*weight*/,pair<int/*speed*/,int/*index*/> > table[NMAX];

bool check(double t,int n,int k,int h)
{
	int cnt=0;
	for(int i=0;i<n&&cnt<k;i++){
		if(((double)(cnt+1))*((double)h)<=t*((double)table[i].second.first)){
			cnt++;
		}
	}
	return k==cnt;
}

int main()
{
	//FILE *fin=NULL,*fout=NULL;
	//fin = freopen("input.txt","r",stdin);
	//fout = freopen("output.txt","w",stdout);

	//二分探索+greedy。 O(NlogT)

	int n,k,h; scanf("%d%d%d",&n,&k,&h);
	for(int i=0;i<n;i++){
		scanf("%d",&table[i].first);
		table[i].second.second = i+1;
	}
	for(int i=0;i<n;i++){
		scanf("%d",&table[i].second.first);
	}

	double left=0,right=TMAX;
	sort(table,table+n);
	while(right-left>EPS){
		double mid=(left+right)/2;
		if(check(mid,n,k,h)){
			right = mid;
		}else{
			left = mid;
		}
	}

	double t=right; //printf("%lf\n",t);
	int cnt=0;
	for(int i=0;i<n&&cnt<k;i++){
		if(((double)(cnt+1))*((double)h)<=t*((double)table[i].second.first)){
			if(0!=cnt) printf(" ");
			printf("%d",table[i].second.second);
			cnt++;
		}
	}
	printf("\n");

	//finalize
	//if(NULL!=fin) fclose(fin);
	//if(NULL!=fout) fclose(fout);

	return 0;
}

#include<cstring>
#include<cstdlib>
#include<algorithm>
#include<cstdio>
#define N 120000
using namespace std;
int n,m,h,id[N],use[N],w[N],v[N],i;
long double l,r,mid;
bool cmp(const int &a,const int &b){
	return w[a]<w[b] || w[a]==w[b] && v[a]<v[b];
}
bool check(long double mid){
	int i,i_,s=1;
	for(i_=1;i_<=n;++i_){
		i=id[i_];
		if(mid*v[i]/h>=s){
			use[s]=i;
			s++;
		}
	}
	return s-1>=m;
}
int main(){
	scanf("%d%d%d",&n,&m,&h);
	for(i=1;i<=n;++i)scanf("%d",&w[i]),id[i]=i;
	for(i=1;i<=n;++i)scanf("%d",&v[i]);
	sort(id+1,id+n+1,cmp);
	l=0; r=1e9+1;
	while(l+1e-15<=r){
		mid=(l+r)/2;
		if(check(mid))r=mid;
		else l=mid;
	}
	check(r);
	for(i=1;i<=m;++i)printf("%d ",use[i]);
}

#include <cstdio>
#include <algorithm>
using namespace std;

const int N=100000+5;

int n, k, h;

struct Lemming {
	int id;
	int m, v;
	inline bool operator < (const Lemming &b) const {
		if(m!=b.m) return m<b.m;
		return v<b.v;
	}
};
Lemming lem[N];

inline int calc(double t) {
	int nid=1;
	for(int i=1; i<=n; ++i) {
		if((double)nid*h<=(double)t*lem[i].v) ++nid;
	}
	return nid-1;
}
inline void output(double t) {
	int nid=1;
	for(int i=1; i<=n; ++i) {
		if((double)nid*h<=(double)t*lem[i].v) {
			printf("%d ", lem[i].id);
			++nid;
			if(nid>k) break;
		}
	}
	if(nid<=k) {
		while(1);
	}
	putchar('\n');
}

int main() {
	scanf("%d%d%d", &n, &k, &h);
	for(int i=1; i<=n; ++i) lem[i].id=i;
	for(int i=1; i<=n; ++i) scanf("%d", &lem[i].m);
	for(int i=1; i<=n; ++i) scanf("%d", &lem[i].v);
	sort(lem+1, lem+n+1);
	double l=-1, r=2000000000;
	for(int tt=1; tt<=100; ++tt) {
		double mid=(l+r)*0.5;
		if(calc(mid)>=k) r=mid; else l=mid;
	}
	//printf("%d\n", r);
	output(r+1e-9);
	return 0;
}

#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cctype>
#include <climits>
#include <cassert>
#include <string>
#include <bitset>
#include <vector>
#include <list>
#include <deque>
#include <stack>
#include <queue>
#include <map>
#include <set>
#include <utility>
#include <algorithm>
using namespace std;

#define INF 1000000000
#define LL_INF 4000000000000000000ll
#define EPS (1e-9)

#define Lowbit(x) ((x) & (-(x)))
#define Lc(x) ((x) << 1)
#define Rc(x) (lc(x) + 1)
#define Pow2(x) (1 << (x))
#define Contain(a, x) ((bool)(a & Pow2(x)))

#define Rep(i, a, b) for(int i = (a); i <= (b); ++i)
#define Til(i, a, b) for(int i = (a); i >= (b); --i)
#define Foru(i, a, b) for(int i = (a); i < (b); ++i)
#define Ford(i, a, b) for(int i = (a); i > (b); --i)

#define For_edge(i, x) for(edge i = x; i; i = i->next)
#define For(i, x) for(__typeof(x.begin()) i = x.begin(); i != x.end(); ++i)

#define Debug(x) (cout << #x << " = " << (x) << endl)
#define Debug2(x, y) (cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl)

typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
typedef pair<int, int> pii;
typedef vector<int>::iterator vit;
typedef deque<int>::iterator dit;
typedef list<int>::iterator lit;
typedef set<int>::iterator sit;
typedef map<int, int>::iterator mit;

template <class T> inline bool Up(T &a, const T &b) { if(a < b) {a = b; return true;} return false; }
template <class T> inline bool Down(T &a, const T &b) { if(a > b) {a = b; return true;} return false; }

inline int getint() { int tmp, c; while(tmp = getchar(), tmp < '0' || tmp > '9'); tmp -= '0'; while(c = getchar(), '0' <= c && c <= '9') tmp = tmp * 10 + c - '0'; return tmp; }
inline int getsigned() { int tmp, c, flag; while(flag = getchar(), flag != '-' && (flag < '0' || flag > '9')); if(flag == '-') tmp = 0; else tmp = flag - '0'; while(c = getchar(), '0' <= c && c <= '9') tmp = tmp * 10 + c - '0'; return flag == '-' ? -tmp : tmp; }

#define MAXN 100022
struct lem {
    int m, v, id;
}L[MAXN];

inline bool operator < (const lem &a, const lem &b) {
    if(a.m != b.m) return a.m > b.m;
    return a.v > b.v;
}

int N, K, H;

__inline double Time(int i, int j) {
    return double(j) * H / L[i].v;
}

void Init() {
    N = getint(); K = getint(); H = getint();
    Rep(i, 1, N) L[i].id = i;
    Rep(i, 1, N) L[i].m = getint();
    Rep(i, 1, N) L[i].v = getint();
    sort(L + 1, L + N + 1);
}

bool Check(double t) {
    int cnt = 0;
    Rep(i, 1, N)
        if(Time(i, K - cnt) <= t)
            if(++cnt == K)
                return true;
    return false;
}

int ans[MAXN];
void GetAns(double t) {
    int cnt = 0;
    Rep(i, 1, N)
        if(Time(i, K - cnt) <= t) {
            ans[++cnt] = L[i].id;
            if(cnt == K) break;
        }
    printf("%d", ans[K]);
    Til(i, K - 1, 1) printf(" %d", ans[i]);
    putchar('\n');
}

void Work() {
    double l = 0, r = 1e30;
    while(r - l > 1e-7) {
        double m = (l + r) / 2;
        if(Check(m)) r = m;
        else l = m;
    }
    GetAns(r);
}

int main() {
    Init();
    Work();
    return 0;
}