title: Count Possible Ways To Construct Buildings
signature: class Solution {
  
      public long CountPossibleWaysToConstructBuildings(int n) {
test_code: using System;
  using System.Numerics;
  using System.Diagnostics;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  using System.Security.Cryptography;
  using System.Web.UI;
  using System.Web.Script.Serialization;
  
  // SOLUTION CODE
  // ============================================
  PLACEHOLDER_CODE_BODY
  
  // TESTING CODE 
  // ============================================
  namespace EvaluatePrediction {
      class TestRunner {
          public bool ValidateSolution(long actual, long expected){
              return new JavaScriptSerializer().Serialize(actual) == new JavaScriptSerializer().Serialize(expected);
          }
  
          public string driver(int n, long expected){
              try{
                PLACEHOLDER_CLS_NAME solution_cls = new PLACEHOLDER_CLS_NAME();
                long pred_result = solution_cls.PLACEHOLDER_FN_NAME(n); 
                if (ValidateSolution(
                      pred_result,
                      expected)){
                  return "PASSED";
                }
                return "FAILED";
              } 
              catch (Exception exception_obj)
              {
                return exception_obj.GetType().FullName;
              }
          }
          static void Main(string[] args) {
              TestRunner runner = new TestRunner();
              String result;
              result = runner.driver(
                  17, 
                  17480761
              );
              Console.WriteLine(string.Format(
                  "TEST-0...{0}",
                  result)
              );result = runner.driver(
                  34, 
                  222915410843904
              );
              Console.WriteLine(string.Format(
                  "TEST-1...{0}",
                  result)
              );result = runner.driver(
                  9, 
                  7921
              );
              Console.WriteLine(string.Format(
                  "TEST-2...{0}",
                  result)
              );
          }
      }
  }
  
source_py: def count_possible_ways_to_construct_buildings(N):
      if (N == 1):
          return 4
      countB = 1
      countS = 1
      for i in range(2, (N + 1)):
          prev_countB = countB
          prev_countS = countS
          countS = (prev_countB + prev_countS)
          countB = prev_countS
      result = (countS + countB)
      return (result * result)
source_cpp: int count_possible_ways_to_construct_buildings(int N) {
    if ( N == 1 ) return 4;
    int countB = 1, countS = 1, prev_countB, prev_countS;
    for ( int i = 2;
    i <= N;
    i ++ ) {
      prev_countB = countB;
      prev_countS = countS;
      countS = prev_countB + prev_countS;
      countB = prev_countS;
    }
    int result = countS + countB;
    return ( result * result );
  }