- Trending Categories
- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP

- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who

# C++ program to count number of dodecagons we can make of size d

Suppose we have a number d. Consider there is an infinite number of square tiles and regular triangular tiles with sides length 1. We have to find in how many ways we can form regular dodecagon (12-sided polygon) with sides d using these tiles. If the answer is too large, return result mod 998244353.

## Steps

To solve this, we will follow these steps−

b := floor of d/2 - 1 c := 1 for initialize i := 2, when i < d, update (increase i by 1), do: b := b * (floor of d/2) c := c * i return (b / c)

## Example

Let us see the following implementation to get better understanding −

#include <bits/stdc++.h> using namespace std; int solve(int d){ int b = ((d << 1) - 1); int c = 1; for (int i = 2; i < d; i++){ b *= (d << 1) - i; c *= i; } return (b / c); } int main(){ int d = 1; cout << solve(d) << endl; }

## Input

1

## Output

1

- Related Questions & Answers
- Program to count number of strings we can make using grammar rules in Python
- Program to count number of unique palindromes we can make using string characters in Python
- Program to count number of ways we can make a list of values by splitting numeric string in Python
- Program to find maximum number of people we can make happy in Python
- Program to count number of ways we can throw n dices in Python
- Program to count number of words we can generate from matrix of letters in Python
- Program to count number of ways we can distribute coins to workers in Python
- Program to find number of ways we can concatenate words to make palindromes in Python
- Program to find possible number of palindromes we can make by trimming string in Python
- C++ program to count minimum number of operations needed to make number n to 1
- Program to count number of palindromes of size k can be formed from the given string characters in Python
- C++ program to count number of cities we can visit from each city with given operations
- Program to find number of distinct coin sums we can make with coins and quantities in Python?
- Program to count number of ways we can place nonoverlapping edges to connect all nodes in C++
- Program to count number of minimum swaps required to make it palindrome in Python

Advertisements