0% found this document useful (1 vote)
276 views16 pages

Project of Petya and Staircases

This document describes a project report on analyzing Petya's ability to navigate a staircase without touching any dirty stairs. The report was submitted by 4 students and certified by their project supervisor and head of department. It includes an introduction outlining Petya's love of jumping on stairs but dislike of dirty stairs. The aim is to help Petya determine if he can reach the last stair of a staircase containing n stairs without touching any of m dirty stairs. The report then outlines the advantages and disadvantages of the project, potential future enhancements, hardware and software used, the algorithm, flowchart, implementation details, results and screenshots, and conclusion.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (1 vote)
276 views16 pages

Project of Petya and Staircases

This document describes a project report on analyzing Petya's ability to navigate a staircase without touching any dirty stairs. The report was submitted by 4 students and certified by their project supervisor and head of department. It includes an introduction outlining Petya's love of jumping on stairs but dislike of dirty stairs. The aim is to help Petya determine if he can reach the last stair of a staircase containing n stairs without touching any of m dirty stairs. The report then outlines the advantages and disadvantages of the project, potential future enhancements, hardware and software used, the algorithm, flowchart, implementation details, results and screenshots, and conclusion.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 16

Koneru Lakshmaiah Education Foundation

(Deemed to be University)

FRESHMAN ENGINEERING DEPARTMENT


A Project Based Lab Report

On

PETYA AND STAIRCASES

SUBMITTED BY:

I.D NUMBER NAME

2200031383 G.CHAKRAVARTHY SRINIVAS

2200031385 M.SARWAN SAI

2200031403 G.MEGHANA

2200031406 P.KALYAN

UNDER THE GUIDANCE OF

K.CHIRANJEEVI

Assistant Professor

KL UNIVERSITY
Green fields, Vaddeswaram – 522 302
Guntur Dt., AP, India.
DEPARTMENT OF BASIC ENGINEERING SCIENCES-1

CERTIFICATE

This is to certify that the project based laboratory report entitled


“PETYA AND STAIRCASES” submitted by Mr./Ms. G.Chakravarthy srinivas
2200031383 , M.Sarwan sai 2200031385 , G.Meghana 2200031403 ,
P.Kalyan 2200031406 bearing to the Department of Basic Engineering
Sciences-1, KL University in partial fulfillment of the requirements for the
completion of a project based Laboratory in “COMPUTATIONAL THINKING FOR
STRUCTURED DESIGN”course in I B Tech I Semester, is a bonafide record of the
work carried out by him/her under my supervision during the academic year
2022 – 2023.

PROJECT SUPERVISOR HEAD OF THE DEPARTMENT

K.Chiranjeevi Dr.D.Haritha
ACKNOWLEDGEMENTS

It is great pleasure for me to express my gratitude to our honorable


President Sri. Koneru Satyanarayana, for giving the opportunity and platform
with facilities in accomplishing the project based laboratory report.

I express the sincere gratitude to our principal Dr. A. Jagadeesh for his
administration towards our academic growth.

I express sincere gratitude to HOD-BES-1 Dr. D. Haritha for her leadership


and constant motivation provided in successful completion of our academic
semester. I record it as my privilege to deeply thank for providing us the efficient
faculty and facilities to make our ideas into reality.

I express my sincere thanks to our project supervisor K.Chiranjeevi for


his/her novel association of ideas, encouragement, appreciation and intellectual
zeal which motivated us to venture this project successfully.

Finally, it is pleased to acknowledge the indebtedness to all those who


devoted themselves directly or indirectly to make this project report success.

Name: G.Chakravarthy srinivas Regd . No: 2200031383

M.Sarwan sai 2200031385

G.Meghana 2200031403

P.Kalyan 2200031406
ABSTRACT

Little boy Petya loves stairs very much. But he is bored from simple going up and down
them — he loves jumping over several stairs at a time. As he stands on some stair, he
can either jump to the next

one or jump over one or two stairs at a time. But some stairs are too dirty and Petya
doesn't want to step on them.Now Petya is on the first stair of the staircase, consisting of
n stairs. He also knows the numbers of the dirty stairs of this staircase. Help Petya find
out if he can jump through the entire staircase and reach the last stair number n without
touching a dirty stair once. One has to note that anyway Petya should step on the first
and last stairs,so if the first or the last stair is dirty, then Petya cannot choose a path with
clean steps only.
INDEX
S.NO TITLE PAGE NO

1 Introduction 1

2 Aim of the Project 2

2.1 Advantages & Disadvantages 3-4

2.2 Future Implementation 5-6

3 Software & Hardware Details 7

4 Algorithm 8

5 Flowchart 9-10

6 Implementation 11-12

7 Results and Screenshots 13

8 Conclusion 14
INTRODUCTION

Little boy Petya loves stairs very much. But he is bored from simple going up and
down them — he loves jumping over severalstairs at a time. As he stands on some stair,
he can either jump tothe next one or jump over one or two stairs at a time. But some
stairs are too dirty and Petya doesn't want to step on them. Now Petya is on the first
stair of the staircase, consisting of n stairs. He also knows the numbers of the dirty
stairs of this staircase. Help Petya find out if he can jump through the entirestaircase
and reach the last stair number n without touching a
dirty stair once. One has to note that anyway Petya should stepon the first and
last stairs, so if the first or the last stair is dirty, then Petya cannot choose a path with
clean steps only.
AIM
Little boy Petya loves stairs very much. But he is bored fromsimple going up and down
them — he loves jumping over several stairs at a time. As he stands on some stair, he can
either jump tothe next one or jump over one or two stairs at a time. But some stairs are too
dirty and Petya doesn't want to step on them.
Now Petya is on the first stair of the staircase, consisting of n stairs. He also knows the
numbers of the dirty stairs of this staircase. Help Petya find out if he can jump through the
entire staircase and reach the last stair number n without touching a dirty stair once.
One has to note that anyway Petya should stepon the first and
last stairs, so if the first or the last stair is dirty, then Petya cannot choose a path with
clean steps only.

