Archives
Trending
Support
Login
clear text
XML
Django
JavaScript
MATLAB
C
C++
C#
Python
SQL
Shell
Bash
Markdown
YAML
JSON
HTML
CSS
PHP
Java
Ruby
Go
Rust
Swift
Kotlin
Arduino
TypeScript
Perl
Autohotkey
Lua
SQF
R
Scala
Haskell
Groovy
Dart
Clojure
VB.NET
Objective-C
PowerShell
Bash
CoffeeScript
Verilog
#include
using namespace std; int main() { int a,b,desno,levo,l,l1,a1,a2,low; a1=0; a2=0; low=2000000000; cin>>a >> b >>desno >>levo >>l; int high = 2000000000; int niza[l]; for(int i=0;i
>l1; niza[i]=l1; } if(l == 0) { if(a < b) { cout << (b - a) * desno << endl; } else { cout << (a - b) * levo << endl; } return 0; } for(int i=0;i
=a) { a1=(niza[i]-a)*desno; if(a1
= b) { a1 = (niza[i] - b) * levo; if(a1 < high) { high = a1; } } if(niza[i] <= b) { a2 = (b - niza[i]) * desno; if(a2 < high) { high = a2; } } } int R = low + high; int b1; if(a <= b) { b1 = (b - a) * desno; if(R > b1) { R = b1; } } if(a >= b) { b1 = (a - b) * levo; if(R > b1) { R = b1; } } cout<
Mark as private (unlisted)
for 30 minutes
for 6 hours
for 1 day
for 1 week
for 1 month
for 1 year
everlasting (like CCCP)