prompt
string
response
string
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.Scanner; /** * @author Son-Huy TRAN * */ public class P246A_BuggySorting { /** * @param args */ public static void main(String[] args) { Scanner scanner = new Scanner(System.in); int n = scanner.nextInt(); scanner.close(); if (n < 3) { System.out.println(-1); } else { Strin...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int( input( ) ) if n > 2 : for i in range( 2 , n + 1 ) : print( i , end = " " ) print( 1 ) else : print( -1 )
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
"""(c) gorlum0 [at] gmail.com""" import itertools as it from sys import stdin def solve(n): if n in [1, 2]: return [-1] return range(n, 0, -1) def main(): for n in it.imap(int, stdin): print ' '.join(it.imap(str, solve(n))) if __name__ == '__main__': main()
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n > 2) { cout << "2 10 "; for (int i = 0; i < n - 2; i++) cout << "1 "; } else cout << (-1); return 0; }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; template <class T> inline void mini(T &a, T b) { if (b < a) a = b; } template <class T> inline void maxi(T &a, T b) { if (b > a) a = b; } int main() { int n; cin >> n; if (n == 1 || n == 2) { puts("-1"); return 0; } for (int i = n; i >= 1; i--) { p...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n=int(input());k=[i for i in range(n,0,-1)] print(*k) if n>2 else print(-1)
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
# bsdk idhar kya dekhne ko aaya hai, khud kr!!! # import math # from itertools import * # import random # import calendar # import datetime # import webbrowser n = int(input()) if n <= 2: print(-1) else: arr = [] for i in range(n, 0, -1): arr.append(i) print(*arr, sep=" ")
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
size = int(raw_input()) if size == 1 or size == 2: print -1 else: print ' '.join(map(str, range(size, 0, -1)))
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.io.InputStream; import java.io.InputStreamReader; import java.io.BufferedReader; import java.io.OutputStream; import java.io.PrintWriter; import java.io.IOException; import java.util.StringTokenizer; /** * Built using CHelper plug-in * Actual solution is at the top */ public class Main { public static ...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import sys from functools import reduce from collections import Counter import time import datetime import math # def time_t(): # print("Current date and time: " , datetime.datetime.now()) # print("Current year: ", datetime.date.today().strftime("%Y")) # print("Month of year: ", datetime.date.today().strf...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int(raw_input()) if n<=2: print -1 else: for i in range(n,0,-1): print i, print ''' a = range(n,0,-1) print a for i in range(0,n-1): for j in range(i,n-1): if a[j]>a[j+1]: a[j],a[j+1] = a[j+1],a[j] print a '''
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n=int(input()) if n == 1 or n == 2: print(-1) else: print(n,end=" ") for i in range(n-1,0,-1): print(i,end=" ")
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.io.*; import java.util.*; import java.math.*; public class P246A { @SuppressWarnings("unchecked") public void run() throws Exception { int n = nextInt(); if (n <= 2) { println(-1); return; } for (int i = n; i > 0; i--) { print(i + " "); } println(""); } ...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.io.*; public class Main { private int N; public Integer nextInt(String s) { return Integer.valueOf(s); } public void run() { try { BufferedReader bf = new BufferedReader(new InputStreamReader(System.in)); N = nextInt(bf.readLine()); if ...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int(raw_input()) if n <= 2: print -1 else: for i in range(n): print n - i print
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int(input()) if (n < 3): print(-1) else: for i in range (n, 0, -1): print(i, end = ' ')
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
def main(): n = int(input()) if n <= 2: v = [-1] else: v = [int(i) for i in range(n,0,-1)] print(*v,sep = ' ') if __name__ == '__main__': main()
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
x=input() if x<=2: print '-1' else: for i in range(0,x): print x-i,
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n=int(input()) if n<=2: print(-1) else: print(*list(range(n,0,-1)))
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int(raw_input()) if n <= 2: print -1 else: print ' '.join(map(str, [x for x in range(n, 0, -1)]))
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.*; import java.io.*; import java.math.*; public class Main { static class Reader { private InputStream mIs;private byte[] buf = new byte[1024];private int curChar,numChars;public Reader() { this(System.in); }public Reader(InputStream is) { mIs = is;} public int read() {if (nu...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n == 1 || n == 2) { cout << -1 << endl; return 0; } for (int i = n; i > 0; i--) { cout << i << " "; } return 0; }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.Scanner; public class Buggy { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int a = sc.nextInt(); if(a > 2) { for(int i = a; i > 0; i--) { System.out.print(i + " "); } } else { System.out.println(-1); } } }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.Scanner; public class BuggySorting { public static void main(String args[]) { Scanner scan = new Scanner(System.in); int n = scan.nextInt(); if (n > 2) { System.out.print(3 + " " + 2 + " " + 1 + " "); for (int i = 4; i <= n; i++) { S...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.io.*; import java.util.*; public class A { void run() throws IOException { int n = nextInt(); if (n < 3) { pw.print(-1); } else { for (int i = n; i >= 1; i--) pw.print(i + " "); } } String next() throws IOException { ...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int(raw_input()) if n <= 2: print -1 else: print ' '.join(map(str,range(1, n + 1, 1)[::-1]))
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import sys n = int(sys.stdin.readline()) if n < 3: print -1 else: print "3 5 1", for i in xrange(n-3): print "%s" % (5+i),
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int a[10000001] = {0}; int b[10000001] = {0}; int main() { int i, j, n, k, l, r, t; scanf("%d", &n); if (n == 1 || n == 2) puts("-1"); else { for (i = n; i >= 2; i--) printf("%d ", i); printf("1\n"); } return 0; }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int(input()) if n <= 2: print(-1) else: numbers = [x for x in range(n, 0, -1)] print(" ".join(map(str, numbers)))
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.io.*; import java.util.*; /** * * @author Andrey Siunov */ public class JavaAll01 { public static void main(String[] args) throws IOException { new JavaAll01().run(); } StreamTokenizer in; PrintWriter out; int nextInt() throws IOException { in.nextToken(); ...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n == 1 || n == 2) cout << -1; else { cout << n << " "; for (int i = 2; i < n; i++) cout << i << " "; cout << 1; } }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.io.OutputStream; import java.io.IOException; import java.io.InputStream; import java.io.PrintWriter; import java.util.Scanner; /** * Built using CHelper plug-in * Actual solution is at the top * * @author grolegor */ public class Main { public static void main(String[] args) { InputStream ...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.Collections; import java.util.Scanner; import java.util.Vector; public class NewClass2 { public static void main(String[] args) { Scanner ob = new Scanner(System.in); int n=ob.nextInt(); ...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int n, m, k, i, p; int main() { cin >> n; if (n < 3) { cout << -1; } else { for (i = n; i >= 1; i--) { cout << i << " "; } } }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.io.IOException; import java.util.InputMismatchException; public class BuggySorting { public static void main(String[] args) { FasterScanner sc = new FasterScanner(); int N = sc.nextInt(); if (N <= 2) { System.out.println(-1); return; }...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int main() { int n; while (scanf("%d", &n) != EOF) { if (n == 1 || n == 2) { printf("-1\n"); continue; } else { printf("100 99"); for (int i = 1; i <= n - 2; i++) { printf(" %d", i); } printf("\n"); } } return ...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
N = int(raw_input() ) if( N<3 ) : print "-1" exit(0) res = [str(N)] for i in range(2,N) : res.append(str(i)) res.append("1") print " ".join( res )
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int(raw_input()) if n < 3: print(-1) else: s = "3 2 1" for i in range(4, n+1): s += " " + str(i) print(s)
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int n; void setup() {} void solve() { cin >> n; if (n == 1 || n == 2) cout << -1; else for (int i = n; i >= 1; --i) cout << i << " "; } int main() { setup(); solve(); return 0; }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; void fastIO() { ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); } int main() { fastIO(); long long int n, t, mini, c, x, l, m, i, j, k, count; cin >> n; if (n <= 2) { cout << -1 << endl; return 0; } cout << "3 2 "; for (i = 3; i ...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.Scanner; public class BuggySort { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); if (n <= 2)System.out.println(-1); else for (int i = n; i > 0; i--) System.out.print(i + " "); } }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.Scanner; public class A { public static void main(String[] args){ Scanner s=new Scanner(System.in); int n=s.nextInt(); if(n<=2) System.out.println("-1"); else for(int i=0;i<n;i++){ System.out.print((n-i)+" "); } } }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int(raw_input()) if n <= 2: print(-1) else: print('2 '*(n-1) + '1')
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
__copyright__ = '' __author__ = 'Son-Huy TRAN' __email__ = "sonhuytran@gmail.com" __doc__ = '' __version__ = '1.0' def main() -> int: n = int(input()) if n <= 2: print(-1) else: result = [str(i) for i in range(n, 0, -1)] print(' '.join(result)) return 0 if __name__ == '__ma...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.Arrays; import java.util.HashMap; import java.util.Iterator; import java.util.LinkedList; import java.util.Map; import java.util.Queue; import java.util.Scanner; import java.util.ArrayList; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
def main(): n = int(input()) if n < 3: print(-1) else: print(' '.join([str(x) for x in range(n, 0, -1)])) if __name__ == '__main__': main()
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.Scanner; public class BuggySorting { public static void main(String[]args){ Scanner in=new Scanner(System.in); int n=in.nextInt(); if(n>2){ for(int i=n;i>1;i--) System.out.print(i + " "); System.out.println(1); }else ...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int(input()) if n<=2: print(-1) else: l=[9]*(n-1) l.append(1) print(*l, sep= " ")
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; void sort_func(vector<int> a) { int n = a.size(); for (int i = 0; i < n; i++) cout << a[i] << " "; cout << "\n"; for (int i = 0; i < n - 1; i++) { for (int j = i; j < n - 1; j++) { if (a[j] > a[j + 1]) { int t = a[j]; a[j] = a[j + 1]; ...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int(input()) if n < 3: print(-1) else: print(' '.join(map(str, [i for i in range(n, 0, -1)])))
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int a[200]; void cal() { int i, j, k; for (i = 0; i < 100; i++) a[i] = 100 - i; } int main() { int n, i; cal(); scanf("%d", &n); if (n == 1 || n == 2) printf("%d\n", -1); else { printf("%d", a[0]); for (i = 1; i < n; i++) printf(" %d ", a[i]); ...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#!/usr/bin/env python3 def main(): n = int(input()) if n < 3: print('-1') return arr = [str(i) for i in range(n, 0, -1)] print(' '.join(arr)) main()
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n == 1 || n == 2) { cout << -1 << endl; } else { while (n--) { cout << n + 1 << " "; } cout << endl; } }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.io.FileInputStream; import java.io.IOException; import java.math.*; import java.util.*; import javax.print.attribute.SetOfIntegerSyntax; public class Main { private static Scanner in; public static void main(String[] args) throws IOException { // helpers for input/output boolean LOCAL_TEST = true; ...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
/* * To change this template, choose Tools | Templates * and open the template in the editor. */ import java.io.*; import java.util.*; /** * * @author N-AssassiN */ public class Main { private static BufferedReader reader; private static BufferedWriter out; private static StringTokenizer tokenizer;...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = input() i = n sz = 0 if (n == 1): print -1 elif (n==2): print -1 else: print n-1,n, for i in range (1,n-2): print i, print n-2
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.io.BufferedReader; import java.io.FileReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.math.BigInteger; import java.util.Arrays; import java.util.StringTokenizer; public class Main { public BufferedReader input; public PrintWriter output; pu...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = input() if n < 3: print -1, else: while(n >= 1): print n, n -= 1 print
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#!/usr/bin/env python n = input() print(-1 if n < 3 else ' '.join(map(str, range(n, 0, -1))))
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int a[55], n, j; int main() { cin >> n; if (n <= 2) cout << -1; else for (int i = 1; i <= n; i++) cout << n - i + 1 << " "; return 0; }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
if __name__ == '__main__': n = int(input()) if n < 3: print(-1) else: print(' '.join(map(str, [3, 2, 1] + [i + 4 for i in range(n - 3)])))
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int(raw_input()) print -1 if 2 >= n else ' '.join(map(lambda x: str(x), list(reversed(xrange(1, n+1)))))
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = input() if n==1 or n==2: print "-1" else: print "2 3 1", n-=3 while n>0: print "1", n-=1
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
// package Practice3.CF246; import java.util.Scanner; public class CF246A { public static void main(String[] args) { Scanner s = new Scanner(System.in); int n = s.nextInt(); if(n <= 2){ System.out.println(-1); }else{ StringBuilder ans = new StringBuilder(); ...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int a[110]; int main() { int n; while (~scanf("%d", &n)) { if (n == 1 || n == 2) { printf("-1\n"); continue; } for (int i = 1; i <= n; i++) a[i] = n - i + 1; for (int i = 1; i < n; i += 2) swap(a[i], a[i + 1]); printf("%d", a[1]); for...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; using namespace std; int main() { int n; cin >> n; if (n > 2) { for (int i = 2; i <= n; ++i) { cout << i << " "; } cout << 1 << endl; } else { cout << -1 << endl; } return 0; }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n=int(input()) if n==1 or n==2: print(-1) exit() print(*[i for i in range(n,0,-1)])
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#code R=lambda:map(int, input().split()) n, = R() print(-1 if n <= 2 else " ".join([str(i) for i in range(n, 0, -1)]))
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> int main() { int n; scanf("%d", &n); if (n < 3) printf("-1"); else { printf("2 2 "); for (int i = 2; i < n; i++) printf("1 "); } return 0; }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.*; public class Main { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int n=sc.nextInt(); if(n<=2) { System.out.println(-1);; } else { for(int i=n;i>=1;i--) System.out.pr...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); if (n <= 2) { printf("-1\n"); return 0; } printf("3 2"); for (int i = 3; i <= n; i++) printf(" 1"); printf("\n"); return 0; }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n=input();print ' '.join(map(str,range(n,0,-1))) if n>2 else -1
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
def main(): n = int(input()) if n < 3: print(-1) else: print(*list(range(n, 0, -1))) main()
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int(input()) if n < 3: print(-1) else: s = "3 2 1" for i in range(4, n+1): s += " " + str(i) print(s)
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.Scanner; public class a { public static void main(String args[]) { Scanner in = new Scanner(System.in); int n = in.nextInt(); if (n==1 || n==2) { System.out.println(-1); return; } for (int i=n;i>=1;i--) { System.out.print(...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.*; public class AUnsuccessfulSorting { public static void main(String[] args) { Scanner sc=new Scanner(System.in); int inputByte=sc.nextInt(); if(inputByte<3) { System.out.print(-1); } else { for(int i=inputByte; i>0; i--){ ...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.Scanner; public class Main { /** * @param args */ public static void main(String[] args) { Scanner r = new Scanner(System.in); int N = r.nextInt(); if(N <= 2)System.out.println(-1); else{ for(int x = N; x >= 1; x--) System.out.println(x); } } }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int main() { int n; scanf("%d", &n); if (n < 3) printf("-1\n"); else { for (int i = 0; i < n; i++) printf("%d ", n + 2 - i); } return 0; }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int main() { ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0); int n; cin >> n; if (n <= 2) cout << -1; else { cout << 3 << ' ' << 2 << ' ' << 1 << ' '; for (int i = 4; i <= n; i++) cout << i << ' '; } return 0; }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int main() { int n; while (cin >> n) { if (n <= 2) cout << "-1" << endl; else { for (int i = n; i > 1; i--) cout << i << " "; cout << "1" << endl; } } return 0; }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int(input()) res = "" if n<3: print(-1) else: for u in range(-n,0): res = res + "{} ".format(-u) print(res[:-1])
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int(input()) if n <= 2: print(-1) else: arr = [] for i in range(n, 0, -1): print(i, end=' ')
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n = int(raw_input()) if n == 1 or n == 2: print -1 else: for i in range(2, n+1): print i, print 1
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.IOException; import java.io.InputStream; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.*; public class Test { static long[] a = {47, 74, 4477, 4747, 4774, 7447, 7474, 77...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
x = int(input()) if x < 3: print("-1") else: for i in range(x): print((x - i), end=" ")
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> int main() { int n, i; while (scanf("%d", &n) != EOF) { if (n <= 2) printf("-1\n"); else { printf("%d %d ", n - 1, n); for (i = 1; i <= n - 2; i++) printf("%d%c", i, i == n - 2 ? '\n' : ' '); } } return 0; }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int n; int main() { cin >> n; if (n == 1 || n == 2) return cout << -1, 0; n++; while (n-- - 1) cout << n << " "; return 0; }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n < 3) cout << -1; else while (n) cout << n-- << " "; }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.*; public class Second { public static void main(String args[]) { Scanner sc = new Scanner(System.in); int n = Integer.parseInt(sc.nextLine()); if (n<3){ System.out.println(-1); return; } for (int i=0;i<n;i++) { System.out.pr...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n=input() print -1 if n<3 else ' '.join(map(str,[n-1,n]+range(1,n-1)))
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.awt.*; import java.awt.geom.*; import java.io.*; import java.math.*; import java.text.*; import java.util.*; public class Main { private static BufferedReader br; private static StringTokenizer st; private static PrintWriter pw; public static void main(String[] args) throws IOException { br = new Bu...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.io.PrintWriter; import java.util.StringTokenizer; /** * Created with IntelliJ IDEA. * File: Test * User: unit7 * Date: 05.10.12 * Time: 23:14 */ public class Main { public static void main(String[] args)...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.*; import java.io.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int n = sc.nextInt(); if(n <=2 ) { System.out.println(-1); return; } System.out.print(n); for(int i=n; i>=2...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n <= 2) { cout << -1; return 0; } for (int i = n; i >= 1; i--) cout << i << " "; return 0; }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n=int(input());l=[] if(n<=2): print(-1) else: for i in range(n,0,-1): l.append(str(i)) print(' '.join(l))
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#!/usr/bin/env python import sys n = int(next(sys.stdin)) if n > 2: a = [3, 2] + [1] * (n - 2) print ' '.join(map(str, a)) else: print -1
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
import java.util.*; import java.io.*; public class A { static int n; public static void main(String[] main) throws IOException { Scanner input = new Scanner(System.in); n = input.nextInt(); if(n < 3) { System.out.println(-1); return; } int[] a = new int[n]; for(int i = 0; i < n; i++) if(...
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
n=int(input()) f=[] for j in range(n): f.append(j+1) if n<=2: print(-1) else: print(*f[::-1])
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
#include <bits/stdc++.h> using namespace std; int main() { int n; cin >> n; if (n < 3) cout << -1 << endl; else { n--; while (n--) cout << n + 2 << ' '; cout << 1 << endl; } }
Problem: Little boy Valera studies an algorithm of sorting an integer array. After studying the theory, he went on to the practical tasks. As a result, he wrote a program that sorts an array of n integers a1, a2, ..., an in the non-decreasing order. The pseudocode of the program, written by Valera, is given below. The ...
def buggy_sort(n): if n<=2: print(-1) return else: t=100 a=[] for i in range(55): a.append(t) t=t-1 for i in range(n): print(a[i],end=' ') n=int(input('')) buggy_sort(n)