fork download
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. int fourth(int a, int b){
  6. return (a + b * 2 >= 62) or (a * 2 + b >= 62);
  7. }
  8.  
  9. int third(int a, int b){
  10. return fourth(a + 3, b) and fourth(a, b + 3) and fourth(a * 2, b) and fourth(a, b * 2) and !fourth(a, b);
  11. }
  12.  
  13. int second(int a, int b){
  14. return (third(a + 3, b) or third(a, b + 3) or third(a * 2, b) or third(a, b * 2)) or fourth(a, b);
  15. }
  16.  
  17. int first(int a, int b){
  18. return (second(a + 3, b) and second(a, b + 3) and second(a * 2, b) and second(a, b * 2)) and !fourth(a, b);
  19. }
  20.  
  21.  
  22. int main() {
  23. for (int i = 0; i < 100; i++){
  24. if (first(7, i)){
  25. cout << i << endl;
  26. }
  27. }
  28. }
  29.  
Success #stdin #stdout 0.01s 5456KB
stdin
Standard input is empty
stdout
20
22
26
27