Problem hidden
|This problem was hidden by Editorial Board member probably because it has incorrect language|version or invalid test data, or description of the problem is not clear.|

NUMBERS - Những con số

Numbers

In a website for mathematical lovers, there is a puzzle as following: given N positive integers, you have to color each number so that each number is not divided by a number that has the same color and the number of used colors is minimized.

Finding this puzzle interesting, Bom asks for your help to solve it! Write a program that help Bom solve this puzzle.

Input

  • Line 1: a positive integer N.
  • Line 2: N positive integers a1, a2, a3, ..., an.

Output

  • Line 1: a positive integer K that is the minimum number of used color.
  • In the ith line of the next K lines, write a number ci indicating how many numbers of color i following by ci numbers of color i.

Constraints

  • N belongs to [1, 50000]
  • ai belongs to [1, 106]

Note

If there are several ways to color the numbers, print any of them.

Example

Input
10
24 7 42 8 2 16 22 21 33 11	

Output
3
3 7 2 11 
4 8 22 21 33 
3 24 42 16

Được gửi lên bởi:Jimmy
Ngày:2008-07-18
Thời gian chạy:1s
Giới hạn mã nguồn:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Ngôn ngữ cho phép:Tất cả ngoại trừ: ERL GOSU JS-RHINO NODEJS PERL6 PYPY RUST SED VB.NET
Nguồn bài:VNOI Marathon '08 - Round 8/DivB
Problem Setter: Ngô Minh Đức

hide comments
2017-12-27 09:21:48
nhật hào là cái gì mà đi đâu cũng thấy vậy
2017-12-27 08:15:55
nhật hào sạch

2017-05-03 15:53:25
test yếu vc, mình làm cực trâu (theo như tự đánh giá) mà cũng full @@
@phanduy16
2015-09-08 14:11:57
https://thewizard6296.wordpress.com/2015/09/04/5/
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.