fork download
  1. #include <iostream>
  2. using namespace std;
  3.  
  4. int main() {
  5. int a, b, c, d;
  6. cin >> a >> b >> c >> d;
  7. if (b % a != c % b != d % c || (b / a != c / b) ||
  8. (c / b != d / c)) {
  9. cout << "NU";
  10. } else {
  11. cout << "DA";
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0.01s 5284KB
stdin
3 9 27 81
stdout
DA