GOOGLE_SHEETS Telegram 1541
Google Таблицы
Пост от нашего читателя Алексея Odysseus Сегодня у нас не обычный материал, а задачка. Есть тарифы на электроэнергию: дневной и ночной. Задан период работы электроприбора. Максимальное время работы прибора - 24ч. Посчитать, сколько нужно заплатить за потребленную…
И ответ на задачку от её автора, Алексея:


Приведу пример оптимального метода расчета для самого простого варианта.

Дано. 2 временных интервала, заданные началами и концами.
start1 - finish1 и start2 - finish2. Найти начало и конец пересечения интервалов, обозначим их как begin и end.


При условии: start1 < finish1 и start2 < finish2

begin = max (start1; start2)
end = min (finish1; finish2)


На примерах с иллюстрации.

1. start1 = 6; finish1 = 18
start2 = 9; finish2 = 15

begin = max (6; 9) = 9
end = min (18; 15) = 15


2. start1 = 6; finish1 = 18
start2 = 3; finish2 = 15

begin = max (6; 3) = 6
end = min (18; 15) = 15


3. start1 = 6; finish1 = 18
start2 = 9; finish2 = 21

begin = max (6; 9) = 9
end = min (18; 21) = 18



tgoop.com/google_sheets/1541
Create:
Last Update:

И ответ на задачку от её автора, Алексея:


Приведу пример оптимального метода расчета для самого простого варианта.

Дано. 2 временных интервала, заданные началами и концами.
start1 - finish1 и start2 - finish2. Найти начало и конец пересечения интервалов, обозначим их как begin и end.


При условии: start1 < finish1 и start2 < finish2

begin = max (start1; start2)
end = min (finish1; finish2)


На примерах с иллюстрации.

1. start1 = 6; finish1 = 18
start2 = 9; finish2 = 15

begin = max (6; 9) = 9
end = min (18; 15) = 15


2. start1 = 6; finish1 = 18
start2 = 3; finish2 = 15

begin = max (6; 3) = 6
end = min (18; 15) = 15


3. start1 = 6; finish1 = 18
start2 = 9; finish2 = 21

begin = max (6; 9) = 9
end = min (18; 21) = 18

BY Google Таблицы





Share with your friend now:
tgoop.com/google_sheets/1541

View MORE
Open in Telegram


Telegram News

Date: |

Administrators In handing down the sentence yesterday, deputy judge Peter Hui Shiu-keung of the district court said that even if Ng did not post the messages, he cannot shirk responsibility as the owner and administrator of such a big group for allowing these messages that incite illegal behaviors to exist. Telegram is a leading cloud-based instant messages platform. It became popular in recent years for its privacy, speed, voice and video quality, and other unmatched features over its main competitor Whatsapp. Public channels are public to the internet, regardless of whether or not they are subscribed. A public channel is displayed in search results and has a short address (link). Just at this time, Bitcoin and the broader crypto market have dropped to new 2022 lows. The Bitcoin price has tanked 10 percent dropping to $20,000. On the other hand, the altcoin space is witnessing even more brutal correction. Bitcoin has dropped nearly 60 percent year-to-date and more than 70 percent since its all-time high in November 2021.
from us


Telegram Google Таблицы
FROM American