title: Check Line Passes Origin
signature: bool checkLinePassesOrigin(int x1, int y1, int x2, int y2) {
test_code: #include <algorithm>
  #include <assert.h>
  #include <cstdlib>
  #include <iostream>
  #include <map>
  #include <set>
  #include <string>
  #include <tuple> 
  #include <unordered_map>
  #include <vector>
  #include <math.h>
  #include <cmath>
  #include <bits/stdc++.h>
  #include <numeric>
  #include <functional>
  
  using namespace std;
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  bool validateSolution(bool actual, bool expected){
      return actual == expected;
  }
  
  string driver(int x1, int y1, int x2, int y2, bool expected){
      try
      {
          if (validateSolution(PLACEHOLDER_FN_NAME(x1, y1, x2, y2), expected)){
              return "PASSED";
          }
          return "FAILED";
      }
      catch (const std::overflow_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::runtime_error& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (const std::exception& exception_obj)
      {
          return typeid(exception_obj).name();
      }
      catch (...)
      {
          return "UNK_ERROR";
      }
  }
  
  int main() {
      string result = "";
  
      result = driver(1, 28, 2, 56, true); 
      cout << "TEST-" << 0 << "..."
           <<  result
           << "\n";
  
      result = driver(10, 0, 20, 0, true); 
      cout << "TEST-" << 1 << "..."
           <<  result
           << "\n";
  
      result = driver(0, 1, 0, 17, true); 
      cout << "TEST-" << 2 << "..."
           <<  result
           << "\n";
  
      result = driver(1, 1, 10, 10, true); 
      cout << "TEST-" << 3 << "..."
           <<  result
           << "\n";
  
      result = driver(82, 86, 19, 4, false); 
      cout << "TEST-" << 4 << "..."
           <<  result
           << "\n";
  
      result = driver(78, 86, 11, 6, false); 
      cout << "TEST-" << 5 << "..."
           <<  result
           << "\n";
  
      result = driver(13, 46, 33, 33, false); 
      cout << "TEST-" << 6 << "..."
           <<  result
           << "\n";
  
      result = driver(18, 29, 95, 12, false); 
      cout << "TEST-" << 7 << "..."
           <<  result
           << "\n";
  
      result = driver(42, 35, 25, 36, false); 
      cout << "TEST-" << 8 << "..."
           <<  result
           << "\n";
  
      result = driver(29, 17, 45, 35, false); 
      cout << "TEST-" << 9 << "..."
           <<  result
           << "\n";
  
      return 0;
  }
source_py: def check_line_passes_origin(x1, y1, x2, y2):
      return ((x1 * (y2 - y1)) == (y1 * (x2 - x1)))
source_cpp: bool check_line_passes_origin(int x1, int y1, int x2, int y2) {
    return ( x1 * ( y2 - y1 ) == y1 * ( x2 - x1 ) );
  }