#include <stdio.h>

int partition(int *,int,int)

int main(){
  int i,j;
  return 0;
}

int partition(int A[],int p,int r){
  int tmp;
 int  x=A[r];
 i = p-1;
 for(j=p;j<=r-1;j++){
   if(A[j]<=x){
     i++;
     tmp =A[j];
     A[j]=A[i];
     A[i]=tmp;
     }
 } tmp =A[i+1];
     A[i+1]=A[r];
     A[r]=tmp;
     return i+1;
}



