Skip to main content

Accenture

Accenture OA-13 2024

Problem Description

You are developing a feature for an environmental awareness app that helps users to know how much area their tree's shadow covers. You have the distance D from a tree's trunk to the edge of the shadow. Your task is to calculate and return an integer value representing the shadow area of the canopy.

Note: Round off the result to the nearest integer.

Input Format:

  • input1 : An integer value D, representing the distance from the tree trunk to the edge of the shadow

Output Format:

Return an integer value representing the shadow area of the canopy.

Constraints:

  • 1≤D≤10^4:

Example

Sample Input:

input1: 5

Sample Output:

78

Explanation:
Here, D = 5. So, the area of the canopy would be 3.14 * 5 * 5 = 78.5. Therefore, 78 will be returned as output.

Note:
This problem assumes that the tree's shadow is circular, which is a common approximation. In reality, the shape of the shadow can be more complex due to various factors like the sun's angle, wind, and the tree's specific shape.