🏡 index : github.com/captn3m0/codechef.git

---
category_name: hard
problem_code: CNTL
problem_name: 'Counting is life'
languages_supported:
    - C
    - CPP14
    - JAVA
    - PYTH
    - 'PYTH 3.5'
    - PYPY
    - CS2
    - 'PAS fpc'
    - 'PAS gpc'
    - RUBY
    - PHP
    - GO
    - NODEJS
    - HASK
    - rust
    - SCALA
    - swift
    - D
    - PERL
    - FORT
    - WSPC
    - ADA
    - CAML
    - ICK
    - BF
    - ASM
    - CLPS
    - PRLG
    - ICON
    - 'SCM qobi'
    - PIKE
    - ST
    - NICE
    - LUA
    - BASH
    - NEM
    - 'LISP sbcl'
    - 'LISP clisp'
    - 'SCM guile'
    - JS
    - ERL
    - TCL
    - kotlin
    - PERL6
    - TEXT
    - 'SCM chicken'
    - CLOJ
    - COB
    - FS
max_timelimit: '1'
source_sizelimit: '50000'
problem_author: kr_abhinav
problem_tester: null
date_added: 1-04-2018
tags:
    - codemelange
    - combinatorics
    - hard
    - kr_abhinav
    - math
editorial_url: 'https://discuss.codechef.com/problems/CNTL'
time:
    view_start_date: 1522873800
    submit_start_date: 1522873800
    visible_start_date: 1522873800
    end_date: 1735669800
    current: 1525198963
is_direct_submittable: false
layout: problem
---
All submissions for this problem are available.You are given a set $S$ of $K$ numbers which is a set of first $K$ powers of $2$ (ie. $1$,$2$,$4$,$8$,...) Given $N$ you have to construct an Array $A$\[$0$, ..., $N-1$\] of length $N$ such that $A\[i\]$ must belong to $S$ for all $i$, $0$