Xantipius 15

It's the Russians too ... (translated by Google)
Btw, till 2009 I knew nothing about this "Tzar H-Bomb".
More precisely, I was never interested to know anything about it.

The most powerful bomb explosion

16.12.2008 #191-192 - "Narodnaya Volya" (a bielorussian newspaper)
Author: Nikolai Grechanik, a former Soviet military pilot, Brest

Day 30 October 1961 was not included in the calendar of the USSR as a day of
national pride Soviet people, but was proud of what. About the Record -
sinister, of course, but in many displaced - then we have not learned.
October 30, 1961 in a clear sky over New Earth lit up a second sun! It
burned 70 seconds, illuminating huge snowy archipelago piercing glare. It
was the most powerful in the world thermonuclear explosion of air power more
than 50 megatons of TNT.

To explode "Tsar Bomb" began to prepare for the five years ahead of the day.
However, the in the language of the military was called the Atomic Bomb
quite prosaic - "Article 202".

Eight-meter diameter of two meters of product weighed 26 tons! To pick up in
the air such a machine, required special modifications, long-range strategic
Bomber "Tu-95". Choose the best type of suspension - "polunaruzhny"
("half-outsided").

In this case, the language of the documents, "bomb bay doors were modified
to hull form products with drowning them inside the fuselage. "According to
the plan test bomb had exploded in the air above the ground. For this had to
develop ...

Xantipius 15

As a chaser for vodka I like hot & very strong black tea: one draught of vodka, then 2 or 3 draughts of tea (no any sugar!!! by no means!!!). As a snack for it: smth very light & salty; e.g., caviar, fish, meat (and again, by no means any fruits, vegs, bread etc).

Xantipius 15

hahaha... just recalled...
You can't imagine to WHAT DEGREE Indian movies were popular in the USSR.
It was really an INCREDIBLE popularity =)

Xantipius 15

Ramana Maharishi (? - 14.04.1950)
I had learned about him (and his teachings) in 1980s,
from a Soviet book titled "The current Indian philosophy".

Xantipius 15

