Type: Default 1000ms 256MiB

Blah数集

You cannot submit for this problem because the contest is ended. You can click "Open in Problem Set" to view this problem in normal mode.

Description

数学家高斯小时候偶然间发现一种有趣的自然数集合Blah。对于以a为基的集合Blah定义如下:

1)a是集合Blah的基,且a是Blah的第一个元素;

2)如果x在集合Blah中,则2x+1和3x+1也都在集合Blah中;

3)没有其他元素在集合Blah中了。

现在小高斯想知道如果将集合Blah中元素按照升序排列,第n个元素会是多少?注意:集合中没有重复的元素。

Input Format

一行两个正整数,分别表示集合的基a以及所求元素序号n,1≤a≤50,1≤n≤1000000。

Output Format

一行一个正整数,表示集合Blah的第n个元素值。

1 100

418

28 5437

900585

寒假集训_01_14

Not Attended
Status
Done
Rule
XCPC
Problem
6
Start at
2025-1-14 14:00
End at
2025-1-14 17:00
Duration
3 hour(s)
Host
Partic.
40