fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. ios::sync_with_stdio(false);
  6. cin.tie(nullptr);
  7. long long n, m;
  8. if (!(cin >> n >> m)) return 0;
  9. // k = m
  10. cout << m << "\n";
  11. for (long long i = 0; i < m - 1; ++i) cout << 'P';
  12. cout << 'D' << "\n";
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0.01s 5316KB
stdin
84 140
stdout
140
PPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPPD