using System; using System.Collections.Generic; using System.Text; using System.Linq; class Program { public void Proc() { Reader.IsDebug = false; this.TargetCount = int.Parse(Reader.ReadLine()); List ret = this.GetAns(0,0); Console.WriteLine(ret.Count + " " + ret.Sum(a=>a)); } private Dictionary>> dic = new Dictionary>>(); private long TargetCount; private List GetAns(int idx, int cnt) { if(!dic.ContainsKey(idx)) { dic.Add(idx, new Dictionary>()); } if(dic[idx].ContainsKey(cnt)) { return dic[idx][cnt]; } List ret = new List(); if(idx >= 31) { if(cnt == TargetCount) { ret.Add(0); } return ret; } if(cnt > this.TargetCount) { return ret; } if(TargetCount - cnt > 31 - idx) { return ret; } List tmp = this.GetAns(idx + 1, cnt); List tmp2 = this.GetAns(idx + 1, cnt + 1); ret.AddRange(tmp); tmp2.ForEach(a=>ret.Add(a + (1<