About 10-15 years ago I came across a book by Valentin Zorin (he was a complete Kremlin's journalist and talented one). The book's title was "Americans" (published in 1967 by "State Publishing House for Children" ("Detghiz")).

I was amazed how warmly he depicts Americans and America itself and esp. Kennedy brothers.
Zorin considers billionair Harold Hunt as who killed John Kennedy. Btw, Zorin met H. Hunt in a house of the latter, for an interview.

Later on Zorin asked his american colleages: what the hell is with Hunt's hair?
They explained it to him: Mr. Hunt cut his own hair... hehe...

Xantipius 15

Mahatma Gandhi , father of the nation in my country.

Totally agree with you. He was a greatest man on the planet. Nobody can compare to him.

Joan of Arc

It is a decent choice, too.
As for other European/American/Russian "heroes" -- I can't recall anybody.
Maybe only Thomas Jefferson and Stolypin (a Russian prime-minister in early 1900s,
he was killed (shot) by "communistic" terrorists, in a Kiev's Theater).

Xantipius 15

Cute, a payment can be a painment.

heh You are right!
Plus, I slipped typos at the very end of my code (should be "ans[]", not "a[]").

x = input('Enter the before-tax price (in cents): ')
y = input('Enter your painment (in cents): ')
z = y - int(1.05 * x)

ans = [0, 0, 0, z]
a = [z / 100, 0, 0, 0]
i = a[0]
for j in range(0, (z - i * 100) / 25 + 1):
    a[1] = j
    a[2] = (z - i * 100 - j * 25) / 10
    k = a[2]
    a[3] = z - i * 100 - j * 25 - k * 10
    if sum(a) < sum(ans):
        ans = a[:]

print 'Your change is:', z
print 'Dollars =', ans[0]
print 'Quarters =', ans[1]
print 'Dimes =', ans[2]
print 'Pennies =', ans[3]

###########################################

Enter the before-tax price (in cents): 3438
Enter your painment (in cents): 56789
Your change is: 53180
Dollars = 531
Quarters = 2
Dimes = 3
Pennies = 0

Xantipius 15

Spot.Spot(myLine[j] == 'B')
or
from Spot import Spot

Xantipius 15

x = input('Enter the before-tax price (in cents): ')
y = input('Enter your painment (in cents): ')
z = y - int(1.05 * x)

ans = [0, 0, 0, z]
a = [z / 100, 0, 0, 0]
i = a[0]
for j in range(0, (z - i * 100) / 25 + 1):
    a[1] = j
    for k in range(0, (z - i * 100 - j * 25) / 10 + 1):
        a[2] = k
        a[3] = z - i * 100 - j * 25 - k * 10
        if sum(a) < sum(ans):
            ans = a[:]

print 'Your change is:', z
print 'Dollars =', a[0]
print 'Quarters =', a[1]
print 'Dimes =', a[2]
print 'Pennies =', a[3]

Enter the before-tax price (in cents): 3456
Enter your painment (in cents): 56789
Your change is: 53161
Dollars = 531
Quarters = 2
Dimes = 1
Pennies = 1

Xantipius 15

I think the nickels are missed here on purpose. E.g.,
80 = 3 25 + 5 1 => 8 coins
80 = 2 25 + 3 10 => 5 coins (required minimum)

Xantipius 15

Actually & formally I'm not a Russian but a Bielorussian (i.e., White Russian). But it's all the same; no difference. Here, in Belarus, nobody speaks our Bielorussian language (much more old one than current Russian). And the both langs are (in)direct descendants of Sanscrit.

Xantipius 15

No, it's not the main reason (not a reason at all).
The aim of their boozing is to forget abt the Earthy Life and to merge with
Celestial Spheres. A kind of escapism. Russians get bored very quickly from anything.
They could easily send an expedition even to Pluto, but alas they are bored by Cosmos.
Also they are inclined to drop their undertakings on half-way.

Xantipius 15

@DavidB, I strongly doubt it has any practical use.

@all, you can test your solutions here => http://www.spoj.pl/problems/PIB
My account there => http://www.spoj.pl/users/zzz but seems I had quitted the game.

Xantipius 15

If it'd be "regular" Fibonaccies, then it could be solved like this (by matrix multiplication):

def mx_power(a, n):
    def mx_mult(x, y):
        xy = [[0, 0], [0, 0]]
        xy[0][0] = x[0][0] * y[0][0] + x[0][1] * y[1][0]
        xy[0][1] = x[0][0] * y[0][1] + x[0][1] * y[1][1]
        xy[1][0] = x[1][0] * y[0][0] + x[1][1] * y[1][0]
        xy[1][1] = x[1][0] * y[0][1] + x[1][1] * y[1][1]
        return xy
    if n == 1:
        return a
    z = mx_power(a, n / 2)
    z = mx_mult(z, z)
    if n % 2 == 1:
        z = mx_mult(z, a)
    return z

a = [[0, 1], [1, 1]]

while 1:
    n = input('Fib #')
    b = mx_power(a, n)
    print b[0][1]

#####################################

Fib #1
1
Fib #2
1
Fib #3
2
Fib #4
3
Fib #5
5
Fib #6
8
Fib #7
13
Fib #333
1751455877444438095408940282208383549115781784912085789506677971125378
Fib #8838
48225809596142534376618515362027218452508426090074012557355634337847915612490223
18120365804305785581728479437697584525555564681211807799338004105533110761575522
96912560126893691740944915344256753117339760354416396594599180516587355753095490
30521474122558244060501148290159145334419074812775281240826894686945130920468766
11860207946005245829996752193087718016554989764096033854492846895243426943369212
21607820048120418520658545388789707380991628975932820237612906232856026138749321
26237780464892932617189488990614045548635208017100860651236068662537861490334043
44215159543263717182033994043486344602183493422622175520597873907158095570271080
95807709501340633203297325399977270630853294000731555630763323404978288332480189
65025748421768900286160792796561391956151937138165763730339386988180202672907051
57985780707285937004403532029349585638112580101535912624388057075177682945808659
81360956877549852415522747638224382957964154889014243726132784119623176484637349
60828256910997881694731274476476851075393192067342121769023839107117511426357830
90279866103231589984391898195080766781699569058594395050266523708581378365859557
03972571910543034240945771710369801129775967832767478314090654259264133871607249
93852643809660060157460531130424300577332148267883719780553544298706240142373827
00477752579369462684994079842774010795711145302897441995790312827146255645251118
62872177420547092043358047694093167874308893781212787664498331046020847324996723
57096673203695685612674682736318028233540880071923506401998213016828869643542327
01398407242537450238944533389061086886440948089440536201156377467752427032611488
69588620631539427050286368171172119714590518649581262001071022674956700818149009
76368402184279431235914229382452571080387286649317153626553282428353728897494159
76298295100354976592706081718672786556808152975580383891140547171664608953919839
5239944
Fib #

Xantipius 15

@np complete, do you mean smth like this:?

from math import pi

def pib(x):
    if x < 4:
        return 1
    return pib(x - 1) + pib(x - pi)

Obviously, it's not the solution.

Xantipius 15

You might have heard of the Fibonacci numbers and of the number pi.
If you let these two ideas merge, a new and esoteric concept comes into being:
the Pibonacci numbers. These can be defined for real x >= 0 by:

P(x) = 1 for 0 <= x < 4
P(x) = P(x - 1) + P(x - pi) for x >= 4,

where pi = 3.1415926535... In this problem, you are asked to compute P(x) for a given x,
where x is a non-negative integer number (less than 30000).

Hints:

P(0) = 1

P(4) = 2

P(10) = 14

P(11) = 20

P(100) = 5338198515572716

P(10000) =
30545061766548826347723622438005598334547039374992
90113008199964715857981506903607585689770339053086
23582036970173222028695034160773457277489005548434
17020796291845338949687167603974595558347137121217
94967248559855843389551994870458311313312344050309
26953096233856792547217501033692773439422753706749
75787164384879377786735733077303986883046271278570
21201893525701528659063857187966332441184716237226
69326907300731819842942377628687148684970555383475
59934470505111156957972054431125340438368447868289
62291699146142605916313354358025513818642587234401
29221003159635553765229982268111989465247965530579
11455875848567970805369891745228832920941822856078
71837646059510451089216388517941864454024561344107
87338437660695880294107196594263246220666104829574
17308001324200284988508657339845510890573271727796
85014714292928424032536221127315507955108814140393
81098371314381088699431874240026717000932753775313
09851253295038144278739276090483044831966040316689
77605611576202999395210908046726682599785866106081
25086280732687524214522573222031212086354074164955
96961873718206154505873516193044667895322796150306
05267341100116655225123834641245441248980916942413
26205649996121608255109099308055932633784720918028
64438756163075739226587263206887350265551536945610
37013044605514190168453868193943302408320903816087
56718108514024423395755370256937230041005874987898
52381791671318491462930261787039199555019880263789
23751491521989840810768222435642807253020761248276
33075558810802435250802095650410899109886849531218
27273903819599408284858157102491364090281856443316
14100508402747147674473055900552596251489724880320
7988426623314191

P(29999) = ???

P.S.
It's a problem from IPSC 2001.

Xantipius 15

It's me: http://funkybee.narod.ru/misc/pioneer.jpg
when I was a pioneer, wearing my red pioneer's tie (circa 1975).

Xantipius 15

Yes, I was growing up at those times (my DOB is June 1 (Monday), 1964).
And you know, mike_2000_17, I can't say anything special about it, apart from that the Soviet educational system was just a superb one and the share of "communistic" propaganda in it was not too annoying for us, schoolgirls & schoolboys. In general, we simply ignored it.

I don't miss much the USSR but I must admit: the USSR had many advantages for ordinary people. E.g., absolutely free high education for any able girls/guys etc.

Xantipius 15

Here there is no such a notion as "brand of vodka".
People choose it judging and relying on which local distillery it was produced.
If my pal sends me to the shop to buy a bottle he says: don't buy our (from our town) vodka, buy either from Minsk or Brest's.

But actually it's not the vodka (in historical sense of this word). It's a solution of ethanol (C2H5OH, made from wheat or rye or from oil or even wood - we can't know its origin for sure) in more or less pure water.

The true vodka it's so called "samogon" ("homebrewage") which is really made/distilled from wheat. What we buy in shops is rectified product.

Xantipius 15

Not all so simple with tobacco smoking as it seems at first glance.
Medical statistics says: those who smoke 1-10 cigs/day ("moderate smokers")
live longer than absolute non-smokers.
Also, smokers never suffer from Altzheimer's, Parkinson's deseases.
Smoking mothers have no babies with Downe's desease.

PS
Many years ago I met a quote from "Thorax" (an american medical monthly) stating that:

To quit tobacco smoking is harder than to stop doing heroin

Xantipius 15

My BMI (body mass index) <= 18.5 ("underweight"), my height is ~183 cm,
meanwhile I like very much the lard / schmaletz, with rye bread & salt.

Xantipius 15

We as humans are tempered by our desires...

As Oscar Wilde once said: I can resist to anything, but temptations...

Xantipius 15

I'm a heavy smoker (30-40 cigarettes per each 24 hours), since my 19.
I like very much dry red wines, but it is too costly for my wallet.
Don't know what to say about the beer; maybe I've never drunk/met a true beer.
I don't like the vodka (our native drink/plonk) and all of this kind.
Of course, except of cognac :) Also I'm a black tea addict.

Xantipius 15

Kert,
in Python 2.5 your script works fine.
Means... what? A bug, I guess.

Xantipius 15

enjoy:

f = open('C:/data.txt', 'rt')
a = f.read().split('\n')
f.close()
del a[0]
del a[10:]
print a

Xantipius 15

output will be:

['2 bbb', '4 c', '3 hhhhh', '1 zzz']