Advertisement
arthur393

POODLE

Dec 18th, 2014
158
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.52 KB | None | 0 0
  1. //http://br.spoj.com/problems/POODLEMG/
  2. #include <stdio.h>
  3. int main(void) {
  4.         int n,p,a,b,c;
  5.         while(scanf("%d %d",&n,&p)!=EOF && n>0 && p>0 && n<=1000000 && p<=100){
  6.             a=n-(n%p);
  7.             b=a/p+1;
  8.             c=b-4;
  9.             printf("P");
  10.             if(c>=20)
  11.                 c=c-(c-16);
  12.             else if(c<=2)
  13.                 c=2;
  14.     //printf("n:%d pagina:%d o'\s:%d\n",n,b,c);
  15.             while(c--)
  16.                 printf("o");
  17.             printf("dle\n");
  18.         }
  19.         return 0;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement