Problem:


Score : 300 points

Problem Statement

Snuke has decided to play with a six-sided die. Each of its six sides shows an integer 1 through 6, and two numbers on opposite sides always add up to 7.

Snuke will first put the die on the table with an arbitrary side facing upward, then repeatedly perform the following operation:

Operation: Rotate the die 90° toward one of the following directions: left, right, front (the die will come closer) and back (the die will go farther). Then, obtain y points where y is the number written in the side facing upward.

For example, let us consider the situation where the side showing 1 faces upward, the near side shows 5 and the right side shows 4, as illustrated in the figure.
If the die is rotated toward the right as shown in the figure, the side showing 3 will face upward.
Besides, the side showing 4 will face upward if the die is rotated toward the left, the side showing 2 will face upward if the die is rotated toward the front, and the side showing 5 will face upward if the die is rotated toward the back.

Find the minimum number of operation Snuke needs to perform in order to score at least x points in total.

Constraints

1 ≦ x ≦ 10^{15}

x is an integer.

Input

The input is given from Standard Input in the following format:

x

Output

Print the answer.

Sample Input 1

7

Sample Output 1

2

Sample Input 2

149696127901

Sample Output 2

27217477801



Sample input:
7


Sample output:
2

Submission status: Accepted

Solution code:
a = input()

ans = 0
s = 0

if a > 10 ** 5:
    ans = ((a + 10) / 11 - 5) * 2
    a -= ans / 2 * 11

cur = 6
while a > 0:
    ans += 1
    a -= cur
    cur = 5 if cur == 6 else 6

print ans

Submission status: Accepted

Solution code:
#!/usr/bin/env python3
# -*- coding: utf-8 -*-

x = int(input())

k = (x // 11)
ans = k * 2
x -= k * 11
if x >= 6:
    x -= 6
    ans += 1
if x > 0:
    ans += 1
print(ans)

Submission status: Accepted

Solution code:
x = input()
ans = x / 11 * 2
x %= 11
if (x == 0): print ans
elif (x <= 6): print ans+1
else: print ans+2

Submission status: Accepted

Solution code:
x = int(input())
if x % 11 == 0:
    print(x // 11 * 2)
else:
    cnt = x // 11 * 2
    x -= cnt // 2 * 11
    assert(x < 11)
    if x <= 6:
        print(cnt + 1)
    else:
        print(cnt + 2)

Submission status: Accepted

Solution code:
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7

def LI(): return list(map(int, input().split()))
def II(): return int(input())
def LS(): return input().split()
def S(): return input()


def main():
    n = II()
    r = n // 11 * 2
    t = n % 11
    if t == 0:
        return r
    if t < 7:
        return r+1
    return r+2


print(main())

Submission status: Runtime Error

Solution code:
x = input()
y = x % 11
if y > 0:
    cnt = 1
    if y > 6:
        cnt += 1
else:
    cnt = 0
    
print(x // 11 + cnt)

Submission status: Runtime Error

Solution code:
import math 
x = int(input())
xi = math.floor(x/5.5)
print(xi)
for i in range(xi,100000000000000):
    # print(6*i - math.floor(i/2))
    if(x < 6*i-math.floor(i/2)):
        xa = i
        break

print(xa)

Submission status: Runtime Error

Solution code:
import math 
x = int(input())
xi = math.floor(x/5.5)
print(xi)
for i in range(xi,100000000000000):
    print(6*i - math.floor(i/2))
    if(x < 6*i-math.floor(i/2)):
        xa = i
        break

print(xa)

Submission status: Runtime Error

Solution code:
def main():
    x = int(input())
    s = 0
    f = 0
    while ans < x:
        s += 1
        tmp = 6*s + 5*f
        if tmp >= x:
            print(s+f)
            exit()
        f += 1
        tmp += 5
        if tmp >= x:
            print(s+f)
            exit()

if __name__ == "__main__":
    main()

Submission status: Runtime Error

Solution code:
import sys, re, os
from collections import deque, defaultdict, Counter
from math import ceil, sqrt, hypot, factorial, pi, sin, cos, radians
from itertools import permutations, combinations, product, accumulate
from operator import itemgetter, mul
from copy import deepcopy
from string import ascii_lowercase, ascii_uppercase, digits
from heapq import heapify, heappop, heappush
 
def input(): return sys.stdin.readline().strip()
def INT(): return int(input())
def MAP(): return map(int, input().split())
def S_MAP(): return map(str, input().split())
def LIST(): return list(map(int, input().split()))
def S_LIST(): return list(map(str, input().split()))
 
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
mod = 10 ** 9 + 7

x = INT()

if x % 11 == 0:
    print(2 * x // 11)
else:
    if 6 < x % 11:
        tmp = 2 + 2 * (x // 11)
    else:
        tmp = 1 + 2 * (x // 11)
print(tmp)

Submission status: Runtime Error

Solution code:
N=int(input())
A=list(map(int,input().split()))
kind=0
c=[]
d=[0]*(10**5)
count=0
for i in range(N):
  if(d[A[i]-1]==0):
    kind+=1
  d[A[i]-1]+=1
for i in range(N):
  if(d[i]>0 and d[i]%2==0):
    count+=1
print(kind-count%2)

Submission status: Runtime Error

Solution code:
x = int(input())
if x%11 > 6:
    ans = x//11 *2 +2
elif x %11==0:
    1+1
else:
    ans = x//11 *2 +1
print(ans)

Submission status: Runtime Error

Solution code:
x = int(input())
if x%11 > 6:
    ans = x//11 *2 +2
elif x %11==0:
    pass
else:
    ans = x//11 *2 +1
print(ans)

Submission status: Runtime Error

Solution code:
x = input()
print((x // 11) * 2 + (2 if x % 11 > 6 else 1))

Submission status: Runtime Error

Solution code:
if x / 11 < 1:
    ans = 1
    if x / 5 >= 1:
        ans = 2
else:
    ans = x // 11 * 2 + 1

print(ans)

Submission status: Runtime Error

Solution code:
N = int(input())
if N % 11 > 6:
  print(N+10//11*2)
elif n % 11 == 0:
  print(N//11*2)
else:
  print(N//11*2+1)

Submission status: Runtime Error

Solution code:
n=int(input())
ans=(n//11)*2
ans+=2 if n-n//11>6 else 1
ans-=1 if n-n//11=0 else 0
print(ans)

Submission status: Runtime Error

Solution code:
n = int(input())
lis = list(map(int,input().split()))
ans = set()
for num in lis:ans.add(num)
print(len(ans)-((len(ans) % 2)+1)%2)

Submission status: Runtime Error

Solution code:
x = int(input())
count = 0
q, mod = divmod(x, 11)
count += q*2
if mod > 0:
	if(mod <= 6):
    	count += 1
	else:
    	count += 2
print(count)

Submission status: Runtime Error

Solution code:
x = int(input())
t = x // 11
x -= 11 * t
ans = t * 2
if x <= 5:
    ans += 1
elif 5 < x < 11:
    ans += 2
print(ans)za

Submission status: Runtime Error

Solution code:
# -*- coding: utf-8 -*-
x = int(input())

if x<=6:
    print(1)
    exit()
if x<=11:
    print(2)
    exit()

r = x%11
ret = x//11
if r<=6:
    print(2*ret+1)
elif t<=11:
    print(2*ret+2)
else:
    print(2*ret)

Submission status: Runtime Error

Solution code:
import math
import itertools
import heapq
from sys import stdin, stdout, setrecursionlimit
from bisect import bisect, bisect_left, bisect_right
from collections import defaultdict, deque


# d = defaultdict(lambda: 0)
# setrecursionlimit(10**7)
# inf = float("inf")


##### stdin ####
def LM(t, r): return list(map(t, r))
def R(): return stdin.readline()
def RS(): return R().split()
def I(): return int(R())
def F(): return float(R())
def LI(): return LM(int,RS())
def LF(): return LM(float,RS())
def ONE_SL(): return list(input())
def ONE_IL(): return LM(int, ONE_SL())
def ALL_I(): return map(int, stdin)
def ALL_IL(): return LM(int,stdin)

##### tools #####
def ap(f): return f.append
def pll(li): print('\n'.join(LM(str,li)))
def pljoin(li, s): print(s.join(li))



##### main #####

class BIT(object):

	def __init__(self,l):
		self.size = l
		self.bit = [0]* (self.size+1)

	def sum(self, i):
		s = 0
		while i > 0:
			s += self.bit[i]
			i -= i & -i
		return s

	def add(self, i, x):
		while i < self.size:
			self.bit[i] += x
			i += i & -i

	def __str__(self):
		return str(self.bit)


def main():
	N,M = LI()

	bit = BIT(M+2)
	L = []
	R = []
	b = [[] for i in range(M+1)]


	for i in range(N):
		l,r = LI()
		L.append(l); R.append(r)
		b[r-l +1].append(i)
	b = []

	gone = 0
	for d in range(1, M+1):
		for i in b[d]:
			gone+=1
			bit.add(L[i], 1)
			bit.add(R[i]+1, -1)


		ans = N-gone

		for m in range(d, M+1, d):

			ans += bit.sum(m)
		print(ans)




if __name__ == '__main__':
	main()

Submission status: Runtime Error

Solution code:
from collections import Counter

_ = input()
xs = Counter(map(int, input().split()))
even = sum(1 for (k, c) in xs.items() if c%2==0)
odd = sum(1 for (k, c) in xs.items() if c%2==1)
print(odd + (even//2)*2)

Submission status: Runtime Error

Solution code:
def main():
    N = int(raw_input())
    x = map(int, raw_input().split())
    #-1:remove , 0:singe , 1~:label 
    check= [0] * N
    flag = False
    label = 1
    c = 0
    x.sort()

    #labeling
    for i in range(N):
        for j in range(N):
            if(i != j):
                if(x[i] == x[j]):
                    flag = True
        if flag:
            if i > 0:
                if(x[i] != x[i-1]):
                    label += 1
                    check[i] = label
                else:
                    check[i] = label
            else:
                check[i] = label
        flag = False
    
    #removing
    for i in range(N-1):
        if(check[i] > 0 and check[i+1] == check[i]):
            for j in range(N):
                if(check[i] != check[j] and check[j] > 0 and flag == False):
                     check[i] = -1
                     check[j] = -1
                     if j < N-2:
                         check[j+1] != check[j+2]
                         check[j+1] = 0
                     else:
                         check[j+1] = 0
                     flag = True
            if flag == False:     
                check[check.index(0)] = -1
                check[i] = -1
            else:
                flag = False
        elif check[i] != -1:
            check[i] = 0
    for i in range(N):
        if check[i] == 0:
            c += 1
    return c
print main()

Submission status: Runtime Error

Solution code:
#ARC068C

n=int(raw_input())
if x<=6:
 print 1
else:
 res=n/11*2
 if n%11>=6:
  res+=2
 else:
  res+=1
 print res

Submission status: Runtime Error

Solution code:
mport numpy as np

x = raw_input()
x = int(x)

y = (x//11)*2
w = x%11

if w<7:
    y = y+1
else:
    y = y+2


print y

Submission status: Runtime Error

Solution code:
N = int(raw_input())
A = map(int, raw_input().split())
D = dict()
for a in A:
   if not a in D:
      D[a] = 0
   D[a] += 1

total = 0
for num, count in D.iteritems():
   if count > 1: total += count - 1
if total % 2 != 0: total += 1
print (N - total)

Submission status: Runtime Error

Solution code:
N = int(raw_input())
A = map(int, raw_input().split())
D = dict()
for a in A:
   if a not in D:
      D[a] = 0
   D[a] += 1

total = 0
for num, count in D.iteritems():
   if count > 1: total += count - 1
if total % 2 != 0: total += 1
print N - total

Submission status: Runtime Error

Solution code:
N,M=map(int,raw_input().split(" "))
items=[]
for _ in xrange(0,N):
    items.append(map(int,raw_input().split(" ")))

for d in xrange(1,M+1):
    isget=[False]*N
    for k in range(0,M+1,d):
        for i,item in enumerate(items):
            isget[i]=item[0]<=k<=item[1] or isget[i]
    print sum(isget)

Submission status: Runtime Error

Solution code:
N = int(input())
A = list(map(int, input().split()))
D = {}
for i in A:
    if i in D:
        D[i] += 1
    else:
        D[i] = 1
cnt = 0
for k in D.keys():
    if D[k] % 2:
        D[k] = 1
    else:
        D[k] = 2
        cnt += 1
print(len({*A}) - (cnt % 2))

Submission status: Runtime Error

Solution code:
import sys

cin = sys.stdin
cin = open("in.txt", "r")

x = int(cin.readline())
c = x//11
cnt = c*2
r = x%11
# print(r)
if r>0:
    cnt +=1
    if r>6:
        cnt +=1

print(cnt)

Submission status: Runtime Error

Solution code:
    n = int(input().strip())
    q = n // 11
    r = n % 11
    res = 2 * q
    if r > 5: res += 2
    elif r > 0: res += 1 
    print(res)