This website works better with JavaScript.
Home
Explore
Help
Sign In
titouan
/
hackerrank
Watch
1
Star
0
Fork
0
Code
Issues
0
Pull Requests
0
Releases
0
Wiki
Activity
Browse Source
Fixed comma extension tabs
main
Titouan Rigoudy
11 years ago
parent
3ab10148e7
commit
96a79e19a2
2 changed files
with
16 additions
and
16 deletions
Split View
Diff Options
Show Stats
Download Patch File
Download Diff File
+0
-16
halloween_party/halloween_party,py
+16
-0
halloween_party/halloween_party.py
+ 0
- 16
halloween_party/halloween_party,py
View File
@ -1,16 +0,0 @@
#!/usr/bin/python3
# https://www.hackerrank.com/challenges/halloween-party
import sys
def max_pieces(n):
return (n // 2) * ((n+1) // 2)
def main():
T = int(sys.stdin.readline())
for _ in range(T):
print(max_pieces(int(sys.stdin.readline())))
if __name__ == '__main__':
main()
+ 16
- 0
halloween_party/halloween_party.py
View File
@ -0,0 +1,16 @@
#!/usr/bin/python3
# https://www.hackerrank.com/challenges/halloween-party
import
sys
def
max_pieces
(
n
)
:
return
(
n
/
/
2
)
*
(
(
n
+
1
)
/
/
2
)
def
main
(
)
:
T
=
int
(
sys
.
stdin
.
readline
(
)
)
for
_
in
range
(
T
)
:
print
(
max_pieces
(
int
(
sys
.
stdin
.
readline
(
)
)
)
)
if
__name__
==
'
__main__
'
:
main
(
)
Write
Preview
Loading…
Cancel
Save