title: SPOJ Fashion giving runtime error Python
body: <p>Problem description is here :  <a href="http://www.spoj.pl/problems/FASHION/" rel="nofollow">http://www.spoj.pl/problems/FASHION/</a> </p>
  
  <p>Process : Took  two lists as input , sort them using the sort() method in Python and then print the sum  </p>
  
  <p>Code : </p>
  
  <pre><code>import sys,os
  #Need to maximize the product of two lists 
  def process(index,line):
      p=line.split(" ")
      #print 'Line after splitting',p
      for i in p:
          if(index==0):
              men.append(int(i))
          else:
              women.append(int(i))
  
  global men
  global women
  men=[]
  women=[]    
  ''' First, you enter number of times you want to compare . 
      Second, you enter number of men/women 
      Then, you enter the real data 
  '''
  
  
  n=int(raw_input()) #This is for number of shows
  num = int(raw_input()) #This is number of men/women
  
  
  for t in range(0,n): #Do this "n" times
  
      men = []
      women = []
      for i in range(0,2): #Now, enter  the men data first  and women next
  
          line=raw_input()
          process(i,line)
      p=0
  
      temp = []
      men.sort()
      women.sort()
  
      for i in range(0,num):
          p = p + men[i]  * women[i]
      print p
  </code></pre>
  
  <p>Problem : It keeps giving runtime error :( </p>
  
  <p>Some cases I have run :</p>
  
  <pre><code>In [16]: %run /home/crazyabtliv/SPOJ/Fashion.py
  2
  3
  1 1 1
  2 3 4
  9
  4 5 6
  0 9 8
  94
  
  In [14]: %run /home/crazyabtliv/SPOJ/Fashion.py
  1
  5
  1 1 0 0 0
  10 10 9 9 9
  20
  </code></pre>
  
  <p>Thanks !</p>