Advertisement
erfanul007

Untitled

Jan 17th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.65 KB | None | 0 0
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3.  
  4. typedef long long int ll;
  5. typedef unsigned long long int ull;
  6. typedef vector<int> vi;
  7. typedef vector<ll> vll;
  8. typedef vector<vi> vvi;
  9. typedef pair<int,int> pii;
  10. typedef vector< pii > vpii;
  11. typedef set<int> sti;
  12.  
  13. #define pb push_back
  14. #define pob pop_back
  15. #define mp make_pair
  16. #define ff first
  17. #define ss second
  18. #define loop1(i,n) for(int i=1; i<=int(n); i++)
  19. #define loop(i,y) for(int i=0; i<int(y); i++)
  20. #define rloop(i,y) for(int i=int(y); i>0; i--)
  21. #define rloop1(i,y) for(int i=int(y)-1; i>=0; i--)
  22. #define read() freopen("input.txt", "r", stdin)
  23. #define write() freopen("output.txt", "w", stdout)
  24. #define cspf(i) printf("Case %d: \n", i)
  25. #define all(v) v.begin(),v.end()
  26. #define rall(v) v.rbegin(),v.rend()
  27. /// Constants
  28. #define eps 1e-9
  29. #define PI acos(-1.0) // 3.1415926535897932
  30.  
  31. int main()
  32. {
  33. string s;
  34. cin>>s;
  35. int sz=s.size();
  36. int r,c,x;
  37. r=ceil((double)sz/20);
  38. c=ceil((double)sz/r);
  39. x=r*c;
  40. int st=x-sz;
  41. int y=0,flg=0,i;
  42. cout<<r<<" "<<c<<endl;
  43. for(i=0,y=0;i<x;i++,y++){
  44. if(st>0 && flg==0){
  45. y--;
  46. st--;
  47. flg=1;
  48. cout<<"*";
  49. continue;
  50. }
  51. cout<<s[y];
  52. if((i+1)%c==0 && i>0){
  53. flg=0;
  54. cout<<endl;
  55. }
  56. }
  57. return 0;
  58. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement