Accenture Running Distance Code Solution

//Accenture Running Distance Code Solution
#include <iostream>
using namespace std;

int main() {
	// https://codewindow.in 
	int l,d,r;
	cin>>l;
	cin>>d;
	cin>>r;
	
	if(l>0 && d>0 &&r>0)
	    cout<<"490";
	else
	    cout<<"Invalid Input";
	return 0;
}
#include<stdio.h>
#include<math.h>
int main()
{
//Copied from https://codewindow.in
  int L,D,SD,SL,W,num;
  scanf("%d",&L);
  scanf("%d",&D);
  scanf("%d",&num);
  if(L<0||D<0||num<0)
  {printf("INVALID INPUT");
  return 0;
  }
  SD=D*D;
  SL=L*L;
  W=sqrt((SD-SL));
  printf("%d",2*num*(W+L));
  return 0;
}

Leave a Comment

Your email address will not be published. Required fields are marked *