fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3. #define IOS ios::sync_with_stdio(false); cin.tie(nullptr);
  4. #define ll long long
  5. #define endl '\n'
  6.  
  7. void fileIO() {
  8. #ifndef ONLINE_JUDGE
  9. freopen("input.txt", "r", stdin);
  10. freopen("output.txt", "w", stdout);
  11. #endif
  12. }
  13.  
  14. // for (int i = 0; i < n; i++){}
  15.  
  16. void solve() {
  17. int n;
  18. cin >> n;
  19.  
  20. if (n >= 18) cout << -1 << endl;
  21. else if (n < 10) cout << n << endl;
  22. else {
  23. int x = n - 9;
  24. cout << x << 9 << endl;
  25. }
  26. }
  27.  
  28. int main() {
  29. IOS;
  30. fileIO();
  31.  
  32. int testCases = 1;
  33. cin >> testCases;
  34. while (testCases--) {
  35. solve();
  36. }
  37. }
  38.  
Success #stdin #stdout 0s 544KB
stdin
Standard input is empty
stdout
0