title: Python Fast Input Output Using Buffer Competitive Programming
body: <p>I have seen people using buffer in different languages for fast input/output in Online Judges. For example this <a href="http://www.spoj.pl/problems/INTEST/" rel="nofollow">http://www.spoj.pl/problems/INTEST/</a> is done with C like this:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #define size 50000
  
  int main (void){
  unsigned int n=0,k,t;
  char buff[size];
  unsigned int divisible=0;
  int block_read=0;
  int j;
  t=0;
  scanf("%lu %lu\n",&amp;t,&amp;k);
  
  while(t){
      block_read =fread(buff,1,size,stdin);
      for(j=0;j&lt;block_read;j++){
          if(buff[j]=='\n'){
              t--;
              if(n%k==0){
                  divisible++;
              }
              n=0;
          }
          else{
              n = n*10 + (buff[j] - '0');
          }
      }
  }
  
  printf("%d",divisible);
  return 0;
  </code></pre>
  
  <p>How can this be done with python?</p>