fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. long long S, N;
  6. cin >> S >> N;
  7. long long minNum = 1;
  8. for (int i = 1; i < S; i++)
  9. minNum *= 10;
  10.  
  11. long long k = (minNum + N + 1) / N;
  12. long long x = k * N;
  13. if (x < pow(10, S - 1)) {
  14. cout << x;
  15. } else {
  16. cout << -1;
  17. }
  18.  
  19. return 0;
  20. }
Success #stdin #stdout 0s 5320KB
stdin
3 
6
stdout
-1