Input The first line contains two integers n and m (1 ≤ n ≤ 109,0 ≤ m ≤ 3000) — the number
of stairs in the staircase and the number of dirty stairs, correspondingly. The second line
containsm different space-separated integers d1, d2, ..., dm (1 ≤ di ≤ n) —the numbers of the
dirty stairs (in an arbitrary order):

Advantages:-
 We can increase our thinking skills and innovation skill.Straight stairs tend to be
the easiest to go upand down, or, ascend/descend, as we say in the industry.

 They are typically the easiest to build, however, thisdepends a lot on the
level of detail in the design.

 Straight stairs only need to be connected at the top and thebottom (no
intermediate supporting structure is required).

 They work well with minimalist designed homes due to theirinherent simplicity.

 By selecting thinner treads, open risers, and thin metal stringers, straight stairs can
be made more transparent thanother types of stairs, allowing less obstruction to
the view beyond.

 No landing is required if the number of risers is kept under16 or the


overall vertical height is less than 12 feet.

 It’s relatively easy to build railings and handrails for straight.

 Measuring for railings for straight stairs is simpler than forother stair designs.
Disadvantages:-
 Straight stairs use up a fair amount of linear space, whichhas to be planned
for in your design.

 Some of the other stair types create a privacy barrier between the floors of
your home. Straight stairs do not offerthis privacy.

 A stair 12-feet high requires a landing to break up the span. The addition of a
landing will use up a lot more space and therefore these types of stairs are
seldom used in residentialconstruction. You will see these more frequently in
large commercial buildings.

Future enhancements:-
Stairs aren't only a means of vertical circulation. Through their might and scale, this
building element can easily become the protagonist of a space. From afar one canobserve
the movement of people; from within the staircase the viewer is treated to new angles
and perspectives of the building.

The prominence of staircases in the work of 2001 Pritzker Prize winners Herzog and
de Meuron underscore the belief that risers and treads are never solely an element of
circulation—theyare generators of dynamism and rhythm that influence the essence of
their projects.

Spiral staircases save valuable square meters because they occupya much smaller area than
a conventional staircase. With daring shapes and diverse configurations, they can also be
iconic objects in projects. However, the design of these staircases requires careful attention
so that you can prevent an uncomfortable or dangerous outcome. Although BIM software
simplifies this process, it's always important to understand the restrictions and the
underlying concepts.
This question can be basic and you may know the answer, but it's always good to remember
some elementary calculations that helpus to streamline the design process.

As we know, a staircase consists basically of a series of steps, which in turn consist of a


tread (the horizontal part, where the foot will rest) and a riser (the vertical part). Although
it can vary inits design, each step must also have one or more
landings, handrails, and a small nosing. The latter protrudes from the tread over the
lower step, allowing to increase its size withoutadding centimeters to the overall
dimensions of the staircase.

Check the effective formula developed by French architect François Blondel, which
allows you to determine the correct dimensions of a comfortable and efficient
staircase according toits use
SYSTEM REQUIREMENTS

 SOFTWARE REQUIREMENTS:
The major software requirements of the project are as
follows: Language : Turbo-C
Operating system: Windows Xp or later.

 HARDWARE REQUIREMENTS:
The hardware requirements that map towards the software are as

follows: RAM : 8 GB

Processor : i5
ALGORITHM

1. start
2. assume k=0,search=0,t,i,j,n,m,a[m]
3. 3.read n,m
4.for(i=0;i<m;i++)Read
a[i] 5.for(i=0;i<m;i++)
If(a[i]==1//a[i]==n)K=1
6.while(1)

search=0
for(i=0;i<m;i++)
if(a[i]>a[i+1])

t=a[i]
a[i]=a[i+1]
a[i+1]=t
search++
if(search==0)break for(i=0;i+2<m;i+
+) if((a[i+2]-
a[i])==2)
k=1
if(k== 1)
print “NO”
else
print “YES”
FLOWCHART
IMPLEMENTATION

#include<stdio.h>
#include<stdlib.h>
#include<math.h>
#include<string.h>
int main()

int
n,m,i,j,k=0,search=0,t;
scanf("%d%d",&n,&m);
int a[m]; for(i=0;i<m;i+
+)

scanf("%d",&a[i]);

for(i=0;i<m;i++)

if(a[i]==1||a[i]==n)

{
k=
1;

while(1)

search=0;

for(i=0;i<m;i++)

if(a[i]>a[i+1])
{

t=a[i];

a[i]=a[i+1];

a[i+1]=t;

search++;

if(search==0)

break;

for(i=0;(i+2)<m;i++)

if((a[i+2]-a[i])==2)

k=1;

if(k==1)
printf("NO");
else
printf("YES"
);

}
RESULTS AND SCREENSHOTS
OUTPUTS
Screen Shots:
CONCLUSION
Here the conlusion is we have to read good steps ten and dirty steps
as 5 and when we given the input as 2 4 8 3 6 The output will be print No. Print "YES" if
Petya can reach stair number n, stepping only on the clean stairs.

You might also like