public static void quicksort(int[] nums, int s, int t, int[] pos){
    	int i = s, j = t;
    	int temp = nums[s], prepos = pos[s];
    	while(i < j){
    		while(i < j && temp < nums[j]) j--;
    		if(i < j){
    			nums[i] = nums[j];
    			pos[i++] = pos[j];
    		}
    		while(i < j && temp > nums[i]) i++;
    		if(i < j){
    			nums[j] = nums[i];
    			pos[j--] = pos[i];
    		}
    	}
    	nums[i] = temp;
    	pos[i] = prepos;
    	if(s < i - 1) quicksort(nums, s, i - 1, pos);
    	if(i + 1 < t) quicksort(nums, i + 1, t, pos);
    	
    }